Mxt Graphic Tool Functions

:Associate with "Mxt Graphic Tool Functions" More...

Functions

int MxtAddCallback (MXTHANDLE vmxt, McbCallbackFunc func, void *udata, UINT32 reason)
void MxtCallActivateCallback (MXTHANDLE mxt)
int MxtCallbackAddExt (MXTHANDLE vmxt, McbCallbackFunc func, void *udata, UINT32 reason, INT8 priority)
void MxtCallChangeCallback (MXTHANDLE mxt, UINT32 reason)
void MxtClearPosition (MXTHANDLE mxt)
MXTHANDLE MxtCreate (Widget pwidget, MXTHANDLE(*CreateFunc)(UINT32, void *), UINT32 flags)
MXTHANDLE MxtCreateCrossHair (Widget dawidget, UINT32 flags=0)
MXTHANDLE MxtCreateEArc (Widget dawidget, UINT32 flags=0)
MXTHANDLE MxtCreateEBox (Widget dawidget, UINT32 flags=0)
MXTHANDLE MxtCreateEBreakLine (Widget dawidget, UINT32 flags=0)
MXTHANDLE MxtCreateECircle (Widget dawidget, UINT32 flags=0)
MXTHANDLE MxtCreateEEllipse (Widget dawidget, UINT32 flags=0)
MXTHANDLE MxtCreateELine (Widget dawidget, UINT32 flags=0)
MXTHANDLE MxtCreateEMBox (Widget dawidget, UINT32 flags=0)
MXTHANDLE MxtCreateEMultiPoint (Widget dawidget, UINT32 flags=0)
MXTHANDLE MxtCreateEMultiPolyLine (Widget dawidget, UINT32 flags=0)
MXTHANDLE MxtCreateENode (Widget dawidget, UINT32 flags=0)
MXTHANDLE MxtCreateEPoint (Widget dawidget, UINT32 flags=0)
MXTHANDLE MxtCreateEPolyLine (Widget dawidget, UINT32 flags=0)
MXTHANDLE MxtCreateERegion (Widget dawidget, UINT32 flags=0)
MXTHANDLE MxtCreateERegPoly (Widget dawidget, UINT32 flags=0)
MXTHANDLE MxtCreateETextLabel (Widget dawidget, UINT32 flags=0)
MXTHANDLE MxtCreateFollowPoint (Widget dawidget, UINT32 flags=0)
MXTHANDLE MxtCreateSelectPoint (Widget dawidget, UINT32 flags=0)
MXTHANDLE mxtCrossHair (UINT32 flags, void *pwidget)
void MxtDestroy (MXTHANDLE mxt)
void MxtDrawGraphic (MXTHANDLE vmxt, const LRECT2D *rect)
MXTHANDLE mxtEArc (UINT32 flags, void *pwidget)
MXTHANDLE mxtEBox (UINT32 flags, void *pwidget)
MXTHANDLE mxtEBreakLine (UINT32 flags, void *pwidget)
MXTHANDLE mxtECircle (UINT32 flags, void *pwidget)
int MxtEditGlobalOptions (Widget pwidget)
MXTHANDLE mxtEEllipse (UINT32 flags, void *pwidget)
MXTHANDLE mxtELine (UINT32 flags, void *pwidget)
MXTHANDLE mxtEMBox (UINT32 flags, void *pwidget)
MXTHANDLE mxtEMultiPoint (UINT32 flags, void *pwidget)
MXTHANDLE mxtEMultiPolyLine (UINT32 flags, void *pwidget)
void MxtEnableGps (Widget pwidget, int enabled)
MXTHANDLE mxtENode (UINT32 flags, void *pwidget)
MXTHANDLE mxtEPoint (UINT32 flags, void *pwidget)
MXTHANDLE mxtEPolyLine (UINT32 flags, void *pwidget)
MXTHANDLE mxtERegion (UINT32 flags, void *pwidget)
MXTHANDLE mxtERegPoly (UINT32 flags, void *pwidget)
MXTHANDLE mxtETextLabel (UINT32 flags, void *pwidget)
MXTHANDLE mxtFollowPoint (UINT32 flags, void *pwidget)
void MxtFreeValues (MXTHANDLE mxt, void *toolvalues)
Widget MxtGenerateManualForm (MXTHANDLE vmxt, Widget parent)
int MxtGenerateRegion (MXTHANDLE vmxt, REGION2D &region, UINT32 flags)
Widget MxtGenerateSpatialForm (MXTHANDLE vmxt, Widget parent)
Widget MxtGenerateToolForm (MXTHANDLE vmxt, Widget parent)
void MxtGetArrowKeyDeltas (MXTHANDLE mxt, double *delta_x, double *delta_y)
int MxtGetBounds (MXTHANDLE mxt, DRECT2D *rect)
MXTHANDLE MxtGetCurrentTool (MXTHANDLE mxt)
UINT32 MxtGetFlags (MXTHANDLE mxt)
void MxtGetGlobalColor (int *UseTool, COLOR *color, COLOR *seccolor, int *LineWidth)
int MxtGetManualMode (MXTHANDLE mxt)
void MxtGetManualParms (MXTHANDLE mxt, MANUALTOOLPARMS *mtparms)
UINT32 MxtGetReasonClass (UINT32 reason)
void MxtGetSnapGrid (MXTHANDLE mxt, SNAPGRIDPARMS *snapgrid)
int MxtGetSnapGridMode (MXTHANDLE mxt)
GC MxtGetToolGC (MXTHANDLE mxt)
int MxtGetToolSize (MXTHANDLE mxt)
void MxtGetTrans2D (MXTHANDLE mxt, TRANS2D_AFFINE &TtoW)
void * MxtGetUserData (MXTHANDLE mxt)
int MxtGetValues (MXTHANDLE mxt, void *toolvalues)
int MxtGetXYDigitizerMode (MXTHANDLE mxt)
int MxtHasPosition (MXTHANDLE mxt)
int MxtInBgUpdateCall (MXTHANDLE mxt)
int MxtIsManaged (MXTHANDLE mxt)
int MxtIsSuspended (MXTHANDLE mxt)
int MxtIsTrackingGps (MXTHANDLE mxt)
void MxtManage (MXTHANDLE mxt)
int MxtManualViewCoordRefSysSet (MXTHANDLE vmxt, const SPATREF::COORDREFSYS &ViewCoordRefSys, bool ForceProj)
void MxtMove (MXTHANDLE mxt, double dx, double dy, XAnyEvent *event, UINT32 flags)
void MxtRaiseWindow (MXTHANDLE vmxt)
void MxtRemoveCallback (MXTHANDLE vmxt, McbCallbackFunc func, void *udata, UINT32 reason)
void MxtResize (MXTHANDLE mxt, double dx, double dy, XAnyEvent *event, UINT32 flags)
void MxtResume (MXTHANDLE mxt)
void MxtRotate (MXTHANDLE mxt, double drot, XAnyEvent *event, UINT32 flags)
void MxtSaveGlobalColor (char *group)
MXTHANDLE mxtSelectPoint (UINT32 flags, void *pwidget)
void MxtSetActivateCallback (MXTHANDLE mxt, void(*CBFunc)(MxtAnyCallbackStruct *, void *), void *udata)
void MxtSetArrowKeyDeltas (MXTHANDLE mxt, double delta_x, double delta_y)
void MxtSetBgUpdateFunc (Widget pwidget, void(*UpdBg)(Widget, DRECT2D *, void *), void *udata)
void MxtSetBounds (MXTHANDLE mxt, DRECT2D *rect, UINT32 flags)
void MxtSetChangeCallback (MXTHANDLE mxt, void(*CBFunc)(MxtAnyCallbackStruct *, void *), void *udata)
int MxtSetDialogPosition (MXTHANDLE vmxt, int NewPosn)
void MxtSetFlags (MXTHANDLE mxt, UINT32 flags)
void MxtSetGlobalColor (Widget parent, int UseTool, const COLOR &color, const COLOR &seccolor, int LineWidth)
void MxtSetGpsSource (MXTHANDLE vmxt, void *vNewSource)
void MxtSetHelpString (MXTHANDLE mxt, char *helpstr)
void MxtSetManualMode (MXTHANDLE mxt, int setflag)
int MxtSetManualParms (MXTHANDLE mxt, MANUALTOOLPARMS *mtparms)
int MxtSetOutputTrans (MXTHANDLE vmxt, TRANSPARM *tparm)
int MxtSetSnapGrid (MXTHANDLE mxt, SNAPGRIDPARMS *snapgrid)
void MxtSetSnapGridMode (MXTHANDLE mxt, int setflag)
void MxtSetToolColor (MXTHANDLE vmxt, COLOR *color, COLOR *seccolor, int LineWidth)
void MxtSetTrans2D (MXTHANDLE mxt, const MAT3X3 OtoD, const MAT3X3 DtoO)
void MxtSetTrans2D (MXTHANDLE mxt, const TRANS2D_AFFINE &TtoW)
void MxtSetUserData (MXTHANDLE mxt, void *udata)
int MxtSetValues (MXTHANDLE mxt, void *toolvalues, int notify)
void MxtSetWindowButtonRow (MXTHANDLE mxt, BUTTONITEM *buttonrow, void *udata)
void MxtSetWindowFormCallback (MXTHANDLE mxt, int(*AddToForm)(Widget, void *), void *udata)
void MxtSetWindowSaveButton (MXTHANDLE mxt, char *savebutton)
void MxtSetWindowTitle (MXTHANDLE mxt, TEXTID textid)
void MxtSetXORPixel (MXTHANDLE mxt, Pixel pixel)
void MxtSetXYDigitizerMode (MXTHANDLE mxt, int setflag)
void MxtSetXYDtoObjectTrans (MXTHANDLE mxt, TRANSFUNC tfunc, void *udata)
void MxtShear (MXTHANDLE mxt, double dshear, XAnyEvent *event, UINT32 flags)
void MxtSuspend (MXTHANDLE mxt)
void MxtTrackGps (MXTHANDLE vmxt, int track)
void MxtUnmanage (MXTHANDLE mxt)

Detailed Description

:Associate with "Mxt Graphic Tool Functions"


Function Documentation

int MxtAddCallback ( MXTHANDLE  vmxt,
McbCallbackFunc  func,
void *  udata,
UINT32  reason 
)

Add callback to tool.

Valid reasons: The reasons are in reason classes

Parameters:
vmxt  Add callback to tool
func  Callback function
udata  User data passed to func
reason  Reason set flags to get callbacks on

void MxtCallActivateCallback ( MXTHANDLE  mxt  ) 

Call "activate" callback for specified tool.

Parameters:
mxt  Tool handle

int MxtCallbackAddExt ( MXTHANDLE  vmxt,
McbCallbackFunc  func,
void *  udata,
UINT32  reason,
INT8  priority 
)

Add callback to tool with position determined by priority.

Parameters:
vmxt  Add callback to tool
func  Callback function
udata  User data passed to func
reason  Reason set flags to get callbacks on

void MxtCallChangeCallback ( MXTHANDLE  mxt,
UINT32  reason 
)

Call "change" callback for specified tool.

Parameters:
mxt  Tool handle
reason  Callback reason

void MxtClearPosition ( MXTHANDLE  mxt  ) 

Clear tool position (erasing tool).

This function undraws the tool then clears the tool information. Useful in activate callbacks to simulate adding elements.

Parameters:
mxt  Handle returned by MxtCreate()

MXTHANDLE MxtCreate ( Widget  pwidget,
MXTHANDLE(*)(UINT32, void *)  CreateFunc,
UINT32  flags 
)

Create new tool instance.

This function creates a tool handle by calling the appropriate tool create function. It also sets up the default tool position which will be a clear tool (no info). Neither the tool create function nor this function will create the dialog. Any setup of the tool dialog must be done before MxtManage() is called because MxtManage() sets up the dialog. NOTE: Call MxtSetValues() to setup default tool information. List of flags to pass in this function (see MxtSetFlags()).

Parameters:
pwidget  Drawing Area widget
flags  Function to create specific tool MxtFLAG... flags

MXTHANDLE MxtCreateCrossHair ( Widget  dawidget,
UINT32  flags = 0 
) [inline]

Create crosshair tool.

Returns:
Tool handle (mxthandle) used in other Mxt... functions.
Flags for structure initialization
Parameters:
dawidget  DrawingArea widget to contain tool
flags  MxtFLAG_...

Definition at line 1609 of file mxtools.h.

MXTHANDLE MxtCreateEArc ( Widget  dawidget,
UINT32  flags = 0 
) [inline]

Create elastic arc tool.

Returns:
Tool handle (mxthandle) used in other Mxt... functions.
Flags for structure initialization: Flags to control behavior:
Parameters:
dawidget  DrawingArea widget to contain tool
flags  MxtFLAG_...

Definition at line 1628 of file mxtools.h.

MXTHANDLE MxtCreateEBox ( Widget  dawidget,
UINT32  flags = 0 
) [inline]

Create elastic box tool.

Returns:
Tool handle (mxthandle) used in other Mxt... functions.
Flags for structure initialization: Flags to control behavior:
Parameters:
dawidget  DrawingArea widget to contain tool
flags  MxtFLAG_...

Definition at line 1657 of file mxtools.h.

MXTHANDLE MxtCreateEBreakLine ( Widget  dawidget,
UINT32  flags = 0 
) [inline]

Create line breaking tool.

Returns:
Tool handle (mxthandle) used in other Mxt... functions.
Parameters:
dawidget  DrawingArea widget to contain tool
flags  MxtFLAG_...

Definition at line 1667 of file mxtools.h.

MXTHANDLE MxtCreateECircle ( Widget  dawidget,
UINT32  flags = 0 
) [inline]

Create elastic circle tool instance.

Returns:
Tool handle (mxthandle) used in other Mxt... functions.
Flags for structure initialization: Flags to control behavior:
Parameters:
dawidget  DrawingArea widget to contain tool
flags  MxtFLAG_...

Definition at line 1686 of file mxtools.h.

MXTHANDLE MxtCreateEEllipse ( Widget  dawidget,
UINT32  flags = 0 
) [inline]

Create elastic ellipse tool.

Returns:
Tool handle (mxthandle) used in other Mxt... functions.
Flags for structure initialization: Flags to control behavior
Parameters:
dawidget  DrawingArea widget to contain tool
flags  MxtFLAG_...

Definition at line 1705 of file mxtools.h.

MXTHANDLE MxtCreateELine ( Widget  dawidget,
UINT32  flags = 0 
) [inline]

Create elastic line tool instance.

Returns:
Tool handle (mxthandle) used in other Mxt... functions.
Flags to control behavior
Parameters:
dawidget  DrawingArea widget to contain tool
flags  MxtFLAG_...

Definition at line 1720 of file mxtools.h.

MXTHANDLE MxtCreateEMBox ( Widget  dawidget,
UINT32  flags = 0 
) [inline]

Create elastic "move box" tool.

Returns:
Tool handle (mxthandle) used in other Mxt... functions.
Flags to control behavior
Parameters:
dawidget  DrawingArea widget to contain tool
flags  MxtFLAG_...

Definition at line 1737 of file mxtools.h.

MXTHANDLE MxtCreateEMultiPoint ( Widget  dawidget,
UINT32  flags = 0 
) [inline]

Create elastic multi-point tool.

Returns:
Tool handle (mxthandle) used in other Mxt... functions.
Flags to control behavior
Parameters:
dawidget  DrawingArea widget to contain tool
flags  MxtFLAG_...

Definition at line 1751 of file mxtools.h.

MXTHANDLE MxtCreateEMultiPolyLine ( Widget  dawidget,
UINT32  flags = 0 
) [inline]

Create elastic multi-line/polygon tool.

Returns:
Tool handle (mxthandle) used in other Mxt... functions.
Flags to control behavior:
Parameters:
dawidget  DrawingArea widget to contain tool
flags  MxtFLAG_...

Definition at line 1771 of file mxtools.h.

MXTHANDLE MxtCreateENode ( Widget  dawidget,
UINT32  flags = 0 
) [inline]

Create elastic "node" tool.

Returns:
Tool handle (mxthandle) used in other Mxt... functions.
NOTE: This function performs moving nodes in the vector editor.
Parameters:
dawidget  DrawingArea widget to contain tool
flags  MxtFLAG_...

Definition at line 1783 of file mxtools.h.

MXTHANDLE MxtCreateEPoint ( Widget  dawidget,
UINT32  flags = 0 
) [inline]

Create "point" tool.

Returns:
Tool handle (mxthandle) used in other Mxt... functions.
Parameters:
dawidget  DrawingArea widget to contain tool
flags  MxtFLAG_...

Definition at line 1793 of file mxtools.h.

MXTHANDLE MxtCreateEPolyLine ( Widget  dawidget,
UINT32  flags = 0 
) [inline]

Create elastic "polyline/polygon" tool.

Returns:
Tool handle (mxthandle) used in other Mxt... functions.
Flags to control behavior
Parameters:
dawidget  DrawingArea widget to contain tool
flags  MxtFLAG_...

Definition at line 1815 of file mxtools.h.

MXTHANDLE MxtCreateERegion ( Widget  dawidget,
UINT32  flags = 0 
) [inline]

Create "region" display tool.

Tool handle (mxthandle) used in other Mxt... functions.

Flags to control behavior:

Parameters:
dawidget  DrawingArea widget to contain tool
flags  MxtFLAG_...

Definition at line 1828 of file mxtools.h.

MXTHANDLE MxtCreateERegPoly ( Widget  dawidget,
UINT32  flags = 0 
) [inline]

Create elastic "regular polygon" tool.

Returns:
Tool handle (mxthandle) used in other Mxt... functions.
Flags to control behavior:
Parameters:
dawidget  DrawingArea widget to contain tool
flags  MxtFLAG_...

Definition at line 1842 of file mxtools.h.

MXTHANDLE MxtCreateETextLabel ( Widget  dawidget,
UINT32  flags = 0 
) [inline]

Create elastic "text label" tool.

Returns:
Tool handle (mxthandle) used in other Mxt... functions.
Flags to control behavior
Parameters:
dawidget  DrawingArea widget to contain tool
flags  MxtFLAG_...

Definition at line 1861 of file mxtools.h.

MXTHANDLE MxtCreateFollowPoint ( Widget  dawidget,
UINT32  flags = 0 
) [inline]

Create feature follow tool.

Returns:
Tool handle (mxthandle) used in other Mxt... functions.
NOTE: This function uses the MxtCR_SnapCoord callback reason and structure to operate. The reason must be supported.
Parameters:
dawidget  DrawingArea widget to contain tool
flags  MxtFLAG_...

Definition at line 1874 of file mxtools.h.

MXTHANDLE MxtCreateSelectPoint ( Widget  dawidget,
UINT32  flags = 0 
) [inline]

Create point selection tool instance.

Returns:
Tool handle (mxthandle) used in other Mxt... functions.
Parameters:
dawidget  DrawingArea widget to contain tool
flags  MxtFLAG_...

Definition at line 1884 of file mxtools.h.

MXTHANDLE mxtCrossHair ( UINT32  flags,
void *  pwidget 
)

Create an instance of a rotatable crosshair tool.

void MxtDestroy ( MXTHANDLE  mxt  ) 

Destroy previously created tool instance.

This function does basic cleanup of the tool. It will unmanage the tool if not done so already. It will also remove the tool tag string to keep the tool pointer from being used as a tool. It will free the pointer.

Parameters:
mxt  Tool handle

void MxtDrawGraphic ( MXTHANDLE  vmxt,
const LRECT2D rect 
)

Draw tool graphic.

Parameters:
vmxt  Handle returned by MxtCreate()
rect  Area to draw into, NULL for the whole area

MXTHANDLE mxtEArc ( UINT32  flags,
void *  pwidget 
)

Create an instance of an elastic arc tool.

3/4 Done, Need bound checking fixed.

MXTHANDLE mxtEBox ( UINT32  flags,
void *  pwidget 
)

Create an instance of an elastic box tool.

MXTHANDLE mxtEBreakLine ( UINT32  flags,
void *  pwidget 
)

Create an instance of an elastic breakline tool.

MXTHANDLE mxtECircle ( UINT32  flags,
void *  pwidget 
)

Create an instance of an elastic circle tool.

3/4 Done, Need bound checking fixed.

int MxtEditGlobalOptions ( Widget  pwidget  ) 

Display dialog allowing user to edit global tool colors and width.

Returns:
0 if user changed values, EUserCancel if cancelled.
This will automatically update the process global tool settings and save to the Ini file. The application should refresh all active tools if possible using MxtSetToolColor() for each DrawingArea's current tool.
Parameters:
pwidget  Parent for dialog

MXTHANDLE mxtEEllipse ( UINT32  flags,
void *  pwidget 
)

Create an instance of an elastic ellipse tool.

MXTHANDLE mxtELine ( UINT32  flags,
void *  pwidget 
)

Create an instance of an elastic box tool.

MXTHANDLE mxtEMBox ( UINT32  flags,
void *  pwidget 
)

Create an instance of an elastic box tool.

MXTHANDLE mxtEMultiPoint ( UINT32  flags,
void *  pwidget 
)

Create an instance of an elastic point tool.

MXTHANDLE mxtEMultiPolyLine ( UINT32  flags,
void *  pwidget 
)

Create multi elastic polyline tool.

void MxtEnableGps ( Widget  pwidget,
int  enabled 
)

GPS input is enabled for this view.

Parameters:
pwidget  Drawing Area widget
enabled  TRUE if GPS is set for this drawing area

MXTHANDLE mxtENode ( UINT32  flags,
void *  pwidget 
)

Create an instance of node edit tool.

MXTHANDLE mxtEPoint ( UINT32  flags,
void *  pwidget 
)

Create an instance of an elastic point tool.

MXTHANDLE mxtEPolyLine ( UINT32  flags,
void *  pwidget 
)

Create elastic polyline tool.

MXTHANDLE mxtERegion ( UINT32  flags,
void *  pwidget 
)

Create elastic region tool.

MXTHANDLE mxtERegPoly ( UINT32  flags,
void *  pwidget 
)

Create an instance of an elastic regpoly tool.

MXTHANDLE mxtETextLabel ( UINT32  flags,
void *  pwidget 
)

Create an instance of an elastic text label tool.

MXTHANDLE mxtFollowPoint ( UINT32  flags,
void *  pwidget 
)

Create an instance of point follow tool.

void MxtFreeValues ( MXTHANDLE  mxt,
void *  toolvalues 
)

Free tool structure internal data storage (Eg.

EPOLYLINEINFO).

This function frees any allocated data associated with the tool structure. Eg. the point buffer for line data. It will not free the data associated with a change callback.

Parameters:
mxt  Handle returned by MxtCreate()
toolvalues  Pointer to tool structure

Widget MxtGenerateManualForm ( MXTHANDLE  vmxt,
Widget  parent 
)

Generate manual form for tool if it exists.

Returns:
Form widget or NULL if non-existant.
NOTE: Must specify MxtFLAG_NoDialog to use this function.
Parameters:
vmxt  Handle returned by MxtCreate()
parent  Parent for main tool form, assumed to be a RowColumn

int MxtGenerateRegion ( MXTHANDLE  vmxt,
REGION2D region,
UINT32  flags 
)

Generate a region form the tool if supported.

Returns:
1 if a region is generated, 0 if not, < 0 Error.
This function will call MregionInit(). If an error occurs, MregionFree() is called.
Parameters:
vmxt  Handle returned by MxtCreate()
region  The region to fill in
flags  May be used at some point

Widget MxtGenerateSpatialForm ( MXTHANDLE  vmxt,
Widget  parent 
)

Generate spatial form for tool if it exists.

Returns:
Form widget or NULL if non-existant.
NOTE: Must specify MxtFLAG_NoDialog to use this function.
Parameters:
vmxt  Handle returned by MxtCreate()
parent  Parent for main tool form, assumed to be a RowColumn

Widget MxtGenerateToolForm ( MXTHANDLE  vmxt,
Widget  parent 
)

Generate main tool form for tool if it exists.

Returns:
Form widget or NULL if non-existant.
NOTE: Must specify MxtFLAG_NoDialog to use this function.
Parameters:
vmxt  Handle returned by MxtCreate()
parent  Parent for main tool form, assumed to be a RowColumn

void MxtGetArrowKeyDeltas ( MXTHANDLE  mxt,
double *  delta_x,
double *  delta_y 
)

Return current arrow key delta values.

This function gets the amount of movement for hitting arrow keys in object coordinates (i.e. deltas).

Parameters:
mxt  Handle returned by MxtCreate()
delta_x  Length to move in X direction (RETURNED)
delta_y  Length to move in Y direction (RETURNED)

int MxtGetBounds ( MXTHANDLE  mxt,
DRECT2D rect