Wt::WStackedWidget Class Reference

A container widget that stacks its widgets on top of each other. More...

#include <Wt/WStackedWidget>

Inheritance diagram for Wt::WStackedWidget:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 WStackedWidget (WContainerWidget *parent=0)
 Created a new stacked container widget.
virtual void addWidget (WWidget *widget)
 Adds a child widget to this container.
int count () const
 Returns the number of widgets in the stack.
int currentIndex () const
 Returns the index of the widget that is currently shown.
WWidgetcurrentWidget () const
 Returns the widget that is currently shown.
int indexOf (WWidget *widget) const
 Returns the index of the given widget.
void insertWidget (int index, WWidget *widget)
 Insert a widget at a given index.
virtual void removeWidget (WWidget *widget)
 Removes a child widget from this container.
WWidgetwidget (int index) const
 Returns the widget at the specified index.
void setCurrentIndex (int index)
 Shows a particular widget.
void setCurrentWidget (WWidget *widget)
 Shows a particular widget.


Detailed Description

A container widget that stacks its widgets on top of each other.

This is a container widgets which at all times has only one item visible. The widget accomplishes this using setHidden(bool) on the children.

Using currentIndex() and setCurrentIndex(int index) you can retrieve or set the visible widget.

WStackedWidget, like WContainerWidget, is by default not inline.

CSS

The widget is rendered using an HTML <div> tag and does not provide styling. It can be styled using inline or external CSS as appropriate.

See also:
WMenu

Member Function Documentation

void Wt::WStackedWidget::addWidget ( WWidget widget  )  [virtual]

Adds a child widget to this container.

This is equivalent to passing this container as the parent when constructing the child. The widget is appended to the list of children, and thus also layed-out at the end.

Reimplemented from Wt::WContainerWidget.

int Wt::WStackedWidget::currentIndex (  )  const

Returns the index of the widget that is currently shown.

See also:
setCurrentIndex(), currentWidget()

WWidget * Wt::WStackedWidget::currentWidget (  )  const

Returns the widget that is currently shown.

See also:
setCurrentWidget(), currentIndex()

int Wt::WStackedWidget::indexOf ( WWidget widget  )  const [virtual]

Returns the index of the given widget.

Returns -1 if the widget was not added.

See also:
widget()

Reimplemented from Wt::WContainerWidget.

void Wt::WStackedWidget::removeWidget ( WWidget widget  )  [virtual]

Removes a child widget from this container.

This removes the widget from this container, but does not delete the widget !

Reimplemented from Wt::WContainerWidget.

WWidget * Wt::WStackedWidget::widget ( int  index  )  const [virtual]

Returns the widget at the specified index.

See also:
indexOf()

Reimplemented from Wt::WContainerWidget.

void Wt::WStackedWidget::setCurrentIndex ( int  index  ) 

Shows a particular widget.

The widget with index index is made visible, while all other widgets are invisible.

See also:
currentIndex(), setCurrentWidget()

void Wt::WStackedWidget::setCurrentWidget ( WWidget widget  ) 

Shows a particular widget.

The widget widget, which must have been added before, is made visible, while all other widgets are invisible.

See also:
currentWidget(), setCurrentIndex()


Generated on Fri Mar 26 17:12:07 2010 for Wt by doxygen 1.5.6