> Still the issue of the behavior when Valid Block opens any new dialog remains
Fixed These changes are required:
- Code: Select all Expand view RUN
::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
...
The above "TGET" could be extended with the allowed controls to get focus from a VALID process.
In mallorca.prg these changes are required:
- Code: Select all Expand view RUN
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.
A new mallorca.exe build:
http://www.hotshare.net/file/25998-4690817f9b.html