a checkbok in a popupmenu from a menubar

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

User avatar
pabloa
Not too shy to talk
Not too shy to talk
Posts: 37
Joined: Mon Oct 03, 2005 09:52

a checkbok in a popupmenu from a menubar

Postby pabloa » Wed Dec 21, 2005 16:13

How do it?

following my intuation I wrote this code, but didnt worked:

Code: Select all

CEGUI::MenuItem* itemv4=(CEGUI::MenuItem*)CEGUI::WindowManager::getSingleton().createWindow("WindowsLook/PopupMenuItem", (CEGUI::utf8*)"v4");
   itemv4->setText("Left");

   popupmview->addChildWindow(itemv4);
   
CEGUI::Checkbox* ckb1=(CEGUI::Checkbox*)CEGUI::WindowManager::getSingleton().createWindow("WindowsLook/Checkbox", (CEGUI::utf8*)"ckb4");
   
   itemv4->addChildWindow(ckb1);


I tried too use only the checkbok neither worked

User avatar
martignasse
Just can't stay away
Just can't stay away
Posts: 227
Joined: Thu Apr 14, 2005 08:10
Location: Lyon, FRANCE

Re: a checkbok in a popupmenu from a menubar

Postby martignasse » Thu Dec 22, 2005 12:00

hi pablloa,

the problem is that the MenuItem isn't herited from Window widget (until the 0.5 version).

You have to make you'r own MenuItem who can deal with a checkbox.

User avatar
martignasse
Just can't stay away
Just can't stay away
Posts: 227
Joined: Thu Apr 14, 2005 08:10
Location: Lyon, FRANCE

Re: a checkbok in a popupmenu from a menubar

Postby martignasse » Thu Dec 22, 2005 14:23

forget my last post... :oops: was hard flying...

For the code you provide, you didn't put position and dimension for you'r checkbox, which is bad.

i suggest you to make you'r own MenuItem class with all the management for the checkbox.


hope it help.


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 3 guests