when the user presses "Exit" I wanted to check if the gets have been modified
I made
- Code: Select all Expand view
- #include"fivewin.ch"
Function test()
local aGet:=array(2)
local oDlg
local cGet1:=space(60)
local cGet2:=space(60)
local lSave:=.f.
local bCheck
local oBtn1,oBtn2
DEFINE DIALOG oDLG SIZE 400,200
@ 10,10 GET aGet[1] VAR cGet1 SIZE 100,10 PIXEL of oDlg
@ 40,10 GET aGet[2] VAR cGet2 SIZE 100,10 PIXEL of oDlg
@ 90, 55 BUTTON oBtn1 Prompt "&OK" SIZE 45, 10 PIXEL OF oDlg ACTION ( oDlg:end( IDOK ) )
@ 90, 107 BUTTON oBtn2 Prompt "&EXIT" SIZE 45, 10 PIXEL OF oDlg ACTION ( oDlg:end( IDCANCEL ) )
*
bCheck:= { || lSave:= IIF(Msgyesno("I must save ?"),.t.,.f.), oDLG:AEvalWhen(), .t. }
AEval( aGet, { |o| o:bChange := bCheck } )
ACTIVATE DIALOG oDLG CENTER ON INIT EVAL(bCheck)
IF lSave
//---- save
Endif
return nil
I made also
AEval(aGet,{|oGet| oGet:bChange:={||lSave:= IIF(Msgyesno("I must save ?"),.t.,.f.)}})
but not run ok,How I can resolve ?