código:
- Code: Select all Expand view
- #include 'fivewin.ch'
static clogfile := 'log.txt'
Function Main()
Local oDlg := Nil
Local oFld := Nil
Local oGet1a := Nil
Local oGet1b := Nil
Local oGet2a := Nil
Local oGet2b := Nil
Local oBt1, oBt2
Local cVar1a := 'XXXXXXXXXX'
Local cVar1b := 'XXXXXXXXXX'
Local cVar2a := 'XXXXXXXXXX'
Local cVar2b := 'XXXXXXXXXX'
ferase( cLogFile )
TGet():lClrFocus := .T.
DEFINE DIALOG oDlg TITLE "Test bLostFocus in Folder" ;
FROM 5, 5 TO 20, 49
@ 0.5, 1 FOLDER oFld PROMPT "one", "Two" ;
OF oDlg SIZE 160, 90
@ 3,1 BUTTON oBt1 PROMPT "OK" OF oFld:aDialogs[1]
oBt1:bLostFocus := {|| Write('FOLDER 1 BOTON 1')}
@ 1, 1 GET oGet1a VAR cVar1a OF oFld:aDialogs[1] PICTURE '@S20' SIZE 40,10
oGet1a:bLostFocus := {|| Write('FOLDER 1 GET 1')}
@ 2, 1 GET oGet1b VAR cVar1b OF oFld:aDialogs[1] PICTURE '@S20' SIZE 40,10
oGet1b:bLostFocus := {|| Write('FOLDER 1 GET 2')}
@ 3,1 BUTTON oBt2 PROMPT "OK" OF oFld:aDialogs[2]
oBt2:bLostFocus := {|| Write('FOLDER 1 BOTON 2')}
@ 1, 1 GET oGet2a VAR cVar2a OF oFld:aDialogs[2] PICTURE '@S20' SIZE 40,10
oGet2a:bLostFocus := {|| Write('FOLDER 2 GET 1')}
@ 2, 1 GET oGet2b VAR cVar2b OF oFld:aDialogs[2] PICTURE '@S20' SIZE 40,10
oGet2b:bLostFocus := {|| Write('FOLDER 2 GET 2')}
ACTIVATE DIALOG oDlg CENTERED ON INIT oBt1:SetFocus()
Return ( Nil )
Static Function Write( cText )
hb_MemoWrit( cLogFile, hb_MemoRead( cLogFile ) + hb_eol() + Time() + ' ' + cText)
Return ( Nil )
resultado del log:
- Code: Select all Expand view
19:18:26 FOLDER 1 BOTON 1
19:18:26 FOLDER 1 BOTON 1
19:18:26 FOLDER 1 BOTON 2
19:18:26 FOLDER 1 BOTON 2
19:18:31 FOLDER 1 BOTON 1