| MIL 10 Reference
| Customize Help
| Save Settings

MgraGetHookInfo



See also
Availability
Available in MIL-Lite
Available in MIL

Available on Windows
Available on Linux

Available on Non-Matrox computer
Available on Matrox 4Sight-X
Available on Matrox 4Sight GP
Available on Matrox Supersight
function map Function map
Examples
Synopsis
Get information about a graphics list event.
Syntax
MIL_INT MgraGetHookInfo (
MIL_ID EventId, //in
MIL_INT64 InfoType, //in
void *UserVarPtr //out
)
Description

This function allows you to get information about the event that caused the hook-handler function to be called. MgraGetHookInfo() should only be called within the scope of a graphics list hook-handler function (see MgraHookFunction()).

Note that this function reference has not been updated for a MIL system added during a MIL update. Refer to the MIL system's release note to see if there is complementary information.
Parameters
This function is not supported on the selected boards.
Parameters
EventId

Specifies the graphics list event identifier received by the hook-handler function (see MgraHookFunction()). The event will be of the type passed to the HookType parameter of the hook-handler function.

See the Parameter associations section for possible values that can be specified.

InfoType

Specifies the type of information to get.

See the Parameter associations section for possible values that can be specified.

UserVarPtr
Accepts the address of one of the following (see the Parameter associations section for specifics on which is expected):
  • MIL_DOUBLE
  • MIL_ID
  • MIL_INT
  • MIL_INT32
  • MIL_INT64

Specifies the address in which to write the requested information.

See the Parameter associations section for possible values that can be returned.

The table below lists possible values for the EventId and InfoType parameters and possible values returned to the UserVarPtr parameter.

Unless otherwise specified, the following values require that you pass the UserVarPtr parameter the address of a MIL_INT.

function map For getting information about a graphics list event
CollapseEventId Description
InfoType
UserVarPtr
- Possible values returned
Collapse An M_GRAPHIC_LIST_MODIFIED event ID

Specifies that the event that called the hook-handler function was due to the graphics list being modified, either by a MIL function or by interactive manipulations.

(summarize)
Collapse M_GRAPHIC_LIST_ID +

Retrieves the MIL identifier of the graphics list that triggered the event.

(summarize)
Collapse UserVarPtr data type info

Data type: MIL_ID

Collapse An M_GRAPHIC_MODIFIED event ID

Specifies that the event that callled the hook-handler function was due to a graphic in the graphics list being modified, either by a MIL function or by interactive manipulations.

If a graphic's selection (MgraControlList() with M_GRAPHIC_SELECTED) is changed either programatically or interactively, this event will not be triggered; the M_GRAPHIC_SELECTION_MODIFIED event will be triggered instead.

(summarize)
Collapse M_GRAPHIC_CONTROL_TYPE +

Inquires the type of modification made to the graphics in the list that triggered the event.

(summarize)
Collapse UserVarPtr data type info

Data type: MIL_INT64

Collapse M_ANGLE

Specifies the angle of the graphic was modified. INFO

Collapse M_ANGLE_END

Specifies the angle at which to stop drawing the arc was modified. INFO

Collapse M_ANGLE_START

Specifies the angle at which to start drawing the arc was modified. INFO

Collapse M_APPLY_SCALE

Specifies a uniform scaling operation was performed on the graphic. INFO

Collapse M_ARC_STYLE

Specifies the option of whether to draw an arc or a sector was modified. INFO

Collapse M_BACKCOLOR

Specifies the background color of the text was modified.

Collapse M_BACKGROUND_MODE

Specifies the option of whether to fill the text's background was modified.

Collapse M_COLOR

Specifies the foreground color of the graphic was modified.

Collapse M_CONSTRAIN_ASPECT_RATIO

Specifies the option of whether to force the width and height of a graphic to be equal was modified. INFO

Collapse M_DELETE

Specifies that one of the following has been called on the graphics list, resulting in some graphics being removed from the graphics list: MgraControlList() with M_DELETE, MgraClear(), or when MgraCopy() with M_MOVE deletes graphics from a source graphics list.

Collapse M_DRAW_OFFSET_X

Specifies the offset to subtract from the source X-coordinates before rendering the graphic was modified. INFO

Collapse M_DRAW_OFFSET_Y

Specifies the offset to subtract from the source Y-coordinates before rendering the graphic was modified. INFO

Collapse M_DRAW_ZOOM_X

Specifies the scale factor in the X-direction was modified. INFO

Collapse M_DRAW_ZOOM_Y

Specifies the scale factor in the Y-direction was modified. INFO

Collapse M_EDITABLE

Specifies the option of whether a graphic can be edited via user interaction in an interactive display was modified. INFO

Collapse M_FILLED

Specifies the option of whether to fill the graphic was modified. INFO

Collapse M_FIXTURE

Specifies the calibration information to use when rendering (drawing or displaying) a graphic that has been defined in world units (M_INPUT_UNITS set to M_WORLD) was modified. INFO

Collapse M_FONT

Specifies the font of the characters in text was modified.

Collapse M_FONT_AUTO_SELECT

Specifies the option of whether MIL should search for a suitable font to draw text if the currently selected font (M_FONT) is a TrueType font that does not support the character code was modified. INFO

Collapse M_FONT_SIZE

Specifies the size to draw text when using a TrueType font was modified. INFO

Collapse M_FONT_X_SCALE

Specifies the font's horizontal scaling factor was modified. INFO

Collapse M_FONT_Y_SCALE

Specifies the font's vertical scaling factor was modified. INFO

Collapse M_GRAPHIC_CONVERSION_MODE

Specifies how the shape of a graphic, defined in world units, is converted to pixels (rendered) was modified. INFO

Collapse M_GRAPHIC_CREATE

Specifies that a new graphic has been added to the graphics list, either using a MIL function or through interactive manipulations.

Collapse M_GRAPHIC_INTERACTIVE

Specifies that interactive manipulations, such as translation, rotation, and resizing, have changed the properties of a graphic in the graphics list.

Collapse M_GRAPHIC_SOURCE_CALIBRATION

Specifies that the identifier of the calibration information used to interpret positioning and dimensioning information of a graphic defined in world units was modified.

Collapse M_INPUT_UNITS

Specifies the units with which to interpret the graphic's position and dimensional information, for graphics already added to the graphics list was modified. INFO

Collapse M_INTERACTIVE_ANNOTATIONS_COLOR

Specifies the color of the selection box and handles when in interactive mode was modified.

Collapse M_MOVABLE

Specifies the option of whether a graphic can be moved via user interaction in an interactive display was modified. INFO

Collapse M_MOVE

Specifies that a call to MgraCopy(), with an in-place move (M_MOVE) operation, changed the order of the graphics inside the graphics list.

Collapse M_MULTIPLE_SELECTION

Specifies the option of whether to permit interactive multiple selection using the Ctrl key was modified. INFO

Collapse M_POSITION_TYPE

Sets how to interpret M_POSITION_X and M_POSITION_Y for a rectangle was modified. INFO

Collapse M_POSITION_X

Specifies the X-position of a graphic or of one of its sub-elements (position-points) was modified. INFO

Collapse M_POSITION_Y

Specifies the Y-position of a graphic or of one of its sub-elements (position-points) was modified. INFO

Collapse M_RADIUS_X

Specifies the radius of the arc, in the X-direction was modified. INFO

Collapse M_RADIUS_Y

Specifies the radius of the arc, in the Y-direction was modified. INFO

Collapse M_RECTANGLE_HEIGHT

Specifies the height of the rectangle was modified. INFO

Collapse M_RECTANGLE_WIDTH

Specifies the width of the rectangle was modified. INFO

Collapse M_RESIZABLE

Specifies the option of whether a graphic can be resized via user interaction in an interactive display was modified. INFO

Collapse M_ROTATABLE

Specifies the option of whether a graphic can be rotated via user interaction in an interactive display was modified. INFO

Collapse M_ROTATE

Specifies a rotation operation was performed on the graphic. INFO

Collapse M_SELECTABLE

Specifies the option of whether a graphic can be selected via user interaction in an interactive display was modified. INFO

Collapse M_SELECTED_COLOR

Specifies the color of the selected graphics in interactive mode was modified.

Collapse M_SELECTION_RADIUS

Specifies the size of the selection-radius when in interactive mode was modified. INFO

Collapse M_SPECIFIC_FEATURES_EDITABLE

Specifies the option of whether a graphic can be modified via user interaction in an interactive display using handles that are specific to its graphic type was modified. INFO

Collapse M_TEXT_ALIGN_HORIZONTAL

Specifies the horizontal alignment of text was modified. INFO

Collapse M_TEXT_ALIGN_VERTICAL

Specifies the vertical alignment of text was modified. INFO

Collapse M_TEXT_BORDER

Specifies the border drawn around the text was modified. INFO

Collapse M_TEXT_DIRECTION

Specifies the direction to draw text when using a TrueType font was modified.

Collapse M_TRANSLATE_X

Specifies a horizontal translation of a graphic, or one of its sub-elements, was performed. INFO

Collapse M_TRANSLATE_Y

Specifies a vertical translation of a graphic, or one of its sub-elements, was performed. INFO

Collapse M_VISIBLE

Specifies the option of whether a graphic is rendered on the display was modified. INFO

Collapse M_GRAPHIC_LABEL_VALUE +

Retrieves the label of the modified graphic that triggered the event.

(summarize)
Collapse M_ALL

Specifies that all graphics in the graphics list were modified using MgraClear() or MgraControlList() with M_ALL.

Collapse M_ALL_SELECTED

Specifies that all selected graphics in the graphics list were modified using MgraControlList() with M_ALL_SELECTED.

Collapse M_LIST

Specifies that a graphics list's setting was modified using MgraControlList() with M_LIST.

Collapse M_MULTIPLE_LABELS

Specifies that more than one graphic was modified. This can happen when calling MgraCopy() and with interactive manipulations (for example, translating many graphics).

(summarize)
Collapse Value

Specifies the label of the graphic.

Collapse M_GRAPHIC_LIST_ID +

Retrieves the MIL identifier of the graphics list containing the graphic that triggered the event.

(summarize)
Collapse UserVarPtr data type info

Data type: MIL_ID

Collapse M_GRAPHIC_SUB_INDEX +

Retrieves the index of the sub-element of the graphic that triggered the event.

(summarize)
Collapse M_DEFAULT

Specifies that the event affected the whole graphic.

Collapse Value

Specifies the index of the sub-element of the graphic that triggered the event.

Collapse An M_GRAPHIC_SELECTION_MODIFIED event ID

Specifies that the event that called the hook-handler function was due to a graphic being selected or deselected.

(summarize)
Collapse M_GRAPHIC_LABEL_VALUE +

Retrieves the label of the graphic that triggered the event.

(summarize)
Collapse M_MULTIPLE_LABELS

Specifies that more than one graphic was selected. This can happen when calling MgraControlList() with M_GRAPHIC_SELECTED and with interactive manipulations (for example, Ctrl-clicking many graphics).

(summarize)
Collapse M_NO_LABEL

Specifies a deselection triggered the event and no graphic was selected.

Collapse Value

Specifies the label of the graphic that was selected.

Collapse M_GRAPHIC_LABEL_VALUE_DESELECTED +

Retrieves the label of the graphic that was deselected when the event was triggered.

(summarize)
Collapse M_MULTIPLE_LABELS

Specifies that more than one graphic was deselected.

Collapse M_NO_LABEL

Specifies that no graphic was deselected.

Collapse Value

Specifies the label of the graphic that was deselected.

Collapse M_GRAPHIC_LIST_ID +

Retrieves the MIL identifier of the graphics list containing the graphic that triggered the event.

(summarize)
Collapse UserVarPtr data type info

Data type: MIL_ID

Collapse An M_INTERACTIVE_GRAPHIC_STATE_MODIFIED event
ID

Specifies that the event that called the hook-handler function was due to the graphics list's interactive state being modified, either by a MIL function or by interactive manipulations.

(summarize)
Collapse M_GRAPHIC_LABEL_VALUE +

Retrieves the label of the graphic that triggered the event. For example, it can return the label of the graphic being dragged when the state of interactivity (M_INTERACTIVE_GRAPHIC_STATE) is M_STATE_GRAPHIC_DRAGGED.

(summarize)
Collapse M_NO_LABEL

Specifies that a MIL function triggered the event.

Collapse Value

Specifies the label of the graphic that triggered the event.

Collapse M_GRAPHIC_LIST_ID +

Retrieves the MIL identifier of the graphics list that triggered the event.

(summarize)
Collapse UserVarPtr data type info

Data type: MIL_ID

Collapse M_INTERACTIVE_GRAPHIC_PREVIOUS_STATE +

Inquires the state of interactivity of the graphics list before the event occurred. This always returns a different value than M_INTERACTIVE_GRAPHIC_STATE.

(summarize)
Collapse M_STATE_BEING_CREATED

Specifies that a new graphic was being created.

Collapse M_STATE_GRAPHIC_DRAGGED

Specifies that a graphic was being dragged using the mouse.

Collapse M_STATE_GRAPHIC_HOVERED

Specifies that the cursor was hovering over a graphic.

Collapse M_STATE_HANDLE_DRAGGED

Specifies that a graphic's handle was being dragged using the mouse.

Collapse M_STATE_HANDLE_HOVERED

Specifies that the cursor was hovering over a graphic's handle.

Collapse M_STATE_IDLE

Specifies that the cursor was not hovering over anything and that no graphic was queued for creation.

Collapse M_STATE_WAITING_FOR_CREATION

Specifies that a graphic was queued for creation.

Collapse M_INTERACTIVE_GRAPHIC_STATE +

Inquires the current state of interactivity of the graphics list.

(summarize)
Collapse M_STATE_BEING_CREATED

Specifies that a new graphic is being created.

Collapse M_STATE_GRAPHIC_DRAGGED

Specifies that a graphic is being dragged using the mouse.

Collapse M_STATE_GRAPHIC_HOVERED

Specifies that the cursor is currently hovering over a graphic.

Collapse M_STATE_HANDLE_DRAGGED

Specifies that a graphic's handle is being dragged using the mouse.

Collapse M_STATE_HANDLE_HOVERED

Specifies that the cursor is currently hovering over a graphic's handle.

Collapse M_STATE_IDLE

Specifies that the cursor is not hovering over anything and that no graphic is queued for creation.

Collapse M_STATE_WAITING_FOR_CREATION

Specifies that a graphic is queued for creation.

Combination constants for M_GRAPHIC_CONTROL_TYPE (when EventId=An M_GRAPHIC_MODIFIED event ID); M_GRAPHIC_LABEL_VALUE (when EventId=An M_GRAPHIC_MODIFIED event ID); M_GRAPHIC_LABEL_VALUE (when EventId=An M_GRAPHIC_SELECTION_MODIFIED event ID); M_GRAPHIC_LABEL_VALUE (when EventId=An M_INTERACTIVE_GRAPHIC_STATE_MODIFIED event ID); M_GRAPHIC_LABEL_VALUE_DESELECTED (when EventId=An M_GRAPHIC_SELECTION_MODIFIED event ID); M_GRAPHIC_LIST_ID (when EventId=An M_GRAPHIC_LIST_MODIFIED event ID); M_GRAPHIC_LIST_ID (when EventId=An M_GRAPHIC_MODIFIED event ID); M_GRAPHIC_LIST_ID (when EventId=An M_GRAPHIC_SELECTION_MODIFIED event ID); M_GRAPHIC_LIST_ID (when EventId=An M_INTERACTIVE_GRAPHIC_STATE_MODIFIED event ID); M_GRAPHIC_SUB_INDEX (when EventId=An M_GRAPHIC_MODIFIED event ID); M_INTERACTIVE_GRAPHIC_PREVIOUS_STATE (when EventId=An M_INTERACTIVE_GRAPHIC_STATE_MODIFIED event ID); M_INTERACTIVE_GRAPHIC_STATE (when EventId=An M_INTERACTIVE_GRAPHIC_STATE_MODIFIED event ID).

You can add one of the following values to the above-mentioned values to cast the requested information to a required data type.

function map For specifying the data type
CollapseInfoType Description
UserVarPtr
- Possible values returned
Collapse M_TYPE_MIL_DOUBLE

Casts the requested information to a MIL_DOUBLE.

(summarize)
Collapse UserVarPtr data type info

Data type: MIL_DOUBLE

Collapse M_TYPE_MIL_ID

Casts the requested information to a MIL_ID. Note that M_TYPE_MIL_ID should only be used with M_GRAPHIC_LIST_ID.

(summarize)
Collapse UserVarPtr data type info

Data type: MIL_ID

Collapse M_TYPE_MIL_INT

Casts the requested information to a MIL_INT.

(summarize)
Collapse UserVarPtr data type info

Data type: MIL_INT

Collapse M_TYPE_MIL_INT32

Casts the requested information to a MIL_INT32.

(summarize)
Collapse UserVarPtr data type info

Data type: MIL_INT32

Collapse M_TYPE_MIL_INT64

Casts the requested information to a MIL_INT64.

(summarize)
Collapse UserVarPtr data type info

Data type: MIL_INT64

Return value
The returned value is M_NULL if successful. If the operation fails, a non-null (!M_NULL) value is returned.
Compilation information
Header Include mil.h.
Library Use mil.lib.
DLL Requires mil.dll.
GRAPHIC LIST MODIFIED event ID GRAPHIC LIST ID GRAPHIC MODIFIED event ID GRAPHIC CONTROL TYPE ANGLE ANGLE END ANGLE START APPLY SCALE ARC STYLE BACKCOLOR BACKGROUND MODE COLOR CONSTRAIN ASPECT RATIO DELETE DRAW OFFSET X DRAW OFFSET Y DRAW ZOOM X DRAW ZOOM Y EDITABLE FILLED FIXTURE FONT FONT AUTO SELECT FONT SIZE FONT X SCALE FONT Y SCALE GRAPHIC CONVERSION MODE GRAPHIC CREATE GRAPHIC INTERACTIVE GRAPHIC SOURCE CALIBRATION INPUT UNITS INTERACTIVE ANNOTATIONS COLOR MOVABLE MOVE MULTIPLE SELECTION POSITION TYPE POSITION X POSITION Y RADIUS X RADIUS Y RECTANGLE HEIGHT RECTANGLE WIDTH RESIZABLE ROTATABLE ROTATE SELECTABLE SELECTED COLOR SELECTION RADIUS SPECIFIC FEATURES EDITABLE TEXT ALIGN HORIZONTAL TEXT ALIGN VERTICAL TEXT BORDER TEXT DIRECTION TRANSLATE X TRANSLATE Y VISIBLE GRAPHIC LABEL VALUE ALL ALL SELECTED LIST MULTIPLE LABELS GRAPHIC LIST ID GRAPHIC SUB INDEX DEFAULT GRAPHIC SELECTION MODIFIED event ID GRAPHIC LABEL VALUE MULTIPLE LABELS NO LABEL GRAPHIC LABEL VALUE DESELECTED MULTIPLE LABELS NO LABEL GRAPHIC LIST ID INTERACTIVE GRAPHIC STATE MODIFIED event ID GRAPHIC LABEL VALUE NO LABEL GRAPHIC LIST ID INTERACTIVE GRAPHIC PREVIOUS STATE STATE BEING CREATED STATE GRAPHIC DRAGGED STATE GRAPHIC HOVERED STATE HANDLE DRAGGED STATE HANDLE HOVERED STATE IDLE STATE WAITING FOR CREATION INTERACTIVE GRAPHIC STATE STATE BEING CREATED STATE GRAPHIC DRAGGED STATE GRAPHIC HOVERED STATE HANDLE DRAGGED STATE HANDLE HOVERED STATE IDLE STATE WAITING FOR CREATION TYPE MIL DOUBLE TYPE MIL ID TYPE MIL INT TYPE MIL INT32 TYPE MIL INT64