In Next program i have problems with the visibility from the checkboxes
With define TESTSETFOCUS , on the init clausule check2 , should receive focus , but it isn't visible , no focus at all can be seen. Entering the TAB key gives the OK button focus , so the focus WAS on ocheck2
Entering oGet[1] , oJump should set the focus on ocheck1 , only the first time this occurs .
Without TESTSETFOCUS , the first control is ocheck1 , receive at startup focus , but also invisible !!!!!
Also with radiobuttons i have this kind of problems.
- Code: Select all Expand view
#include "FiveWin.ch"
# define TESTSETFOCUS
function Main()
LOCAL oDlg, oGet[3]
LOCAL cCad := "Testing " // pad("Testing Gets",40)
LOCAL nNum := 0
LOCAL dDat := Date()
LOCAL oCheck1 , lCheck1 := .T.
LOCAL oCheck2 , lCheck2 := .F.
Set century On
Set Date Ansi
Set Date format "mm/dd/yyyy"
SET _3DLOOK ON
DEFINE DIALOG oDlg TITLE "TGet from " + FWDESCRIPTION
@ 0, 6 CHECKBOX oCheck1 VAR lCheck1 OF oDlg SIZE 60, 10 PROMPT "Check : "
@ 1, 2 SAY "Text..:" OF oDlg
@ 1, 6 GET oGet[1] VAR cCad OF oDlg SIZE 60, 10 COLOR "W/G" PICTURE "@K" //VALID ( oCheck1:Setfocus() , .T.)
# ifdef TESTSETFOCUS
oGet[1]:oJump := oCheck1
# endif
@ 1.8, 2 SAY "Number:" OF oDlg
@ 2, 6 GET oGet[2] VAR nNum OF oDlg SIZE 60, 10 PICTURE "@K #999999.99" UPDATE
@ 2, 18 CHECKBOX oCheck2 VAR lCheck2 OF oDlg SIZE 60, 10 PROMPT "Check : "
@ 2.6, 2 SAY "Date:" OF oDlg
@ 3, 6 GET oGet[3] VAR dDat PICTURE "@E" OF oDlg SIZE 60, 10 WHEN .f. // "@D"
oGet[3]:lDisColors = .f. // don't use standard disabled colors
@ 3, 7 BUTTON "&Ok" OF oDlg SIZE 30, 12 ACTION oDlg:End()
@ 3, 16 BUTTON "&Cancel" SIZE 30, 12 OF oDlg ACTION oDlg:End() CANCEL
# ifdef TESTSETFOCUS
ACTIVATE DIALOG oDlg CENTERED ON INIT (oCheck2:Setfocus(),.F.)
# else
ACTIVATE DIALOG oDlg CENTERED
# endif
return nil