event
This function is triggered by left clicking with the mouse
pointer anywhere within the panel bitmap, as long as no panel element
(like a button) is hit. The panel pointer is passed as optional parameter
to the function and can be used for determining which panel was clicked
on.
Remarks
-
Setting enable_mouse at 0 disables mouse events on panels.
- A7.2
Setting enable_mouse at 2 also triggers the event with the right mouse button. The global event_type variable is set to EVENT_CLICK or EVENT_RIGHTCLICK dependent on which button was used.
Example:
function redblue(PANEL* panel); //prototype
PANEL* redpan = { x = 10; y = 20; bmap = redmap; event = redblue; }
PANEL* bluepan = { x = 10; y = 40; bmap = bluemap; event = redblue; }
function redblue(PANEL* panel)
{
if (panel == redpan) { printf("redpan clicked!"); }
if (panel == bluepan) { printf("bluepan clicked!"); }
}
See also:
PANEL, on_click, mouse_map, enable_mouse
► latest
version online