FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour oGet:KeyChar()
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
oGet:KeyChar()
Posted: Tue Oct 04, 2011 07:48 PM

Hello Antonio,
In my programs I use the nearly the same code as

c:\FWH\samples\keybsim.prg

for keyboard input with a touchscreen.

Since the last or one of the last updates of Fivewin this does not work any more.
Please test keybsim.prg.
Thanks in advance and
best regards,

REDEFINE BUTTON oBtn1 ID 101 OF oDlg ACTION (MsgBeep(),;
oGet1:SetFocus(.t.),;
oGet1:KeyChar(ASC("1")))

Mag. Otto Atzwanger

Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: oGet:KeyChar()
Posted: Tue Oct 04, 2011 08:13 PM

Linking in
control.prg from dez. 2010 resolves the problem.

Best regards,
Otto

Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: oGet:KeyChar()
Posted: Tue Oct 04, 2011 08:48 PM
Hello Antonio,

If I change the new method _SetFocus() with the method _SetFocus() from Dez. 2010 all is working.
Can you please advice me what to do.

Best regards,
Otto


Code (fw): Select all Collapse
/*
METHOD _SetFocus() CLASS TControl

   local hCtrlNext

   if ::lWhen()
      if ::IsKindOf( "TDIALOG" )
         ::PostMsg( WM_NEXTDLGCTL, ::hWnd, 1 )
      else
         SetFocus( ::hWnd )
      endif
   else
      hCtrlNext = GetWindow( ::hWnd, GW_HWNDNEXT )
      if GetParent( hCtrlNext ) != ::hWnd
         hCtrlNext = GetWindow( ::hWnd, GW_CHILD )
      endif
      if ::IsKindOf( "TDIALOG" )
         ::PostMsg( WM_NEXTDLGCTL, hCtrlNext, 1 )
      else
         SetFocus( hCtrlNext )
      endif
   endif

return nil
*/

METHOD _SetFocus() CLASS TControl

   local hCtrlNext

   if ::lWhen()
      SetFocus( ::hWnd )
   else
      hCtrlNext = GetWindow( ::hWnd, GW_HWNDNEXT )
      if GetParent( hCtrlNext ) != ::oWnd:hWnd
         hCtrlNext = GetWindow( ::oWnd:hWnd, GW_CHILD )
      endif
      SetFocus( hCtrlNext )
   endif

return nil



//----------------------------------------------------------------------------//
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: oGet:KeyChar()
Posted: Wed Oct 05, 2011 09:26 AM

Otto,

In your code instead of doing oGet:SetFocus(), do SetFocus( oGet:hWnd ) and use the most recent Class TControl Method SetFocus() code as it has advantages over previous versions :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: oGet:KeyChar()
Posted: Wed Oct 05, 2011 09:40 AM

Hello Antonio,

c:\FWH\samples\keybsim.prg
REDEFINE BUTTON oBtn1 ID 101 OF oDlg ACTION (MsgBeep(),;
oGet1:SetFocus( oGet1:hWnd ),;
oGet1:KeyChar(ASC("1")))
I tried this way but with no success.
Do I need 11.9 version of FiveWin?
Best regards,
Otto

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: oGet:KeyChar()
Posted: Wed Oct 05, 2011 10:33 AM

Otto,

There is a little error in your code, it is this way:

REDEFINE BUTTON oBtn1 ID 101 OF oDlg ACTION (MsgBeep(),;
SetFocus( oGet1:hWnd ),;
oGet1:KeyChar(ASC("1")))

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion