Popup() > Menu display and selection |
Checks if a menu item is clicked with the mouse.
:hitTest( <nMouseRow>, <nMouseCol> ) --> nMenuItemPos
Method :hitTest() accepts the numeric row and column position of the mouse cursor and returns a numeric value > 1 indicating the ordinal position of the menu item that is underneath the mouse cursor. If the mouse hit a non-selectable or disabled menu item inside the border of a popup menu, the return value is zero.
When the border of the menu is clicked, the return value is negative and can be tested with #define constants available in Button.ch.
Constants for :hitTest() results
Constant | Value | Description |
---|---|---|
HTTOPLEFT | -1 | Mouse is on the upper left corner |
HTTOP | -2 | Mouse is on the top border |
HTTOPRIGHT | -3 | Mouse is on the upper right corner |
HTRIGHT | -4 | Mouse is on the right border |
HTBOTTOMRIGHT | -5 | Mouse is on the lower right corner |
HTBOTTOM | -6 | Mouse is on the bottom border |
HTBOTTOMLEFT | -7 | Mouse is on the lower left corner |
HTLEFT | -8 | Mouse is on the left border |
http://www.xHarbour.com