leaving the combobox

BlitzPlus Forums/BlitzPlus Beginners Area/leaving the combobox

marcos jose(Posted 2016) [#1]
Hello!

I would like to help with a code.
I need to move between gadgets using "tab" and not with the mouse, because the program is to an audience of visually impaired. (Blind).

;---
janela = CreateWindow("outro foco", 0, 0, 300, 200)

t1 = CreateTextField(10, 10, 100, 20, janela)

b1=CreateButton("ok", 10, 60, 100, 20, janela)
b2=CreateButton("cancelar", 120, 60, 100, 20, janela)

cb=CreateComboBox( 10, 150, 100, 20, janela)

AddGadgetItem cb, "opção 1"
AddGadgetItem cb, "opção 2"
AddGadgetItem cb, "opção final"

ActivateGadget(t1)
Repeat
evento = WaitEvent(5)

If evento=$803 End
If EventSource() = b1 End

Forever
;---

Searching around, I found a "User32.dll" library. Still, I can not get in and out of the "combo box" with the "tab" key.

Realize that it has within the "combo box", it does not occur many events.
I made the following addition:

;---
janela = CreateWindow("outro foco", 0, 0, 300, 300)

t1 = CreateTextField(10, 10, 100, 20, janela)

b1=CreateButton("ok", 10, 60, 100, 20, janela)
b2=CreateButton("cancelar", 120, 60, 100, 20, janela)

cb=CreateComboBox( 10, 150, 100, 20, janela)

AddGadgetItem cb, "opção 1"
AddGadgetItem cb, "opção 2"
AddGadgetItem cb, "opção final"

HotKeyEvent 59, 0, $1001, 1
HotKeyEvent 60, 0, $1001, 2
ActivateGadget(t1)
Repeat
evento = WaitEvent(5)

If evento=$803 End
If EventSource() = b1 End

If EventID()=$1001
If EventData()= 1 ActivateGadget(t1)
If EventData()= 2 ActivateGadget(cb)
EndIf
Forever
;---

Pressing "f2" the focus goes to the "combo box". But he did not go to the textfield when I press "F1" as it should work.

Still I tested the example of "getFocus" posted on the forum, but it does not work with the "combo box".
how can I do to move for absolutely all objects in a window with "tab"? Or is this not possible?

Grateful for any help!


(Translated by google translate)