Wt::WContainerWidget Class Reference

A WWidget that may hold (and manage) children. More...

#include <WContainerWidget>

Inherits Wt::WInteractWidget.

Inherited by Wt::WGroupBox, Wt::WStackedWidget, and Wt::WTableCell.

Inheritance diagram for Wt::WContainerWidget:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 WContainerWidget (WContainerWidget *parent=0)
 Create a container with optional parent.
 ~WContainerWidget ()
 Destruct a WContainerWidget.
virtual void addWidget (WWidget *widget)
 Add a child widget to this container.
virtual void insertWidget (WWidget *widget, WWidget *before)
 insert a child widget in this container, before another widget.
virtual void removeWidget (WWidget *widget)
 Remove a child widget from this container.
void clear ()
 Remove and delete all child widgets.
void setContentAlignment (HorizontalAlignment contentAlignment)
 Specify how child widgets must be aligned within the container.
void setPadding (WLength padding, int sides=All)
 Set padding inside the widget.
WLength padding (Side side) const
 Get the padding set for the widget.
HorizontalAlignment contentAlignment () const
 Get the horizontal alignment of children.
const std::vector< WWidget * > & children () const
 Get the children.

Detailed Description

A WWidget that may hold (and manage) children.

A WContainerWidget acts as a container for child widgets.

By default, a WContainerWidget is stacked and manages its children within a rectangle. When setting the WContainerWidget inline the container only acts as a conceptual container, offering a common style to its children. Inline children are still layed out inline within the flow of the parent container of this container, as if they were inserted directly into that parent container.

FIXME: We still need to provide a method to specify an inline-block, this is a container that itself has an inline layout, but that manages it children in a block.


Member Function Documentation

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

Add 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 in Wt::WStackedWidget.

void Wt::WContainerWidget::clear (  ) 

Remove and delete all child widgets.

This deletes all children that have been added to this container.

HorizontalAlignment Wt::WContainerWidget::contentAlignment (  )  const [inline]

Get the horizontal alignment of children.

See also:
setContentAlignment(HorizontalAlignment)

Reimplemented in Wt::WTableCell.

void Wt::WContainerWidget::insertWidget ( WWidget widget,
WWidget before 
) [virtual]

insert a child widget in this container, before another widget.

The widget is inserted into the list of children right before another widget that is already inserted in this container widget.

WLength Wt::WContainerWidget::padding ( Side  side  )  const

Get the padding set for the widget.

See also:
setPadding(WLength padding, Side sides);

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

Remove a child widget from this container.

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

Reimplemented in Wt::WStackedWidget.

void Wt::WContainerWidget::setContentAlignment ( HorizontalAlignment  contentAlignment  ) 

Specify how child widgets must be aligned within the container.

Specify the horizontal alignment of child widgets. Note that there is no way to specify vertical alignment: children are always pushed to the top of the container. Only in a WTableCell, there is a method to align the children vertically.

void Wt::WContainerWidget::setPadding ( WLength  padding,
int  sides = All 
)

Set padding inside the widget.

Setting padding has the effect of adding distance between the widget children and the border.


The documentation for this class was generated from the following files:
Generated on Sun Jul 1 19:37:18 2007 for Wt by doxygen 1.4.7