Wt::WTabWidget Class Reference

A widget that organizes contents in tab panes. More...

#include <Wt/WTabWidget>

Inheritance diagram for Wt::WTabWidget:

Inheritance graph
[legend]

List of all members.

Public Types

enum  LoadPolicy { LazyLoading, PreLoading }
 When should the contents be loaded ? More...

Public Member Functions

 WTabWidget (WContainerWidget *parent=0)
 Create a new WTabWidget.
void addTab (WWidget *child, const WString &label, LoadPolicy=LazyLoading)
 Add a new tab, with child as content, and the given label.
int count () const
 Return the number of tabs.
WWidgetwidget (int index) const
 Get the content widget at the given tab index.
int indexOf (WWidget *widget) const
 Get the index of the given widget.
void setCurrentIndex (int index)
 Activate the tab at index.
int currentIndex () const
 Get the index of the activated tab.
void setCurrentWidget (WWidget *widget)
 Activate the tab showing the given widget.
WWidgetcurrentWidget () const
 Get the widget of the activated tab.
void setTabEnabled (int index, bool enable)
 Enable or disable a tab.
bool isTabEnabled (int index) const
 Returns if a tab is enabled.
void setTabHidden (int index, bool hidden)
 Hide or show a tab.
bool isTabHidden (int index) const
 Return if a tab is hidden.
void setTabText (int index, const WString &label)
 Change the label for a tab.
const WStringtabText (int index) const
 Get the label for a tab.
void setTabToolTip (int index, const WString &tip)
 Set the tooltip for a tab.
const WStringtabToolTip (int index) const
 Get the tooltip for a tab.
void enableBrowserHistory (const std::string &id)
 Make the tabs react to browser history.
const std::string & browserHistoryId () const
 Get the browser history key for this tab widget.

Public Attributes

Signal< int > currentChanged
 Signal emitted when the user activates a tab.


Detailed Description

A widget that organizes contents in tab panes.

This widget combines a horizontal WMenu with a WStackedWidget, and a tab-like look.

This widget uses the following resources:

These files may be found in the resources/ folder of the Wt distribution.

The default value for resourcesURL is "resources/". This value may be overridden with any valid URL which points to the location where these files may be found, by configuring the resourcesURL property in your Wt configuration file.

WTabWidget-1.png

An example WTabWidget


Member Enumeration Documentation

enum Wt::WTabWidget::LoadPolicy

When should the contents be loaded ?

Enumerator:
LazyLoading  Lazy loading: on first use.
PreLoading  Pre-loading: before first use.


Member Function Documentation

int Wt::WTabWidget::indexOf ( WWidget widget  )  const

Get the index of the given widget.

If the widget is not in this tab widget, then -1 is returned.

void Wt::WTabWidget::setTabEnabled ( int  index,
bool  enable 
)

Enable or disable a tab.

Enables or disables the tab at index. A disabled tab cannot be activated.

void Wt::WTabWidget::setTabHidden ( int  index,
bool  hidden 
)

Hide or show a tab.

Hides are shows the tab at index.

void Wt::WTabWidget::setTabToolTip ( int  index,
const WString tip 
)

Set the tooltip for a tab.

The tooltip is shown when the user hovers over the label.

void Wt::WTabWidget::enableBrowserHistory ( const std::string &  id  ) 

Make the tabs react to browser history.

The id must be an application-wide unique id that identifies this menu.

const std::string & Wt::WTabWidget::browserHistoryId (  )  const

Get the browser history key for this tab widget.

Returns an empty string if browser history was not previously enabled with enableBrowserHistory()


Member Data Documentation

Signal<int> Wt::WTabWidget::currentChanged

Signal emitted when the user activates a tab.

The index of the newly activated tab is passed as an argument.


Generated on Fri Jul 25 17:56:38 2008 for Wt by doxygen 1.5.3