using a CEGUI::ItemListBox

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

zhk450861222
Just popping in
Just popping in
Posts: 6
Joined: Wed Oct 14, 2009 10:21

using a CEGUI::ItemListBox

Postby zhk450861222 » Wed Oct 14, 2009 10:44

I want to Insert a StaticImage to ItemListbox
But when the picture than listbox boundary
Scroll bars have no reaction (not drag)
where can I find a problem to do
Hope you answer
Thanks

zhk450861222
Just popping in
Just popping in
Posts: 6
Joined: Wed Oct 14, 2009 10:21

Re: using a CEGUI::ItemListBox

Postby zhk450861222 » Wed Oct 14, 2009 11:11

Below is the code:
CEGUI::ItemEntry *rendget = (CEGUI::ItemEntry *) CEGUI::WindowManager::getSingleton().createWindow("WindowsLook/StaticImage",tempPhotoPro);
rendget->setProperty("Image", "set:"+tempPhotoPro+" image:full_image");
rendget->setArea(posi_X,posi_Y,CEGUI::UDim(0,80.0f),CEGUI::UDim(0,80.0f));
rendget->setAlpha(50);
rendget->subscribeEvent(CEGUI::PushButton::EventMouseDoubleClick, CEGUI::Event::Subscriber(&SceneFrameListener::MouseDoubleClickImage, this));
Listbox->addItem(rendget); //Debug error
Listbox->addChildWindow(rendget); //Commissioning is correct, But the scroll bar drag is invalid

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: using a CEGUI::ItemListBox

Postby CrazyEddie » Wed Oct 14, 2009 13:38

Hi,

You can't just cast any old Window to ItemEntry in order that you can add it to the ItemListbox; you can only add 'real' ItemEntry based windows. To embed a StaticImage, you would add the StaticImage to an ItemEntry based window (such as "WindowsLook/ListboxItem") and then add that to the list.

HTH

CE.

zhk450861222
Just popping in
Just popping in
Posts: 6
Joined: Wed Oct 14, 2009 10:21

Re: using a CEGUI::ItemListBox

Postby zhk450861222 » Thu Oct 15, 2009 06:22

Thank your answer
Now can achieve
why the picture show only a list of wide areas?
With setArea won't change display position

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: using a CEGUI::ItemListBox

Postby CrazyEddie » Thu Oct 15, 2009 09:32

Hi,

Well, the "WindowsLook/ListboxItem" was mentioned as an example. In the looknfeel file this is set up to size according to some text and the font assigned; for images you'd need to adjust this to provide more space for the image (perhaps by copying the WidgetLook definition and creating a new ListboxImageItem skin or some such thing).

CE.


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 12 guests