Event XbpCrt():wheel Foundation

Mouse wheel was operated.

:wheel := {| aPos, aWheel, self | ... }
:wheel( <aPos>, <aWheel> ) --> self
xbeM_Wheel (1048599)
<aPos> is an array containing two elements { nX, nY } that specify the current position of the mouse pointer. By default, the coordinates are specified relative to the lower left corner of the Xbase Part receiving the message. The values in array <aPos> depend on the current setting of the :mouseMode instance variable. The mouse pointer position may be specified in either row and column or xy coordinates.
<aWheel> is an array with two elements { nKeyMask, nDistance }. The first element is a numeric value indicating special keys pressed while the user rotated the mouse wheel. The second element indicates the distance the wheel was rotated, expressed in multiples or divisions of 120. This value is positive when the wheel is rotated up and negative when it is rotated down.
The value of the first element is either 0 (no special key was pressed) or the result of one or more of the following #define constants listed in XBP.CH.
Constants for key states
Constant Description
XBP_MK_LBUTTON Left mouse button is pressed
XBP_MK_MBUTTON Middle mouse button is pressed
XBP_MK_RBUTTON Right mouse button is pressed
XBP_MK_CONTROL Ctrl key is pressed
XBP_MK_SHIFT Shift key is pressed

This method returns the object executing the method (self).


The xbeM_Wheel event is generated when the user rotates the mouse wheel and mouse events have been enabled via a call to SetMouse(.T.).

The xbeM_Wheel event is always sent to the Xbase Part that has input focus, no matter whether or not the mouse pointer is located within or outside the area of the Xbase Part. All classes derived from XbpWindow that display data which can be vertically scrolled have a default behavior to process this event. This applies to the following classes:

Classes with default behavior for xbeM_Wheel
Class name

If the :wheel() method is overloaded, the number of rows to scroll can be calculated from the number of rows displayed by the Xbase Part and the second element of <aWheel>:

nResolution   := 360  // 240, 480 changes scrolling speed 
nRowsToScroll := Int( nRowCount * aWheel[2] / nResolution ) 

When the first element of <aWheel> is not equal to zero, the $ operator can be used to check which additional keys are pressed while the mouse wheel is rotated. For example:

nEvent := AppEvent( @mp1, @mp2, @oXbp ) 

IF nEvent == xbeM_Wheel 
   IF XBP_MK_SHIFT $ mp2[1] 
      // code for Shift key processing 

Windows 95 does not support the mouse wheel.


If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.