Hi Guys,
I'm not quite sure where I should post this, so if this is the wrong place, I apologise.
Anyway, looking at the sample code for the 0.5.0 release. Demo 7 replaces the ListBox widget with the ItemListBox. However, in the scheme file
/samples/datafiles/schemes/TaharesLook.scheme it defines this type to represent the "items" in the list box:
<FalagardMapping WindowType="TaharezLook/ListboxItem" TargetType="CEGUI/ItemEntry" Renderer="Falagard/ItemEntry" LookNFeel="TaharezLook/ListboxItem" />
The problem is that "ListboxItem" is the name of the CEGUI class that represents an item in the depreciated ListBox class. Consequently, this sample code is confusing for someone who looks at it.
Might I suggest that TaharezLook/ListboxItem be renamed to TaharezLook/ItemEntry?
This would require updating TaharesLook.scheme and /samples/datafiles/layouts/Demo7Windows.layout
Confusion with Demo7 ItemListBox
Moderators: CEGUI MVP, CEGUI Team
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Hi,
Thanks for the feedback. I can see how some confusion is possible, though here are my reasonings for leaving as-is:
* One is a C++ class and the other is a 'pseudo object' that doesn't really exist.
* One is named "ListboxItem", the other "TaharezLook/ListboxItem".
* The old ListboxItem is a low-level object that you have to 'new' to create, the new types are Window based objects which get created via WindowManager.
* The new system can be used in XML layouts, the old one can not (so no confusion between the two there).
* The old system is to be deprecated and eventually removed (maybe even in 0.6.0).
* Now we've released it, changing it in the next 0.5.x release would be a breaking change, and the old system may be removed by the time 0.6.0 is ready.
We could, however, add the other mapping entry or an alias so that the suggested "TaharezLook/ItemEntry" name was available, although that could confuse people also (I imagine a raft of questions about what the difference between the two are ).
CE.
Thanks for the feedback. I can see how some confusion is possible, though here are my reasonings for leaving as-is:
* One is a C++ class and the other is a 'pseudo object' that doesn't really exist.
* One is named "ListboxItem", the other "TaharezLook/ListboxItem".
* The old ListboxItem is a low-level object that you have to 'new' to create, the new types are Window based objects which get created via WindowManager.
* The new system can be used in XML layouts, the old one can not (so no confusion between the two there).
* The old system is to be deprecated and eventually removed (maybe even in 0.6.0).
* Now we've released it, changing it in the next 0.5.x release would be a breaking change, and the old system may be removed by the time 0.6.0 is ready.
We could, however, add the other mapping entry or an alias so that the suggested "TaharezLook/ItemEntry" name was available, although that could confuse people also (I imagine a raft of questions about what the difference between the two are ).
CE.
Hmm. The documentation for CEGUI::Listbox does not claim that it is deprecated -- and I assume that CEGUI::Listbox is what gets created when the XML file says "TaharezLook/Listbox".
So, how do I, from code, add items to a TaharezLook/Listbox? There's no good documentation for this that I can find. My guess is that I get the Window of that TL/L and static_cast it to CEGUI::Listbox, and then a "new" a CEGUI::ListboxItem and call addItem() on the Listbox. Is that correct?
If not, what do I do? Do I go through WindowManager::createWindow() using a class name of "TaharezLook/ListboxItem" ?
So, how do I, from code, add items to a TaharezLook/Listbox? There's no good documentation for this that I can find. My guess is that I get the Window of that TL/L and static_cast it to CEGUI::Listbox, and then a "new" a CEGUI::ListboxItem and call addItem() on the Listbox. Is that correct?
If not, what do I do? Do I go through WindowManager::createWindow() using a class name of "TaharezLook/ListboxItem" ?
some_name wrote:So, how do I, from code, add items to a TaharezLook/Listbox? There's no good documentation for this that I can find. My guess is that I get the Window of that TL/L and static_cast it to CEGUI::Listbox, and then a "new" a CEGUI::ListboxItem and call addItem() on the Listbox. Is that correct?
Sounds correct, tough I don't remember where I did learn/see how to do it, you could take a look at the CEGUI samples.
Return to “Bug Reports, Suggestions, Feature Requests”
Who is online
Users browsing this forum: No registered users and 1 guest