Page 1 of 1

About ItemListbox && ItemEntry

Posted: Thu Sep 17, 2009 09:07
by singbol
Hi, I'm not ask the same question and I think I should place it in the Beginners Help.
I want to insert into the ItemListbox some Items, which are combined windows, such as StaticImage、StaticText、StaticImage.and I now know that I should insert ItemEntry based class object into ItemListbox.
In order to achive this, I write a class Named NewItemEntry: public ItemEntry.
and In it's constructor, I add four new child window(StaticImage、StaticText、StaticImage、StaticImage) to this NewItemEntry, and the next step I create a new object NewItemEntry *pMyItem = new NewItemEntry(...)
ItemListbox::addItem(pMyItem), it gives me an exception ("ItemEntry::getItemPixelSize must be implementd...")
I don't know how to solve this .
I'm waiting for your suggestion!Thank you !

Re: About ItemListbox && ItemEntry

Posted: Thu Sep 17, 2009 19:29
by CrazyEddie
I know from the other thread that you fixed this, but for completeness, the reason this fails is because you're trying to create your new window type directly which is not allowed in CEGUI. New window types must be registered with the system, you then need a falagard mapping that can assign an appropriate WindowRenderer in order that the new window type can draw imagery specified in a WidgetLook XML definition. The type specified by this mapping is then created via the WindowManager.

For info about registering a window type with CEGUI, this post: viewtopic.php?p=14730#p14730 covers the way to do that, though we have vastly simplified this in the upcoming 0.7.0 release.

CE.

Re: About ItemListbox && ItemEntry

Posted: Fri Sep 18, 2009 01:44
by singbol
OK, Thank you so much!