QuickWin Function: Registers the application-supplied callback routine to be called when a specified mouse event occurs in a specified window.
Module: USE IFQWIN
Syntax
result = REGISTERMOUSEEVENT (unit, mouseevents, callbackroutine)
unit
(Input) INTEGER(4). Unit number of the window whose callback routine on mouse events is to be registered.
mouseevents
(Input) INTEGER(4). One or more mouse events to be handled by the callback routine to be registered. Symbolic constants (defined in IFQWIN.F90
) for the possible mouse events are:
callbackroutine
(Input) Routine to be called on the specified mouse event in the specified window. It must be declared EXTERNAL. For a prototype mouse callback routine, see Building Applications: Using a Mouse.
Results
The result type is INTEGER(4). The result is zero or a positive integer if successful; otherwise, a negative integer that can be one of the following:
For every BUTTONDOWN or BUTTONDBLCLK event there is an associated BUTTONUP event. When the user double clicks, four events happen: BUTTONDOWN and BUTTONUP for the first click, and BUTTONDBLCLK and BUTTONUP for the second click. The difference between getting BUTTONDBLCLK and BUTTONDOWN for the second click depends on whether the second click occurs in the double click interval, set in the system's CONTROL PANEL/MOUSE.
Compatibility
QUICKWIN GRAPHICS LIB
See Also: Building Applications: Using QuickWin Overview, UNREGISTERMOUSEEVENT, WAITONMOUSEEVENT
Example
The following example registers the routine CALCULATE, to be called when the user double-clicks the left mouse button while the mouse cursor is in the child window opened as unit 4:
USE IFQWIN
INTEGER(4) result
OPEN (4, FILE= 'USER')
...
result = REGISTERMOUSEEVENT (4, MOUSE$LBUTTONDBLCLK, CALCULATE)