TabControl and TabPane

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
EJohnson
Just popping in
Just popping in
Posts: 11
Joined: Fri Jul 01, 2005 03:45
Location: California
Contact:

TabControl and TabPane

Postby EJohnson » Tue Jul 19, 2005 19:05

Howdy. So I'm trying to get the Tab widget working in my app, but having trouble getting widgets to display *in* the TabPanes.


I'm under the assumption I should:
1) Create a TabControl
2) Create TabPanes, calling TabControl->addTab()
3) Create widgets and add them to each TabPane by TabPane->addChildWindow()

The TabControl and TabPanes are being displayed okay, but the widgets in each tab are not. Am I missing something?


Second Question:
The TabControl->addTab() method takes in a Window*, not a TabPane*. Is there a reason for that? Can a TabControl really accept any type of Window?

Thanks for any tips!

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

Re: TabControl and TabPane

Postby CrazyEddie » Wed Jul 20, 2005 08:35

Hi,

You do not need to create the TabPane yourself.

The advised way to do this is to layout your content for each pane on a DeafultWindow, and then simply add the DefaultWindow containing the widgets to the TabControl using the usual addChildWindow method. This will create a new pane within the tab control widget. The name button for the pane is taken from the window that you add (so in this example use setText on the DefaultWindow containing the widgets to whatever you want the button label to be).

User avatar
EJohnson
Just popping in
Just popping in
Posts: 11
Joined: Fri Jul 01, 2005 03:45
Location: California
Contact:

Re: TabControl and TabPane

Postby EJohnson » Thu Jul 21, 2005 00:00

That's the ticket!

1) Create a TabControl
2) Create a DefaultWindow
3) defaultWindow->setText("tab name");
4) Add Windows to the DefaultWindow
5) TabControl->addChildWindow( defaultWindow )
6) repeat as required.

Thanks!


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 14 guests