Supporting Shift-Tab
Posted: Sat May 03, 2008 11:02 am
Hi Antonio
I have managed to support Shift-Tab, although in a possibly round-about manner. I added the following case to the KeyDown() method of the TGet class.
(obviously new DATAs lShiftTab and bShiftTab).
I made similar a modification for Tab. The controls were stored in array aCTL[]. There were two parallel arrays aPREV[] and aNEXT[] which stored the previous and next control via the corresponding index into aCTL[].
bShiftTab was set along the following lines:
{ | | ::aCTL\[(::aPREV\[<index>])]:SetFocus() }
I used a custom #translate to save on typing:
This means that a typical TGet object becomes:
I would be happy to provide more information if anyone needs it.
Doug
(xProgrammer)
I have managed to support Shift-Tab, although in a possibly round-about manner. I added the following case to the KeyDown() method of the TGet class.
Code: Select all
case nKey == 65056 // Shift-Tab
::lShiftTab := .T.
IF ::bShiftTab != nil
EVAL( ::bShiftTab )
ENDIF
I made similar a modification for Tab. The controls were stored in array aCTL[]. There were two parallel arrays aPREV[] and aNEXT[] which stored the previous and next control via the corresponding index into aCTL[].
bShiftTab was set along the following lines:
{ | | ::aCTL\[(::aPREV\[<index>])]:SetFocus() }
I used a custom #translate to save on typing:
Code: Select all
#xtranslate _xget <index> VAR <variable> WIDTH <width> [PICTURE <picture>] => GET ::aCTL\[<index>] VAR <variable> OF dlgPATIENT SIZE <width>, 25 WHEN ::lEdit BLACK PIXEL [PICTURE <picture>];;
::aCTL\[<index>]:bShiftTab := { | | ::aCTL\[(::aPREV\[<index>])]:SetFocus() } ;;
::aCTL\[<index>]:bTab := { | | ::aCTL\[(::aNEXT\[<index>])]:SetFocus() }
Code: Select all
@ 90, 110 _xget 2 VAR ::sNmGiven WIDTH 320
Doug
(xProgrammer)