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?