FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for CA-Clipper Focus oWnd
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Focus oWnd
Posted: Sun Dec 25, 2005 07:05 AM

Thanks Antonio,
is it possible to group all the code for browsing in a own control, so that I have on one hand the get-fields and on the other the browse.
Regards
Otto

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Focus oWnd
Posted: Sun Dec 25, 2005 08:56 AM

Otto,

Yes, of course. You may use source\classes\TPanel.prg as a skeleton to build your own browse control, so your browse will just respond to input events when it has the focus.

You may need to add it the WS_TABSTOP style.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Focus oWnd
Posted: Sun Dec 25, 2005 07:32 PM

Hello Antonio,

TPanel works.

Where I have problems is with the up,down,left,right-keys.
Do I have to change twindow?

I don't know how to use: WS_TABSTOP style
so I tried to do it with the VALID case.
Is this a bad solution?

You find my code on http://www.atzwanger.com/invoice/invoiceFor Antonio.zip

@ 1 , 1 GET oGet VAR cTest OF oPanelAddress SIZE 100,17 VALID (oPanelBody:SetFocus(),.t.)

Thanks in advance
Otto

METHOD KeyDown( nKey, nFlags ) CLASS TWBrowse

do case
case nKey == VK_UP
::GoUp()

  case nKey == VK_DOWN
       ::GoDown()

  case nKey == VK_LEFT
       ::GoLeft()

  case nKey == VK_RIGHT
       ::GoRight()

  case nKey == VK_HOME
       ::GoTop()

  case nKey == VK_END
       ::GoBottom()

  case nKey == VK_PRIOR
       if GetKeyState( VK_CONTROL )
          ::GoTop()
       else
          ::PageUp()
       endif

  case nKey == VK_NEXT
       if GetKeyState( VK_CONTROL )
          ::GoBottom()
       else
          ::PageDown()
       endif

  otherwise
       return Super:KeyDown( nKey, nFlags )

endcase

return 0

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Focus oWnd
Posted: Mon Dec 26, 2005 12:00 AM

Otto,

> Where I have problems is with the up,down,left,right-keys.
> Do I have to change twindow?

You have to define Method KeyDown() for your news class. There is no need to modify TWindow.

I can't download: You find my code on http://www.atzwanger.com/invoice/invoiceFor Antonio.zip

Please provide a valid link. Thanks.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Focus oWnd
Posted: Mon Dec 26, 2005 07:46 AM

Hello Antonio,
sorry for the wrong link.
I hope thisone works:

http://www.atzwanger.com/invoice/invoiceForAntonio.zip

At the moment it is only a programm not a class - I don't know how to make one - and I tried with:
oPanelBody:bkeyChar := {|nKey|Msginfo(str(nKey))}
But I get no value for the arrowkeys.
regards
Otto

Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Focus oWnd
Posted: Mon Dec 26, 2005 09:34 PM

Hello Antonio,
thank you for your help.
Now I can do what I want.
Only a little problem still exists:

I don't know how to use: WS_TABSTOP style
so I tried to do it with the VALID case.
This way I can't return from what I call panelBody to the panelHeader with the keyboard.
Regards,
Otto

http://www.atzwanger.com/invoice/invoic ... 051226.zip

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Focus oWnd
Posted: Tue Dec 27, 2005 09:28 AM

Otto,

What I was meaning is to create a new class, using TPanel as a sample, for a user defined control, where you paint, process input (keyboard, mouse), etc.

That class should have the style WS_TABSTOP so you can use the tab to set the focus to it and to go to other controls.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Focus oWnd
Posted: Tue Dec 27, 2005 10:41 AM

Now I have a nice homework,

Thanks
Otto

Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Focus oWnd
Posted: Fri Jan 06, 2006 08:38 AM

Hello Antonio,

I tried your suggestion and so fare it is working.
The only problem is how to switch between the address-panel and the browser-panel.

Could you please help me on that again.

LINK: www.atzwanger.com/invoice/invoiceForAntonio_2.zip

Thanks in advance

Otto

Continue the discussion