Focus problem with TGet class

Focus problem with TGet class

Postby Maurilio Viana » Mon Mar 13, 2006 2: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.

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
User avatar
Maurilio Viana
 
Posts: 252
Joined: Tue Oct 25, 2005 2:48 pm
Location: Garça/Garza/Heron City - Brazil

Postby James Bott » Mon Mar 13, 2006 4: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Maurilio Viana » 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
User avatar
Maurilio Viana
 
Posts: 252
Joined: Tue Oct 25, 2005 2:48 pm
Location: Garça/Garza/Heron City - Brazil


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Rick Lipkin and 85 guests