Hi, I have two questions about the Listbox.
1) A ListboxTextItem often create like this:
ListboxTextItem* item = new ListboxTextItem("item1");
This is not a auto_ptr, so when the application shut down, does the ListboxTextItem object delete by itself? if not, where should it be deleted?
2) What is the different between ItemListbox and Listbox? Can I add a ListboxTextItem to ItemListbox? as the "addItem" method in the "ItemListbox" define like this "addItem(ItemEntry *item)", It cannot convert a ListboxTextItem* to ItemEntry*.
any help~
thanks!
about ListboxItem, Listbox, ItemListbox...
Moderators: CEGUI MVP, CEGUI Team
Regarding point #2: CheckListboxItem is an example usage. Basically you can create a custom listbox item and add it to ItemListbox. Another example would be a merchant's inventory (sale and purchase) list where we can see an image of the object, its name as text on the upper right and price on the lower right:
You could also add a button to purchase/sell the item within the listbox item, a button to obtain additional information, etc.
Code: Select all
PPPPP <Item name>
PPPPP <Item description>
PPPPP ----------------------
PPPPP <Item price>
where P is an image/picture
You could also add a button to purchase/sell the item within the listbox item, a button to obtain additional information, etc.
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Regarding point #1: The last parameter to the ListboxItem constructor is the boolean 'auto_delete'. If this is set to true (the default), the Listbox will automatically delete the item when the Listbox is destroyed; if this is set to false, the client code must destroy the item after it has been detached from the Listbox or after the Listbox has been destroyed.
Generally speaking, you're probably better off using the new ItemListbox approach (see Rackle's response above) since it's much more powerful.
CE.
Generally speaking, you're probably better off using the new ItemListbox approach (see Rackle's response above) since it's much more powerful.
CE.
Who is online
Users browsing this forum: No registered users and 20 guests