Hello:
I search the forum by the word, "focus".
But I found not thing.
If I want to switch the focus between EditBoxs by Tab.
How can I do?
how to change the focus between EditBoxs
Moderators: CEGUI MVP, CEGUI Team
Re: how to change the focus between EditBoxs
I'm not sure if CEGUI directly supports tabbing between input fields, but if it doesn't here is what I would recommend:
Keep a circular queue of every edit box in the active window. Call one of your edit boxes 1, and place him at the front of the queue. When the user presses TAB move 1 to the back of the queue and call the focus method (editbox->activate()) of the next editbox in the queue. The user now has input focus on the second editbox in the queue. To shift-tab (in Windows, this goes "back" one input field), bring the editbox from the back of the queue to the front and then activate him. I'm not sure if you would need to deactivate the current editbox, but I don't see how it would hurt.
Diagram (bold has focus):
Start - queue
1 2 3 4 5
User presses tab
2 3 4 5 1
User presses shift-tab
1 2 3 4 5
I could be waaaay off on this, I'm a CEGUI novice, but there is my 2 cents.
Edit: API reference that might help http://www.cegui.org.uk/api_reference/c ... itbox.html
Keep a circular queue of every edit box in the active window. Call one of your edit boxes 1, and place him at the front of the queue. When the user presses TAB move 1 to the back of the queue and call the focus method (editbox->activate()) of the next editbox in the queue. The user now has input focus on the second editbox in the queue. To shift-tab (in Windows, this goes "back" one input field), bring the editbox from the back of the queue to the front and then activate him. I'm not sure if you would need to deactivate the current editbox, but I don't see how it would hurt.
Diagram (bold has focus):
Start - queue
1 2 3 4 5
User presses tab
2 3 4 5 1
User presses shift-tab
1 2 3 4 5
I could be waaaay off on this, I'm a CEGUI novice, but there is my 2 cents.
Edit: API reference that might help http://www.cegui.org.uk/api_reference/c ... itbox.html
Return to “Modifications / Integrations / Customisations”
Who is online
Users browsing this forum: No registered users and 10 guests