Radiobuttons using multiple LookNFeel graphics
Posted: 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":
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?
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?