Initially all of them are disabled.
When I enable all of them (except third one) by using the function ChangeWhen, everything is OK. It works well.
But when I try to skip on the gets by hitting ENTER or TAB key, I cannot skip the third one which is disabled.
Please help.
- Code: Select all Expand view
- #include "fivewin.ch"
#INCLUDE "dtpicker.ch"
FUNCTION Main()
LOCAL oDlg, oFolder, aSayGet := {}, aGets := {}
AAdd(aSayGet, {'Field-1 :', PadR('Field-1', 40), 200} )
AAdd(aSayGet, {'Field-2 :', PadR('Field-2', 40), 200} )
AAdd(aSayGet, {'Field-3 :', PadR('Field-3', 40), 200} )
AAdd(aSayGet, {'Field-4 :', PadR('Field-4', 40), 200} )
AAdd(aSayGet, {'Field-5 :', PadR('Field-5', 40), 200} )
DEFINE DIALOG oDlg SIZE 500,400 PIXEL TRUEPIXEL
@ 10, 10 FOLDEREX oFolder PROMPT "&First", "&Second", "&Third" OF oDlg SIZE 480, 380 PIXEL
oFolder:aEnable := { .T., .F., .F. }
@ 20, 20 BUTTON 'Next >' SIZE 30, 13 PIXEL OF oFolder:aDialogs[1] ;
ACTION ( oFolder:aEnable := { .F., .T., .F. }, ;
oFolder:SetOption(2), ;
ChangeWhen(@aGets), ; //Call the function to change the When clauses to .T.
oDlg:UpDate() )
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT PlaceControls(@oDlg, @oFolder, @aSayGet, @aGets) ;
ON PAINT aGets[1]:SetFocus()
RETURN NIL
FUNCTION PlaceControls(oDlg, oFolder, aSayGet, aGets)
LOCAL oPanel, nI, nRow, aGetObj[ Len(aSayGet) ]
oPanel := TScrollPanel():New( 0, 0, 195, 470, oFolder:aDialogs[2], .T. )
oFolder:aDialogs[2]:oClient := oPanel
nRow:= 10
FOR nI=1 to Len(aSayGet)
@ nRow, 20 SAY aSayGet[nI, 1] OF oPanel SIZE 100,21 PIXEL RIGHT TRANSPARENT
@ nRow, 125 GET aGetObj[nI] VAR aSayGet OF oPanel SUBSCRIPT nI, 2 SIZE aSayGet[nI, 3], 21 PIXEL WHEN .F. //Initially disabled
AAdd( aGets, aGetObj[nI] )
nRow += 23
NEXT
oPanel:SetRange()
RETURN NIL
FUNCTION ChangeWhen(aGets)
LOCAL nI
FOR nI = 1 TO Len(aGets)
IF nI <> 3
aGets[nI]:bWhen := {|| .T.} //Change bWhen clause of all gets to .T. except third element
ENDIF
NEXT
RETURN NIL