Hi Antonio
Simple source for test program follows. It is testdlg.prg with two minor changes,
namely cAddress is initialised with some non blank data and secondly the PASSWORD option has been removed from the associated get.
- Code: Select all Expand view RUN
#include "FiveLinux.ch"
function Main()
local oDlg, cName := Date() /* PadR( "Five", 24 ) */
local cAddress := "FiveLinux ", nVal := 0
DEFINE DIALOG oDlg TITLE "FiveLinux DialogBox"
@ 2, 2 SAY "Name:" OF oDlg
@ 2, 8 GET cName OF oDlg SIZE 120, 25
@ 2, 32 IMAGE FILENAME "flh.gif" OF oDlg
@ 6, 2 SAY "Address:" OF oDlg
@ 6, 8 GET cAddress OF oDlg SIZE 150, 25
@ 10, 2 SAY "Value:" OF oDlg
@ 10, 8 GET nVal PICTURE "999.99" OF oDlg SIZE 120, 25
@ 15, 2 BUTTON "_Another" OF oDlg ACTION Another()
@ 15, 12 BUTTON "_Disabled" OF oDlg WHEN .f.
@ 15, 22 BUTTON "Show text" OF oDlg ACTION MsgInfo( cAddress )
ACTIVATE DIALOG oDlg CENTERED ;
VALID MsgYesNo( "Want to end ?" )
return nil
function Another()
local oDlg
DEFINE DIALOG oDlg TITLE "Another dialog"
ACTIVATE DIALOG oDlg CENTERED ;
VALID MsgYesNo( "End ?" )
return nil
Now if you compile and run this program you will find that if you tab from the first GET to the second the following will happen:
1. focus will change to the second GET
2. the whole of the text of the second GET is marked as having been selected
3. the keyboard cursor is at the very end of the get and you can't enter any text unless you backspace or use your mouse etc.
4. if you click on the title bar of the dialog then the selection marking disappears and the cursor moves to the start of the GET (which is the effect your code appears to be trying to achieve and would be ideal).
5. If you tab forward through to that GET again you can see that although the whole GET is marked as selected it doesn't behave as selected. Hitting a key leaves the cursor at the end of the GET but clears the selection marking.
6. If you tab from the second GET through to the third GET and then hit shift-tab you will see that it takes you to the start of the third GET but not back to the second GET as I believe it should. (I think this requires an additional case in the KeyDown() method of the TGet class.
I will send some more info in a further post
Thanks for your help
Doug
(xProgrammer)