Focus oWnd
Focus oWnd
I have a window with oGets, oSays and other controls.
I would like to control the input with:
oWnd:bkeyChar :={|nKey|iif( nKey == K_LEFT, msginfo("TASTE") )}
But after the first keystroke or if I insert some text in a get-field
I am not able to bring back focus to oWnd.
I tried oWnd:SetFocus() but with no success.
Also up-, down-, right-, left-key does not give back a value.
Thanks in advance
Otto
I would like to control the input with:
oWnd:bkeyChar :={|nKey|iif( nKey == K_LEFT, msginfo("TASTE") )}
But after the first keystroke or if I insert some text in a get-field
I am not able to bring back focus to oWnd.
I tried oWnd:SetFocus() but with no success.
Also up-, down-, right-, left-key does not give back a value.
Thanks in advance
Otto
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Enrico, thank you for your help. But I don’t need focus on the get-field.
What I would like is to navigate the browser with the keys.
At the moment I only can use the mouse.
If you have time please see the screen capture.
If I enter something into the address I can’t pass focus back to the window itself.
Also cursor-key do not work.
www.atzwanger.com/invoice/for_emg.jpg
Thanks in advance
Otto
What I would like is to navigate the browser with the keys.
At the moment I only can use the mouse.
If you have time please see the screen capture.
If I enter something into the address I can’t pass focus back to the window itself.
Also cursor-key do not work.
www.atzwanger.com/invoice/for_emg.jpg
Thanks in advance
Otto
-
- Posts: 142
- Joined: Sun Oct 09, 2005 10:59 am
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Antonio,
I put a small example on:
www.atzwanger.com/invoice/invoiceWithGet.zip
If you comment
// @ 1 , 1 GET oGet VAR cTest OF oWnd SIZE 75,17
keys work - up/down/left/right do not work.
With the getfield I only can use the mouse to navigate.
Regards
Otto
I put a small example on:
www.atzwanger.com/invoice/invoiceWithGet.zip
If you comment
// @ 1 , 1 GET oGet VAR cTest OF oWnd SIZE 75,17
keys work - up/down/left/right do not work.
With the getfield I only can use the mouse to navigate.
Regards
Otto
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Sorry Erico,
oWnd:bkeyChar :={|nKey|iif( nKey == K_ENTER , msginfo("ENTER"), msginfo(str(nKey)) )}
was only to show, that up/down/left/right don't return a value.
Change to:
oWnd:bkeyChar :={|nKey|iif( nKey == K_ENTER ,( oWnd:oVScroll():SetPos( nPos:=nPos+1),f_code()) ,)}
Comment the oGetLine and delete oGet:oJump := oWnd
than you can navigate down with the Enter-key.
On click shows the record .
Saluti
Otto
oWnd:bkeyChar :={|nKey|iif( nKey == K_ENTER , msginfo("ENTER"), msginfo(str(nKey)) )}
was only to show, that up/down/left/right don't return a value.
Change to:
oWnd:bkeyChar :={|nKey|iif( nKey == K_ENTER ,( oWnd:oVScroll():SetPos( nPos:=nPos+1),f_code()) ,)}
Comment the oGetLine and delete oGet:oJump := oWnd
than you can navigate down with the Enter-key.
On click shows the record .
Saluti
Otto
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Enrico,
does the exe work on your side.
If yes you can scroll down with the enter-key or with a mouse-click on the scrollbar.
but if you have a getfield -for example to get the address - on the window too, focus is on the getfield and you can't navigate anymore with the keys.
I had a look at the wbrowse class maybe I have to make a control out of this source. But I never worked with classes.
I changed the wbrowse-class like this:
Inserted the method: ShowSomething
But there is no text on the screen.
I wish you a Merry Christmas.
Otto
METHOD ShowSomething() CLASS TWBrowse
local oWnd:= ::oWnd
@ 5,5 Say "TEST NEU" of oWnd
@ 15,15 Say "TEST NEU" of ::oWnd
@ 25,25 Say "TEST NEU" of oWnd
@ 35,35 Say "TEST NEU" of oWnd
@ 55,55 Say "TEST NEU" of oWnd
::oWnd:say( 0, 0, "TESTTSTSTSTSS" ,255,16777215,::oFont,.T.)
::oWnd:say( 50, 50, "TESTTSTSTSTSS",255,16777215,::oFont,.T.)
::oWnd:say( 5, 5, "TESTTSTSTSTSS" ,255,16777215,::oFont,.T.)
return nil
does the exe work on your side.
If yes you can scroll down with the enter-key or with a mouse-click on the scrollbar.
but if you have a getfield -for example to get the address - on the window too, focus is on the getfield and you can't navigate anymore with the keys.
I had a look at the wbrowse class maybe I have to make a control out of this source. But I never worked with classes.
I changed the wbrowse-class like this:
Inserted the method: ShowSomething
But there is no text on the screen.
I wish you a Merry Christmas.
Otto
METHOD ShowSomething() CLASS TWBrowse
local oWnd:= ::oWnd
@ 5,5 Say "TEST NEU" of oWnd
@ 15,15 Say "TEST NEU" of ::oWnd
@ 25,25 Say "TEST NEU" of oWnd
@ 35,35 Say "TEST NEU" of oWnd
@ 55,55 Say "TEST NEU" of oWnd
::oWnd:say( 0, 0, "TESTTSTSTSTSS" ,255,16777215,::oFont,.T.)
::oWnd:say( 50, 50, "TESTTSTSTSTSS",255,16777215,::oFont,.T.)
::oWnd:say( 5, 5, "TESTTSTSTSTSS" ,255,16777215,::oFont,.T.)
return nil
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Otto,
If there is a control on the window, then it will have the focus, and the input events (keystrokes, mouse) will get routed to it.
If you need to edit on the screen, you may use a GET, but you need to destroy it, or to hide it, once you are finish with it, so the input events will not go through it.
Your code is ok. I guess you are close to get what you want.
If there is a control on the window, then it will have the focus, and the input events (keystrokes, mouse) will get routed to it.
If you need to edit on the screen, you may use a GET, but you need to destroy it, or to hide it, once you are finish with it, so the input events will not go through it.
Your code is ok. I guess you are close to get what you want.