Focus oWnd

Postby Otto » Sun Dec 25, 2005 7: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
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

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

Postby Otto » Sun Dec 25, 2005 7: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
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

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

Postby Otto » Mon Dec 26, 2005 7: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
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Postby Otto » Mon Dec 26, 2005 9: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
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

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

Postby Otto » Tue Dec 27, 2005 10:41 am

Now I have a nice homework,

Thanks
Otto
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Postby Otto » Fri Jan 06, 2006 8: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
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Previous

Return to FiveWin for CA-Clipper

Who is online

Users browsing this forum: No registered users and 2 guests