How to make a drop-down choice box work?

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

DulcetTone
Just popping in
Just popping in
Posts: 6
Joined: Wed Aug 23, 2006 14:34

How to make a drop-down choice box work?

Postby DulcetTone » Tue Sep 12, 2006 14:25

I am trying to create a simple droplist, such as the dropdown "Font Colour" I see as I edit this very post: one which shows only one value (the currently active setting), and when clicked, enlarges to show all available choices and permits a new one to be selected which presumably calls an event handler in my code. However, I don't know how to do this with CEGUI.

I created a ComboDropList in CELayoutEditor, and give it approximately the same proportions as a textfield. In my code, I programmatically add a few ListboxTextItems to my ComboDropList.

However, when the code runs, the text of a single item is only smurfily visible (sawn off), and clicking on the widget does not reveal the other (moderate number of) choices. I am also puzzled by unexplained methods for "auto-arm" and "arm".

Is there more of a background on the intent and use of this class? Is it indeed a good choice for a drop list? And (incidentally), what the heck IS a combo box? I have never really seen the widget defined, particularly as it contrasts with a drop-down selector list.

Thanks in advance.

tone

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Postby lindquist » Tue Sep 12, 2006 18:39

ComboDropList should not be used directly, the widget you're looking for is Combobox.
The Combobox automatically creates a Editbox, ComboDropList and a Button (to toggle to the drop list).
The Combobox has much the same interface as a Listbox, so you cannot define the list in the XML layout. You must do this in code.

When you create the combobox, the area you give it INCLUDES the area of the drop list.

HTH

DulcetTone
Just popping in
Just popping in
Posts: 6
Joined: Wed Aug 23, 2006 14:34

Postby DulcetTone » Tue Sep 12, 2006 20:17

Many thanks. That will give me a good start.

tone


Return to “Help”

Who is online

Users browsing this forum: No registered users and 13 guests