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
How to make a drop-down choice box work?
Moderators: CEGUI MVP, CEGUI Team
-
- Just popping in
- Posts: 6
- Joined: Wed Aug 23, 2006 14:34
- lindquist
- CEGUI Team (Retired)
- Posts: 770
- Joined: Mon Jan 24, 2005 21:20
- Location: Copenhagen, Denmark
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
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
-
- Just popping in
- Posts: 6
- Joined: Wed Aug 23, 2006 14:34
Who is online
Users browsing this forum: Bing [Bot] and 6 guests