> Still the issue of the behavior when Valid Block opens any new dialog remains
Fixed These changes are required:
Code: Select all
::oEditGet:bValid := { | oGet, lRet | oGet:lValidating := .T., lRet := Eval( ::bEditValid, oGet, Self ), oGet:lValidating := .F., If( ! lRet, oGet:SetFocus(),), lRet }
...
static function EditGetLostFocus(...)
...
if ( oWnd := oWndFromHwnd( hWndFocus ) ) != nil .and. ! ( oWnd == oBrw ) .and. ;
Upper( oWnd:ClassName() ) != "TGET" // new!!!
oBrw:CancelEdit()
SetFocus( hWndFocus )
return nil
endif
...
In mallorca.prg these changes are required:
Code: Select all
oBrw:aCols[1]:bEditValid := { | oGet, oCol | Valida( oGet, oCol ) }
...
STATIC FUNCTION Valida( oGet, oCol )
local nVal := 0
if oGet:Value() > 6
MsgAlert( "Must be lower than 7" )
if MsgGet( "New value", "Enter number between 1 and 6", @nVal )
if nVal > 0 .and. nVal < 7
oGet:VarPut( nVal )
oCol:PostEdit()
return .T.
endif
endif
return .F.
endif
return .T.
http://www.hotshare.net/file/25998-4690817f9b.html