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
using a CEGUI::ItemListBox
Moderators: CEGUI MVP, CEGUI Team
-
- Just popping in
- Posts: 6
- Joined: Wed Oct 14, 2009 10:21
Re: using a CEGUI::ItemListBox
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
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
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: using a CEGUI::ItemListBox
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.
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.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
-
- Just popping in
- Posts: 6
- Joined: Wed Oct 14, 2009 10:21
Re: using a CEGUI::ItemListBox
Thank your answer
Now can achieve
why the picture show only a list of wide areas?
With setArea won't change display position
Now can achieve
why the picture show only a list of wide areas?
With setArea won't change display position
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: using a CEGUI::ItemListBox
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.
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.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Return to “Modifications / Integrations / Customisations”
Who is online
Users browsing this forum: No registered users and 10 guests