TBrowse() > Event handling xHarbour Developers Network  

oTBrowse:applyKey()

Evaluates a code block associated with a navigation key.

Syntax

:applyKey( <nInkey> ) --> nReturnCode

Arguments

<nInkey>
This is a numeric Inkey() code to be processed by a TBrowse object.

Description

Method :applyKey() instructs a TBrowse object to process user input obtained from function Inkey(). The return value is a numeric code that indicates whether or not the stabilization loop must be terminated. #define constants are listed in the file TBrowse.ch that can be used to test possible return values of :applyKey().

Return values of :applyKey()
ConstantValueDescription
TBR_EXIT-1User request for the browse to lose input focus
TBR_CONTINUE0Code block associated with <nInkey> was evaluated
TBR_EXCEPTION1<nInkey> is unknown, key was not processed

A TBrowse object maintains a :setKey() dictionary of Inkey() codes and associated code blocks that perform default navigation. The default key processing is as follows:

Default key processing
Inkey codeMethod or functionReturn code
K_DOWN:down()TBR_CONTINUE
K_UP:up()TBR_CONTINUE
K_RIGHT:right()TBR_CONTINUE
K_LEFT:left()TBR_CONTINUE
K_CTRL_LEFT:panLeft()TBR_CONTINUE
K_CTRL_RIGHT:panRight()TBR_CONTINUE
K_END:end()TBR_CONTINUE
K_HOME:home()TBR_CONTINUE
K_CTRL_END:panEnd()TBR_CONTINUE
K_CTRL_HOME:panHome()TBR_CONTINUE
K_PGDN:pageDown()TBR_CONTINUE
K_PGUP:pageUp()TBR_CONTINUE
K_CTRL_PGDN:goBottom()TBR_CONTINUE
K_CTRL_PGUP:goTop()TBR_CONTINUE
K_ESCNoneTBR_EXIT
K_LBUTTONDOWNTBMouse()see below
other codes TBR_EXCEPTION

When the browse display is clicked with the mouse and a data cell is hit, :applyKey() returns TBR_CONTINUE. If no data is hit, the return code is TBR_EXCEPTION.


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