mouse_child_funct

The mouse_child_funct function is a callback function used by the MOUSE_CHILD_FUNCT macro discussed in the topic Defining Mouse Rectangles. You provide this function, and the Panel system calls mouse_child_funct when the specified mouse event occurs.

Syntax

BOOL mouse_child_funct(PPIXPOINT relative_point, FLAGS32 mouse_flags)

The mouse_child_funct function has these parameters:

Parameter Description
PPIXPOINT relative_point Specifies the point in the gauge that was clicked.
FLAGS32 mouse_flags Returns one of the following mouse events:
MOUSE_NONE
MOUSE_RIGHTSINGLE
MOUSE_MIDDLESINGLE
MOUSE_LEFTSINGLE
MOUSE_RIGHTDOUBLE
MOUSE_MIDDLEDOUBLE
MOUSE_LEFTDOUBLE
MOUSE_RIGHTDRAG
MOUSE_MIDDLEDRAG
MOUSE_LEFTDRAG
MOUSE_MOVE
MOUSE_DOWN_REPEAT
MOUSE_KEYBOARD

Return Values

The mouse_child_funct function has this return value:

Return Value Description
FALSE The mouse_child_funct always returns FALSE.

Example

MOUSE_FUNCTION mouse_hdg_cb;

BOOL mouse_hdg_cb(PPIXPOINT relative_point, FLAGS32 mouse_flags)

{

if(icon_ap.source_var.var_value.n)'Autopilot is off.

{

trigger_key_event(KEY_AP_MASTER, 0);

trigger_key_event(KEY_AP_PANEL_HEADING_HOLD, 0);

}

else if(icon_hdg.source_var.var_value.n)'Heading hold is off.

{

trigger_key_event(KEY_AP_PANEL_HEADING_HOLD, 0);

}

else

{

trigger_key_event(KEY_AP_PANEL_HEADING_HOLD, 0);

trigger_key_event(KEY_AP_WING_LEVELER, 0);

}

return FALSE;

}