Function TBHandleEvent() Foundation
Processes event codes (such as those returned by the function AppEvent()) for a TBrowse object.
TBHandleEvent( <oTBrowse>, <nEvent>, ;
[<mp1>], [<mp2>], [<oXbp>]) --> nBrowseDirection
The function TBHandleEvent() returns a numeric code which identifies the direction in which the TBrowse cursor will be moved in the next stabilization cycle. The return value orients itself at the numeric keypad (2 means "down", 6 means "to the right", 1 means "lower left," etc). When the event code is not processed, the return value is zero and the Tbrowse cursor is not moved. If the event <nEvent> is linked to a code block by the function SetAppEvent(), the code block is evaluated and the function returns -1.
The function TBHandleEvent() implements the default behavior of TBrowse objects for the processing events such as those returned by the function AppEvent(). To handle mouse events it calls the function TBtoMousePos(). TBHandleEvent() is a service function for programming with TBrowse objects and its source code is contained in the file BROWUTIL.PRG. To process events using TBHandleEvent(), the function AppEvent() must be used in the code handling the Tbrowse object.
The default behavior for keyboard navigation of TBrowse objects implemented in the function TBHandleEvent() is listed in the following table:
Key | Event constant | Action |
---|---|---|
Up Arrow | xbeK_UP | Previous row |
Down Arrow | xbeK_DOWN | Next row |
Left Arrow | xbeK_LEFT | One column to the left |
Right Arrow | xbeK_RIGHT | One column to the right |
Home | xbeK_HOME | Left column in the window |
End | xbeK_END | Right column in the window |
Page Up | xbeK_PGUP | Previous screen |
Page Down | xbeK_PGDN | Next screen |
Ctrl+Left Arrow | xbeK_CTRL_LEFT | Scrolls columns left |
Ctrl+Right Arrow | xbeK_CTRL_RIGHT | Scrolls columns right |
Ctrl+Home | xbeK_CTRL_HOME | First column |
Ctrl+End | xbeK_CTRL_END | Last column |
Ctrl+Page Up | xbeK_CTRL_PGUP | First row of table |
Ctrl+Page Down | xbeK_CTRL_PGDN | Last row of table |
Left mouse button | xbeM_LbClick | TBrowse cursor is moved to the mouse pointer |
The return value of TBHandleEvent() gives information about the direction in which the TBrowse cursor will be moved in the next stabilization cycle. Possible return values are as follows:
Return value | Direction for TBrowse cursor |
---|---|
9 | Right up |
8 | Up |
7 | Left up |
6 | Right |
5 | Mouse click in the TBrowse cursor, TBrowse cursor is not moved |
4 | Left |
3 | Right down |
2 | Down |
1 | Left down |
0 | Unknown event, TBrowse cursor is not moved |
-1 | TBrowse cursor is not moved, a SetAppEvent() code block is evaluated |
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.