x, y | Position relative to the upper left edge of the panel. For detecting mouse events, the button must be completely inside the panel area (panel.size) or the panel background bitmap. |
bmapOn | Bmap displayed when the button is switched on; gives also the size of the button. |
bmapOff | Bmap displayed when the the button is switched off. |
bmapOver | Bmap displayed when the mouse is over the button. |
bmapOverOff | Bmap displayed when the mouse is over the switched off button. |
functionClick | Function executed when the mouse is left clicked over the button. |
functionLeave | Function executed when the mouse is released over the button or leaves the button. |
functionOver | Function executed when the mouse touches the button. |
EVENT_TOUCH - the mouse was moved over the button.
EVENT_RELEASE - the mouse was moved away from the button.
EVENT_CLICK - left mouse button was clicked over the button
or switches a toggle button on.
EVENT_CLICKUP - left mouse button was clicked over a
toggle button and switches it off.
EVENT_BUTTONUP - left mouse button was released over
the button.
EVENT_RELEASE and EVENT_BUTTONUP can
be used to distinguish whether functionOff was
triggered by leaving the button area or releasing the mouse button. EVENT_CLICK and EVENT_CLICKUP can
be used to distinguish whether the mouse click switches the toggle
button on or off.
var toggletest = 0;
function toggle_var()
{
toggletest = 1 - toggletest; // toggle between 1 and 0
}
PANEL* pTest =
{
button_toggle(0,0,on_map,off_map,off_map,NULL,toggle_var,NULL,NULL);
}