[Solved] Selecting a Combobox programmatically

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

Gykonik
Just popping in
Just popping in
Posts: 15
Joined: Thu Mar 31, 2016 18:33

[Solved] Selecting a Combobox programmatically

Postby Gykonik » Tue Apr 05, 2016 15:19

Hello, is there a way, how I can select a combobox directly, after it gets displayed? (Via a window and if the window shows up the combobox should be selected, so the user can type in things directly)...?

lucebac
Just can't stay away
Just can't stay away
Posts: 193
Joined: Sat May 24, 2014 21:55

Re: Select Combobox

Postby lucebac » Tue Apr 05, 2016 16:09

You can call activate() on each window: http://static.cegui.org.uk/docs/0.8.5/c ... 8ed88491e5
To have a function calling activate() on a child window automatically when the parent window e.g. gets focus, you need to register a proper event listenener on the parent and call activate() from within the event callback.

Gykonik
Just popping in
Just popping in
Posts: 15
Joined: Thu Mar 31, 2016 18:33

Re: Select Combobox

Postby Gykonik » Wed Apr 06, 2016 14:43

Thanks, and do I have to deactivate it again, if a player has clicked the Exit (x) key of the window?

And is there a way, how I can say, that if I activate the box the cursor should jump to the last position of my string?

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Select Combobox

Postby Ident » Sat Apr 09, 2016 09:27

Subscribe to the activation events and jump with the selection to the last position in the string inside the evend handler you write.
CrazyEddie: "I don't like GUIs"


Return to “Help”

Who is online

Users browsing this forum: No registered users and 27 guests