FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Focus problem with TGet class
Posts: 252
Joined: Tue Oct 25, 2005 02:48 PM

Focus problem with TGet class

Posted: Mon Mar 13, 2006 02:47 PM
Dear Antonio,

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.

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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM

Focus problem with TGet class

Posted: Mon Mar 13, 2006 04:11 PM

Maurilio,

Does this create a problem with the Enter key triggering the default pushbutton?

Remember that the Tab key is the Windows standard for moving from field to field. The Enter key was used in DOS apps. Most users are going to expect the Enter key to trigger the default pushbutton.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 252
Joined: Tue Oct 25, 2005 02:48 PM

Focus problem with TGet class

Posted: Tue Mar 14, 2006 10:04 PM

James,

My fault! I forgot to mention it can be used only by users that have these focus problems.
I don´t tested with default pushbuttons yet.
In FWH 2.6 worked fine, when I migrate to 2.7 I had this focus problems when I use any sequence of when/valid clauses in gets and/or pushbuttons.

Regards,
Maurilio

Continue the discussion