RadioButton with Ogre

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

alejo_cadavid
Just popping in
Just popping in
Posts: 8
Joined: Tue Jul 25, 2006 23:57
Location: Colombia
Contact:

RadioButton with Ogre

Postby alejo_cadavid » Fri Jul 28, 2006 12:28

Hi...

I searched some help and coded that:

Code: Select all

CEGUI::RadioButton* sombra1;
CEGUI::RadioButton* sombra2;
sombra1 = (CEGUI::RadioButton*)CEGUI::WindowManager::getSingleton().createWindow("TaharezLook/RadioButton", "S1");
      sombra1->setGroupID(1);
      sombra1->setID(101);
      sombra1->setSelected(true);
      sombra2 = (CEGUI::RadioButton*)CEGUI::WindowManager::getSingleton().createWindow("TaharezLook/RadioButton", "S2");
      sombra2->setGroupID(1);
      sombra2->setID(102);
      sombra2->setSelected(false);


But doesn't work...

How should i create a RadioButton?

Thanks

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Postby Rackle » Fri Jul 28, 2006 13:22

Probably need to provide a position and a dimension. WidgetGalore uses a .layout file which specifies those attributes. If you wish to create widgets via code you should look at the Cegui samples; I think sample #7 might contain what you are looking for.

alejo_cadavid
Just popping in
Just popping in
Posts: 8
Joined: Tue Jul 25, 2006 23:57
Location: Colombia
Contact:

RadioButton with Ogre

Postby alejo_cadavid » Fri Jul 28, 2006 22:53

Thank you so much Rackle..

I created a member crearRadioBoton and works now...

Code: Select all

//metodo para crear un radio boton
   void crearRadioBoton(CEGUI::RadioButton** id, CEGUI::UVector2 P, CEGUI::Size S, CEGUI::String texto, bool EN, bool seleccion, int Grupo, int ID)
   {   //creacion de objeto Radio boton
      *id = (CEGUI::RadioButton*)CEGUI::WindowManager::getSingleton().createWindow("TaharezLook/RadioButton", texto);
      //se agrega el boton a la ventana padre de CEGUI
      mEditorGuiSheet->addChildWindow(*id);
      //posicion de boton
      (*id)->setWindowPosition(P);
      //tamaño de boton
      (*id)->setSize(S);
      //texto en boton
      (*id)->setText(texto);
      //id de grupo
      (*id)->setGroupID(Grupo);
      //id de boton en el grupo
      (*id)->setID(ID);
      //seleccion inicial
      (*id)->setSelected(seleccion);
      //vsibilidad
      (*id)->setVisible(EN);
   }


Return to “Help”

Who is online

Users browsing this forum: No registered users and 11 guests