We detect a strange problem with gets when we have a sequence like
get1, get2, getN, pushbutton and getN have a valid/when condition or
when pushbutton depend of getN valid/when. For any cause that we couldn't
detect pushbutton don't get the focus. We couldn't isolate a little
situation when it occur but I detected that it occur only when we use
enter key to skip to next control. Using tab key the navigation by the
controls, validations and when is evaluated correctly.
I changed a bit the code from KeyChar method in window.prg to test if
tab OR enter was pressed to skip to next control as follow.
My focus problems was solved and I hope the similar
problem of another user too.
- Code: Select all Expand view
METHOD KeyDown( nKey, nFlags ) CLASS TWindow
local bKeyAction := SetKey( nKey )
if nKey == VK_TAB .and. ::oWnd != nil .and. GetKeyState( VK_SHIFT )
::oWnd:GoPrevCtrl( ::hWnd )
return 0
endif
if (nKey == VK_TAB .or. nKey == VK_RETURN) .and. ::oWnd != nil // <-- Here
::oWnd:GoNextCtrl( ::hWnd )
return 0
endif
(...)
Regards,
Maurilio