Radiobuttons using multiple LookNFeel graphics

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

User avatar
paperpusher
Just popping in
Just popping in
Posts: 8
Joined: Fri Mar 12, 2010 22:35

Radiobuttons using multiple LookNFeel graphics

Postby paperpusher » Tue Apr 13, 2010 17:05

I am trying to make a bunch of windows that will all look different, but be members of the same group. I tried to do the following, but the individual windows were operating as if they were the memebers of their own group, and not "working together":

Code: Select all

CEGUI::RadioButton* bTest = (CEGUI::RadioButton *)CEGUI::WindowManager::getSingleton().createWindow( "MyLook/Checkbox_A", "cmdTest" );
bTest->setGroupID(1);
bTest->setPosition(UVector2(UDim(0.3f, 0), UDim(0.2f, 0)));
bTest->setSize(UVector2(UDim(0.153f, 0), UDim(0.225f, 0)));
pLayout->addChildWindow(bTest);

CEGUI::RadioButton* bTest2 = (CEGUI::RadioButton *)CEGUI::WindowManager::getSingleton().createWindow( "MyLook/Checkbox_B", "cmdTest2" );
bTest2->setGroupID(1);
bTest2->setPosition(UVector2(UDim(0.5f, 0), UDim(0.2f, 0)));
bTest2->setSize(UVector2(UDim(0.153f, 0), UDim(0.225f, 0)));
pLayout->addChildWindow(bTest2);

CEGUI::RadioButton* bTest3 = (CEGUI::RadioButton *)CEGUI::WindowManager::getSingleton().createWindow( "MyLook/Checkbox_C", "cmdTest3" );
bTest3->setGroupID(1);
bTest3->setPosition(UVector2(UDim(0.7f, 0), UDim(0.2f, 0)));
bTest3->setSize(UVector2(UDim(0.153f, 0), UDim(0.225f, 0)));
pLayout->addChildWindow(bTest3);


As you can see from the above code, my original thought was to use checkboxes and then use code to link them as radiobuttons. The reason I stopped that course of logic was that I could not determine a good way to tell the listener which checkbox was checked. I will have a dynamic number of radiobuttons so I need the event listener to be the same for all the buttons. This listener will then perform the correct action based on which button made the call.

If different looking radio buttons cannot be members of the same group, how do you tell a checkbox event listener what checkbox is being used?

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

Re: Radiobuttons using multiple LookNFeel graphics

Postby CrazyEddie » Thu Apr 15, 2010 08:39

You should have posted your log, then I wouldn't have had to ask the following question (are you guys catching on to this yet?! :))

What is the target type that the types "MyLook/Checkbox_*" are mapped to? The fact it says checkbox in the type name leads me to assume it's CEGUI/Checkbox, which means you can't cast to CEGUI::RadioButton and have any kind of success ;) If this is the case, you need to ensure that the radio buttons really are radio buttons and not check boxes.

CE.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 2 guests