how to change the focus between EditBoxs

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
sichuan
Just popping in
Just popping in
Posts: 1
Joined: Tue Sep 13, 2005 15:04

how to change the focus between EditBoxs

Postby sichuan » Tue Sep 13, 2005 16:06

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?

User avatar
khariq
Just popping in
Just popping in
Posts: 9
Joined: Mon Mar 21, 2005 14:40

Re: how to change the focus between EditBoxs

Postby khariq » Tue Sep 13, 2005 17:21

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


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 5 guests