FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveLinux / FiveDroid (Android) Supporting Shift-Tab
Posts: 464
Joined: Tue May 16, 2006 07:47 AM
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.

case nKey == 65056  // Shift-Tab
           ::lShiftTab := .T.
           IF ::bShiftTab != nil
              EVAL( ::bShiftTab )
           ENDIF


(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:

#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() }


This means that a typical TGet object becomes:

@  90, 110 _xget  2 VAR ::sNmGiven WIDTH 320


I would be happy to provide more information if anyone needs it.

Doug
(xProgrammer)

Continue the discussion