- Code: Select all Expand view
- #include "Fivewin.ch"
STATIC oGet
FUNCTION MAIN()
LOCAL oDlg, oGt1, oGt2, oGt3
LOCAL cVr1 := SPACE( 30 )
LOCAL cVr2 := SPACE( 30 )
LOCAL cVr3 := SPACE( 30 )
LOCAL bVl1 := { || !Empty( GetActive():VarGet() ) }
LOCAL bVl2 := { || !Empty( GetActive():VarGet() ) }
LOCAL bVl3 := { || !Empty( GetActive():VarGet() ) }
DEFINE DIALOG oDlg
@ 1, 1 SAY "Test 1:" GET oGt1 VAR cVr1
@ 2, 1 SAY "Test 2:" GET oGt2 VAR cVr2
@ 3, 1 SAY "Test 3:" GET oGt3 VAR cVr3
oGt1:bGotFocus = { || oGet := oGt1 }
oGt2:bGotFocus = { || oGet := oGt2 }
oGt3:bGotFocus = { || oGet := oGt3 }
oGt1:bLostFocus = { || oGt1:bValid := { || .F. }, If( Eval( bVl1 ), oGt1:bValid := { || .T. }, ) }
oGt2:bLostFocus = { || oGt2:bValid := { || .F. }, If( Eval( bVl2 ), oGt2:bValid := { || .T. }, ) }
oGt3:bLostFocus = { || oGt3:bValid := { || .F. }, If( Eval( bVl3 ), oGt3:bValid := { || .T. }, ) }
oGt1:bKeyDown = { | nKey | If( nKey = VK_F2, MsgInfo( GETACTIVE():VarGet() ), ) }
oGt2:bKeyDown = { | nKey | If( nKey = VK_F2, MsgInfo( GETACTIVE():VarGet() ), ) }
oGt3:bKeyDown = { | nKey | If( nKey = VK_F2, MsgInfo( GETACTIVE():VarGet() ), ) }
ACTIVATE DIALOG oDlg;
CENTER
RETURN NIL
FUNCTION GETACTIVE()
oGet:Assign()
RETURN oGet
EMG