Function Prototypes. More...
Function Prototypes.
:Associate with "Mxt Graphic Tool Functions"
| int MxtAddCallback | ( | MXTHANDLE | vmxt, | |
| McbCallbackFunc | func, | |||
| void * | udata, | |||
| UINT32 | reason | |||
| ) |
Add callback to tool.
Valid reasons: The reasons are in reason classes
| 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.
| mxt | Tool handle |
| int MxtCallbackAddExt | ( | MXTHANDLE | vmxt, | |
| McbCallbackFunc | func, | |||
| void * | udata, | |||
| UINT32 | reason, | |||
| INT8 | priority | |||
| ) |
Add callback to tool with position determined by priority.
| vmxt | Add callback to tool | |
| func | Callback function | |
| udata | User data passed to func | |
| reason | Reason set flags to get callbacks on |
Call "change" callback for specified tool.
| 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.
| mxt | Handle returned by MxtCreate() |
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()).
| pwidget | Drawing Area widget | |
| flags | Function to create specific tool MxtFLAG... flags |
Create crosshair tool.
Flags for structure initialization
| dawidget | DrawingArea widget to contain tool | |
| flags | MxtFLAG_... |
Create elastic arc tool.
Flags for structure initialization:
Flags to control behavior:
| dawidget | DrawingArea widget to contain tool | |
| flags | MxtFLAG_... |
Create elastic box tool.
Flags for structure initialization:
Flags to control behavior:
| dawidget | DrawingArea widget to contain tool | |
| flags | MxtFLAG_... |
Create elastic circle tool instance.
Flags for structure initialization:
Flags to control behavior:
| dawidget | DrawingArea widget to contain tool | |
| flags | MxtFLAG_... |
Create elastic ellipse tool.
Flags for structure initialization:
Flags to control behavior
| dawidget | DrawingArea widget to contain tool | |
| flags | MxtFLAG_... |
Create elastic line tool instance.
Flags to control behavior
| dawidget | DrawingArea widget to contain tool | |
| flags | MxtFLAG_... |
Create elastic multi-point tool.
Flags to control behavior
| dawidget | DrawingArea widget to contain tool | |
| flags | MxtFLAG_... |
Create elastic multi-line/polygon tool.
Flags to control behavior:
| dawidget | DrawingArea widget to contain tool | |
| flags | MxtFLAG_... |
Create "point" tool.
| dawidget | DrawingArea widget to contain tool | |
| flags | MxtFLAG_... |
Create elastic "polyline/polygon" tool.
Flags to control behavior
| dawidget | DrawingArea widget to contain tool | |
| flags | MxtFLAG_... |
Create "region" display tool.
Tool handle (mxthandle) used in other Mxt... functions.
Flags to control behavior:
| dawidget | DrawingArea widget to contain tool | |
| flags | MxtFLAG_... |
Create elastic "regular polygon" tool.
Flags to control behavior:
| dawidget | DrawingArea widget to contain tool | |
| flags | MxtFLAG_... |
Create elastic "text label" tool.
Flags to control behavior
| dawidget | DrawingArea widget to contain tool | |
| flags | MxtFLAG_... |
Create point selection tool instance.
| dawidget | DrawingArea widget to contain tool | |
| flags | MxtFLAG_... |
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.
| mxt | Tool handle |
Draw tool graphic.
| vmxt | Handle returned by MxtCreate() | |
| rect | Area to draw into, NULL for the whole area |
Create an instance of an elastic arc tool.
3/4 Done, Need bound checking fixed.
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.
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.
| pwidget | Parent for dialog |
Create an instance of an elastic ellipse tool.
Create an instance of an elastic point tool.
| void MxtEnableGps | ( | Widget | pwidget, | |
| int | enabled | |||
| ) |
GPS input is enabled for this view.
| pwidget | Drawing Area widget | |
| enabled | TRUE if GPS is set for this drawing area |
Create an instance of an elastic regpoly tool.
Create an instance of an elastic text label tool.
| void MxtFreeValues | ( | MXTHANDLE | mxt, | |
| void * | toolvalues | |||
| ) |
Free tool structure internal data storage (Eg.
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.
| mxt | Handle returned by MxtCreate() | |
| toolvalues | Pointer to tool structure |
Generate manual form for tool if it exists.
NOTE: Must specify MxtFLAG_NoDialog to use this function.
| vmxt | Handle returned by MxtCreate() | |
| parent | Parent for main tool form, assumed to be a RowColumn |
Generate a region form the tool if supported.
This function will call MregionInit(). If an error occurs, MregionFree() is called.
| vmxt | Handle returned by MxtCreate() | |
| region | The region to fill in | |
| flags | May be used at some point |
Generate spatial form for tool if it exists.
NOTE: Must specify MxtFLAG_NoDialog to use this function.
| vmxt | Handle returned by MxtCreate() | |
| parent | Parent for main tool form, assumed to be a RowColumn |
Generate main tool form for tool if it exists.
NOTE: Must specify MxtFLAG_NoDialog to use this function.
| 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).
| mxt | Handle returned by MxtCreate() | |
| delta_x | Length to move in X direction (RETURNED) | |
| delta_y | Length to move in Y direction (RETURNED) |
Return current tool boundary rectangle.
This function returns the boundaries for the tool.
| mxt | Handle returned by MxtCreate() | |
| rect | Rect containing coordinates to bound, tool coords |
Return currently active tool handle.
| mxt | Can either be a MXTHANDLE or the parent widget of the tool |
Return current tool flags.
This function returns the current flags set in the tool. You should call this function to get the current flags, set or unset certain flags, then call MxtSetFlags() to set the flags.
Return global colors set for tools in the application.
| UseTool | Not used, can pass NULL | |
| color | Primary tool color RETURNED | |
| seccolor | Secondary tool color RETURNED | |
| LineWidth | Tool line width RETURNED |
| int MxtGetManualMode | ( | MXTHANDLE | mxt | ) |
Return status of manual edit dialog (on/off).
This function returns the status of the manual editor mode.
| mxt | Handle returned by MxtCreate() |
| void MxtGetManualParms | ( | MXTHANDLE | mxt, | |
| MANUALTOOLPARMS * | mtparms | |||
| ) |
Return current tool manual parameter settings.
This function retrieves the manual tool editing information within the tool.
| mxt | Handle returned by MxtCreate() | |
| mtparms | Pointer to manual tool editing parameters |
Return "reason class" for specified callback "reason".
Class Description
| reason | Callback reason (usually from cbdata->reason) |
| void MxtGetSnapGrid | ( | MXTHANDLE | mxt, | |
| SNAPGRIDPARMS * | snapgrid | |||
| ) |
Return current tool snap grid settings.
This function retrieves the snap grid information from the tool.
| mxt | Handle returned by MxtCreate() | |
| snapgrid | Pointer to snap grid parameters |
| int MxtGetSnapGridMode | ( | MXTHANDLE | mxt | ) |
Return current status of tool snap grid (on/off).
This function returns the status of the snap grid mode.
| mxt | Handle returned by MxtCreate() |
| GC MxtGetToolGC | ( | MXTHANDLE | mxt | ) |
Return the GC (X drawing parameter handle) of the tool.
| int MxtGetToolSize | ( | MXTHANDLE | mxt | ) |
Get size of tool structure (Eg.
sizeof(EBOXINFO)).
Returns the structure size of the tool.
| mxt | Handle returned by MxtCreate() |
| void MxtGetTrans2D | ( | MXTHANDLE | mxt, | |
| TRANS2D_AFFINE & | TtoW | |||
| ) |
Get tool/window transformation.
| mxt | Tool handle | |
| TtoW | Tool-to-Window transformation returned |
| void* MxtGetUserData | ( | MXTHANDLE | mxt | ) |
Get "userdata" resource for a tool.
Returns the pointer to the data associated with the tool. Set by MxtSetUserData().
| mxt | Handle returned by MxtCreate() |
| int MxtGetValues | ( | MXTHANDLE | mxt, | |
| void * | toolvalues | |||
| ) |
Get current tool-specific "values" structure.
The tool makes a copy of the information and places it in the toolvalues structure. No direct access of the tool data is allowed. You must free any allocated fields in the tool structure using MxtFreeValues(). Definitions of tool structures is with the respective "Create" function for that tool. Eg: MxtCreateEBox has a definition of an EBOXINFO structure.
| mxt | Handle returned by MxtCreate() | |
| toolvalues | Pointer to tool structure to copy into |
| int MxtGetXYDigitizerMode | ( | MXTHANDLE | mxt | ) |
Return current status of X-Y Digitizer (on/off).
| mxt | Handle returned by MxtCreate() |
| int MxtHasPosition | ( | MXTHANDLE | mxt | ) |
Return "position" status of tool.
| mxt | Handle returned by MxtCreate() |
| int MxtInBgUpdateCall | ( | MXTHANDLE | mxt | ) |
Inform caller if we are in an update background call.
| int MxtIsManaged | ( | MXTHANDLE | mxt | ) |
Return "managed" status of tool.
| mxt | Handle returned by MxtCreate() |
| int MxtIsSuspended | ( | MXTHANDLE | mxt | ) |
Return "suspended" status of tool.
| mxt | Handle returned by MxtCreate() |
| int MxtIsTrackingGps | ( | MXTHANDLE | mxt | ) |
Check to see if GPS tracking is on.
| void MxtManage | ( | MXTHANDLE | mxt | ) |
Make tool instance active, allowing user to modify it.
This function creates the GC and tool dialog. It also sets up specific event handlers to check for certain events, displays the tool if the tool has info, and sets up XYDigitizer stuff. This should be called only if changing from another tool to this one, not to hide the tool if drawing on the drawable. Use MxtSuspend/MxtResume() to accomplish tool graphic hiding.
| mxt | Handle returned by MxtCreate() |
| int MxtManualViewCoordRefSysSet | ( | MXTHANDLE | vmxt, | |
| const SPATREF::COORDREFSYS & | ViewCoordRefSys, | |||
| bool | ForceProj | |||
| ) |
Set view projection of manual tool section.
| vmxt | Handle returned by MxtCreate() | |
| ViewCoordRefSys | Projection information | |
| ForceProj | Force the projection even if the user has already changed it |
Move tool under program control.
This function shifts the tool values. This function is optionally supported by the tool.
Adjustment flags:
| mxt | Handle returned by MxtCreate() | |
| dx | Delta x | |
| dy | Delta y | |
| event | Event that caused the move, can be NULL | |
| flags | MxtADJUST... flags |
| void MxtRaiseWindow | ( | MXTHANDLE | vmxt | ) |
Raise tool dialog window to the foreground.
| vmxt | Handle returned by MxtCreate() |
| void MxtRemoveCallback | ( | MXTHANDLE | vmxt, | |
| McbCallbackFunc | func, | |||
| void * | udata, | |||
| UINT32 | reason | |||
| ) |
Remove callback from tool.
Resize tool under program control.
This function scales the tool values. This function is optionally supported by the tool.
Adjustment flags:
| mxt | Handle returned by MxtCreate() | |
| dx | Scale x | |
| dy | Scale y | |
| event | Event that caused the move, can be NULL | |
| flags | MxtADJUST... flags |
| void MxtResume | ( | MXTHANDLE | mxt | ) |
Resume (redraw graphic if possible) the tool.
This function resumes the tool from a MxtSuspend().
| mxt | Handle returned by MxtCreate() |
Rotate tool under program control.
This function rotates the tool values. This function is optionally supported by the tool. Rotation angle is in RADIANS.
Adjustment flags:
| void MxtSaveGlobalColor | ( | char * | group | ) |
Save global color setting to tntproc.ini file.
Create an instance of point selection tool.
| void MxtSetActivateCallback | ( | MXTHANDLE | mxt, | |
| void(*)(MxtAnyCallbackStruct *, void *) | CBFunc, | |||
| void * | udata | |||
| ) |
Set function to be called when an "activate" event occurs.
This function sets the activate callback for when the user presses return, right mouse button, or if a dialog exists, "Save" button is pressed. Most other Mxt...() functions are callable from this callback, except: MxtDestroy(), MxtManage(), and MxtUnmanage().
Callback "reasons" MxtCR_Activate An activate event occured
An "activate" event occurs when the user presses Button3 (usually right button) or <ENTER> while the parent widget has keyboard focus.
| void MxtSetArrowKeyDeltas | ( | MXTHANDLE | mxt, | |
| double | delta_x, | |||
| double | delta_y | |||
| ) |
Set deltas for arrow key handling.
This function sets the amount of movement for hitting arrow keys in object coordinates (i.e. deltas).
| mxt | Handle returned by MxtCreate() | |
| delta_x | Length to move in X direction | |
| delta_y | Length to move in Y direction |
Set the update background function.
Set bounding rectangle for the tool.
This function sets boundaries for the tool. This function will recognize a MxtFLAG_CanMoveOff flag.
List of flags to pass in this function.
| mxt | Handle returned by MxtCreate() | |
| rect | Rect containing coordinates to bound, object coords | |
| flags | Which values are set to bound |
| void MxtSetChangeCallback | ( | MXTHANDLE | mxt, | |
| void(*)(MxtAnyCallbackStruct *, void *) | CBFunc, | |||
| void * | udata | |||
| ) |
Set function to be called when any tool position values are changed.
This function sets the change callback for the program to get any changes done to the tool. You are allowed to set multiple callbacks for the tool and can be removed via a call to MxtRemoveChangeCallback().
Callback "reasons":
| mxt | Handle returned by MxtCreate() | |
| udata | Change callback function |
| int MxtSetDialogPosition | ( | MXTHANDLE | vmxt, | |
| int | NewPosn | |||
| ) |
Set the position of the dialog.
Set flags for the tool.
This function REPLACES the current flags set in the tool. You should call MxtGetFlags() to get the current flags, set or unset certain flags, then call this function to set the flags.
NOTE: Certain dialog management flags will work only if set before a call to MxtManage(). The best place to pass them is in MxtCreate(). The flags in question are listed with MxtCreate().
| mxt | Handle returned by MxtCreate() | |
| flags | Tool flags |
| void MxtSetGlobalColor | ( | Widget | parent, | |
| int | UseTool, | |||
| const COLOR & | color, | |||
| const COLOR & | seccolor, | |||
| int | LineWidth | |||
| ) |
Set color and width for all tools in the application.
| parent | Parent widget that tools are attached to | |
| UseTool | Turn on solid tools if 1, else 0 | |
| color | Color to use | |
| LineWidth | Line width to use |
| void MxtSetGpsSource | ( | MXTHANDLE | vmxt, | |
| void * | vNewSource | |||
| ) |
Set tool GPS source.
| vmxt | Handle returned by MxtCreate() | |
| vNewSource | GPS Source handle, NULL to turn off |
| void MxtSetHelpString | ( | MXTHANDLE | mxt, | |
| char * | helpstr | |||
| ) |
Set help string for tool dialog, overrides default help.
This function replaces the default help string with the one passed in. For correctness, the help that is to replace this help needs to have a SEE ALSO to the default help for the tool.
This function must be called before MxtManage().
| mxt | Handle returned by MxtCreate() | |
| helpstr | Help string to replace default string |
| void MxtSetManualMode | ( | MXTHANDLE | mxt, | |
| int | setflag | |||
| ) |
Set status of manual editing dialog (on/off).
This function turns on/off the manual editor mode of the tool. If the tool has a dialog and the correct flag is set, the tool dialog will have a manual editor button on the dialog. If not, this function must be used to envoke manual editor mode. NOTE: The manual editor doubles as a tool coordinate reporter. The update of the manual editor is handled by the tool itself. The tool management layer only handles opening, closing and managing of the manual dialog.
| mxt | Handle returned by MxtCreate() | |
| setflag | On/Off |
| int MxtSetManualParms | ( | MXTHANDLE | mxt, | |
| MANUALTOOLPARMS * | mtparms | |||
| ) |
Set manual editing parameters for the tool.
This function sets the manual tool editing information within the tool.
| mxt | Handle returned by MxtCreate() | |
| mtparms | Pointer to manual tool editing parameters |
| int MxtSetOutputTrans | ( | MXTHANDLE | vmxt, | |
| const TRANS2D_MAPGEN & | trans | |||
| ) |
Set output transparm for manual entry and GPS.
This function sets the internal transparms for both the GPS and manual entry which describes the Map projection to tool transformation.
| vmxt | Handle returned by MxtCreate() |
| int MxtSetSnapGrid | ( | MXTHANDLE | mxt, | |
| SNAPGRIDPARMS * | snapgrid | |||
| ) |
Set snap grid parameters for the tool.
This function sets the snap grid information within the tool.
| mxt | Handle returned by MxtCreate() | |
| snapgrid | Pointer to snap grid parameters |
| void MxtSetSnapGridMode | ( | MXTHANDLE | mxt, | |
| int | setflag | |||
| ) |
Set status of snap grid (on/off).
This function turns on/off the snap grid mode of the tool. If the tool has a dialog and the correct flag is set, the tool dialog will have a snap grid toggle button on the dialog. If not, this function must be used to toggle snap grid mode.
| mxt | Handle returned by MxtCreate() | |
| setflag | On/Off |
Set color and width for the tool only.
| vmxt | Handle returned by MxtCreate() | |
| color | Primary color to use, NULL to set to global primary color | |
| seccolor | Secondary color to use, NULL to set to global secondary color | |
| LineWidth | Line width to use, -1 to set to global line width |
Set tool/window transformation.
NOTE: If this function is not called, the tool will assume a one-one mapping of the coordinates.
| mxt | Handle returned by MxtCreate() | |
| OtoD | Tool to Drawable transform | |
| DtoO | Drawable to Tool transform |
| void MxtSetTrans2D | ( | MXTHANDLE | mxt, | |
| const TRANS2D_AFFINE & | TtoW | |||
| ) |
Set tool/window transformation.
NOTE: If this function is not called, the tool will assume a one-one mapping of the coordinates.
| mxt | Handle returned by MxtCreate() | |
| TtoW | Tool-to-Window transformation |
| void MxtSetUserData | ( | MXTHANDLE | mxt, | |
| void * | udata | |||
| ) |
Set "userdata" resource for a tool.
| mxt | Handle returned by MxtCreate() | |
| udata | User data to set |
| int MxtSetValues | ( | MXTHANDLE | mxt, | |
| void * | toolvalues, | |||
| int | notify | |||
| ) |
Set tool-specific "values" structure.
The tool makes a copy of toolvalues and correctly sets up its internal information. A error is returned if the tool data is invalid.
NOTE: If specific tool and/or generic flags need to be set before setting the tool, use MxtSetFlags() before calling this function.
Definitions of tool structures is with the respective "Create" function for that tool. Eg: MxtCreateEBox has a definition of an EBOXINFO structure.
| mxt | Handle returned by MxtCreate() | |
| toolvalues | Pointer to tool structure to copy from | |
| notify | Call change callback if one is assigned |
| void MxtSetWindowButtonRow | ( | MXTHANDLE | mxt, | |
| BUTTONITEM * | buttonrow, | |||
| void * | udata | |||
| ) |
Set edit dialog button row instead of default.
This function must be called before MxtManage(). The MXTHANDLE is passed as the callback data. The passed in udata is set up as userdata on the widget.
| mxt | Handle returned by MxtCreate() | |
| buttonrow | List of buttons to replace default buttonrow | |
| udata | User data passed to MxCreateButtonRow as userdata |
Set function to allow programmer addition to edit dialog.
This function must be called before MxtManage().
| mxt | Handle returned by MxtCreate() | |
| udata | Function to create user specified form User data passed to AddToForm() |
| void MxtSetWindowSaveButton | ( | MXTHANDLE | mxt, | |
| const char * | savebutton | |||
| ) |
Set edit dialog "save" button to somethine else.
This function sets the "save" button to another string. This function must be called before MxtManage().
| mxt | Handle returned by MxtCreate() | |
| savebutton | String that replaces "save" in dialog |
Set title for tool control window (if any).
This function looks up the window title using the TEXTID If not found, it will use the default. This function must be called before MxtManage().
| mxt | Handle returned by MxtCreate() |
| void MxtSetXORPixel | ( | MXTHANDLE | mxt, | |
| Pixel | pixel | |||
| ) |
Set pixel to XOR with the drawable.
This function sets the XOR pixel to use in the GC to draw with. Usually passed the background pixel of the drawable to handle different hued backgrounds. This function must be called before MxtManage().
| mxt | Handle returned by MxtCreate() | |
| pixel | Pixel to use to XOR with |
| void MxtSetXYDigitizerMode | ( | MXTHANDLE | mxt, | |
| int | setflag | |||
| ) |
Set status of X-Y Digitizer (on/off).
This function turns on/off the digitizer mode of the tool. If the tool has a dialog and the correct flag is set, the tool dialog will have a X-Y Digitizer toggle button on the dialog. If not, this function must be used to toggle digitizer mode.
| mxt | Handle returned by MxtCreate() | |
| setflag | On/Off |
| void MxtSetXYDtoObjectTrans | ( | MXTHANDLE | mxt, | |
| TRANSFUNC | tfunc, | |||
| void * | udata | |||
| ) |
Set translation function from X-Y Digitizer to tool coordinates.
This function sets the digitizer to object translation function. If not set, the tool assumes a 1-1 mapping of the X-Y Digitizer coordinates to object coordinates (i.e. trans2dinit()).
| mxt | Handle returned by MxtCreate() | |
| tfunc | X-Y Digitizer to Object coordinates | |
| udata | User data passed to tfunc() |
Change tool shear angle under program control.
This function shears the tool values. This function is optionally supported by the tool.
Adjustment flags:
| mxt | Handle returned by MxtCreate() | |
| dshear | Shear angle | |
| event | Event that caused the move, can be NULL | |
| flags | MxtADJUST... flags |
| void MxtSuspend | ( | MXTHANDLE | mxt | ) |
Suspend (undraw graphic if possible) the tool.
This function suspends the tool (undraws the tool graphic) while manipulation of the drawing area is accomplished. It will not affect any tool dialogs that are shown.
| mxt | Handle returned by MxtCreate() |
| void MxtTrackGps | ( | MXTHANDLE | vmxt, | |
| int | track | |||
| ) |
Turn on GPS tracking.
| void MxtUnmanage | ( | MXTHANDLE | mxt | ) |
Make tool instance inactive, erasing tool if necessary.
This function removes the dialog and GC and event handlers, cleans up digitizer setup and undraws the tool if drawn. This should be called only if changing from another tool to this one, not to hide the tool if drawing on the drawable. Use MxtSuspend/MxtResume() to accomplish tool graphic hiding.
| mxt | Handle returned by MxtCreate() |
1.6.1