Popup() > Menu display and selection xHarbour Developers Network  

oPopup:hitTest()

Checks if a menu item is clicked with the mouse.

Syntax

:hitTest( <nMouseRow>, <nMouseCol> ) --> nMenuItemPos

Arguments

<nMouseRow>
This is the numeric row position of the mouse cursor. It can be queried using function MRow().
<nMouseCol>
This is the numeric column position of the mouse cursor. It can be queried using function MCol().

Description

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
ConstantValueDescription
HTTOPLEFT-1Mouse is on the upper left corner
HTTOP-2Mouse is on the top border
HTTOPRIGHT-3Mouse is on the upper right corner
HTRIGHT-4Mouse is on the right border
HTBOTTOMRIGHT-5Mouse is on the lower right corner
HTBOTTOM-6Mouse is on the bottom border
HTBOTTOMLEFT-7Mouse is on the lower left corner
HTLEFT-8Mouse is on the left border


Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe