oGet:KeyChar()

oGet:KeyChar()

Postby Otto » Tue Oct 04, 2011 7: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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm

Re: oGet:KeyChar()

Postby Otto » Tue Oct 04, 2011 8:13 pm

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

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm

Re: oGet:KeyChar()

Postby Otto » Tue Oct 04, 2011 8: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: Select all  Expand view
/*
METHOD _SetFocus() CLASS TControl

   local hCtrlNext

   if ::lWhen()
      if ::oWnd:IsKindOf( "TDIALOG" )
         ::oWnd:PostMsg( WM_NEXTDLGCTL, ::hWnd, 1 )
      else
         SetFocus( ::hWnd )
      endif
   else
      hCtrlNext = GetWindow( ::hWnd, GW_HWNDNEXT )
      if GetParent( hCtrlNext ) != ::oWnd:hWnd
         hCtrlNext = GetWindow( ::oWnd:hWnd, GW_CHILD )
      endif
      if ::oWnd:IsKindOf( "TDIALOG" )
         ::oWnd: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



//----------------------------------------------------------------------------//
 
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm

Re: oGet:KeyChar()

Postby Antonio Linares » Wed Oct 05, 2011 9: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: oGet:KeyChar()

Postby Otto » Wed Oct 05, 2011 9: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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm

Re: oGet:KeyChar()

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 41 guests