TBrowse() > Event handling xHarbour Developers Network  

oTBrowse:setKey()

Sets or retrieves a code block associated with a navigation key.

Syntax

:setKey( <nInkey>, [<bNewBlock>] ) --> bOldBlock

Arguments

<nInkey>
This is the numeric Inkey() code of the key to be associated with a code block.
<bNewBlock>
This is an optional code block to be associated with the inkey code <nInkey>.

Description

Method :setKey() maintains a dictionary of inkey codes and associated code blocks that are processed in method :applyKey(). If <bNewBlock> is omitted, the method returns the current code block associated with <nInkey>. If <bNewBlock> is a code block, the return value is the replaced code block if an association exists for <nInkey>. An existing inkey/code block association is removed from the :setKey() dictionary when NIL is explicitly passed for <bNewBlock>.

When a new code block is added to the :setKey() dictionary, it should accept two parameters since the TBrowse object and the inkey code are passed to it in method :applyKey(). Also, the return value of the code block should be one of the #define constants TBR_EXIT, TBR_CONTINUE or TBR_EXCEPTION. Refer to method :applyKey() for a discussion of these constants.


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