[SOLVED]Tab Control - Need example

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

DozyHole
Not too shy to talk
Not too shy to talk
Posts: 23
Joined: Tue Mar 22, 2011 23:22

[SOLVED]Tab Control - Need example

Postby DozyHole » Thu Jun 09, 2011 22:25

Hi everyone,

I have figured alot of widgets out but I am really struggling with the Tab Control, here is some simple code of what I am trying, although I have tried alot of things but I am either missing something fundamental or I am doing it right and its not working.

Code: Select all

   tabCtrl1 = uiHelper.makeTabControl("tabCtrl1", CEGUI::UDim(0.45, 0), CEGUI::UDim(0.90, 0), CEGUI::UDim(0.025, 0), CEGUI::UDim(0.05, 0));
   tabButton1 = uiHelper.makeTabButton("tabButton1");
   tabButton1->setText("Model ");
   tabButton2 = uiHelper.makeTabButton("tabButton2");
   tabButton2->setText("Camera");

   tabCtrl1->addTab(tabButton1);
   tabCtrl1->addTab(tabButton2);

   button1 = uiHelper.makeButton("button1", CEGUI::UDim(0.2, 0), CEGUI::UDim(0.2, 0), CEGUI::UDim(0.6, 0), CEGUI::UDim(0.2, 0));
   //--HERE, How do I add buttons.sliders etc to each of my tabs?
                tabButton1->addChildWindow(button1);
                rootWindow->addChildWindow(tabCtrl1);


I have a helper class which is working because everything is created, I have a tab control with a couple of tabs sitting on the top, there is a large area to place my widgets but I don't know how to do it.

I can add the button to the root window and that works, so my button code is fine also. I have searched for an example but cant find one.

Thanks for any help,

Matty
Last edited by DozyHole on Mon Jun 13, 2011 20:17, edited 1 time in total.

User avatar
evilBeaver
Just popping in
Just popping in
Posts: 5
Joined: Wed Jun 08, 2011 23:56

Re: Tab Control - Need example

Postby evilBeaver » Fri Jun 10, 2011 08:53

Hi

there is an example in the Cegui sources named 'Samples/Sample_TabControl.cpp' maybe this helps you!

DozyHole
Not too shy to talk
Not too shy to talk
Posts: 23
Joined: Tue Mar 22, 2011 23:22

Re: Tab Control - Need example

Postby DozyHole » Fri Jun 10, 2011 16:41

Thanks evilBeaver, that looks perfect.


Return to “Help”

Who is online

Users browsing this forum: Google [Bot] and 11 guests