Page 2 of 2

Posted: Sun Dec 25, 2005 7:05 am
by Otto
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

Posted: Sun Dec 25, 2005 8:56 am
by Antonio Linares
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.

Posted: Sun Dec 25, 2005 7:32 pm
by Otto
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

Posted: Mon Dec 26, 2005 12:00 am
by Antonio Linares
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.

Posted: Mon Dec 26, 2005 7:46 am
by Otto
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

Posted: Mon Dec 26, 2005 9:34 pm
by Otto
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

Posted: Tue Dec 27, 2005 9:28 am
by Antonio Linares
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.

Posted: Tue Dec 27, 2005 10:41 am
by Otto
Now I have a nice homework,

Thanks
Otto

Posted: Fri Jan 06, 2006 8:38 am
by Otto
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