#include <WLayout>
Public Member Functions | |
virtual | ~WLayout () |
Destroy the layout. | |
virtual void | addItem (WLayoutItem *item)=0 |
Add a layout item. | |
void | addWidget (WWidget *widget) |
Add the given widget to the layout. | |
virtual void | removeItem (WLayoutItem *item)=0 |
Remove a layout item (widget or nested layout). | |
void | removeWidget (WWidget *widget) |
Remove the given widget from the layout. | |
virtual int | count () const =0 |
Return the number of items in this layout. | |
virtual WLayoutItem * | itemAt (int index) const =0 |
Return the layout item at a specific index. | |
virtual int | indexOf (WLayoutItem *item) const =0 |
Return the index of a given item. | |
virtual WWidgetItem * | findWidgetItem (WWidget *widget) |
Finds the widget item associated with the given widget. | |
virtual WWidget * | widget () |
Get the widget that is held by this WLayoutItem. | |
virtual WLayout * | layout () |
Get the layout that implements this WLayoutItem. | |
WLayoutItemImpl * | impl () const |
Get the implementation for this layout item. | |
Protected Member Functions | |
WLayout () | |
Create a layout. | |
void | addLayoutItem (WLayoutItem *item) |
Add the given layout item. | |
void | removeLayoutItem (WLayoutItem *item) |
Remove the given layout item. | |
void | setLayoutInParent (WWidget *parent) |
Set the layout in the parent. |
This class is the abstract base class for any layout manager. A layout manager is associated with a container widget, and manages the layout of children inside the container widget.
Currently, only Ext::Container supports the use of layout managers, but not yet WContainerWidget.
The implementation of the layout manager depends on the container widget to which it is set, and is therefore deferred to WLayoutImpl.
A layout never assumes ownership of contained items, instead these are owned by the parent widget to which the layout is applied.
virtual void Wt::WLayout::addItem | ( | WLayoutItem * | item | ) | [pure virtual] |
Add a layout item.
The item may be a widget or nested layout.
How the item is layed out with respect to siblings is implementation specific to the layout manager. In some cases, a layout manager will overload this method with extra arguments that specify layout options.
Implemented in Wt::WBorderLayout, Wt::WDefaultLayout, and Wt::WFitLayout.
void Wt::WLayout::addWidget | ( | WWidget * | widget | ) |
Add the given widget to the layout.
This method wraps the widget in a WWidgetItem and calls addItem(WLayoutItem *).
How the widget is layed out with respect to siblings is implementation specific to the layout manager. In some cases, a layout manager will overload this method with extra arguments that specify layout options.
virtual void Wt::WLayout::removeItem | ( | WLayoutItem * | item | ) | [pure virtual] |
Remove a layout item (widget or nested layout).
Implemented in Wt::WBorderLayout, Wt::WDefaultLayout, and Wt::WFitLayout.
void Wt::WLayout::removeWidget | ( | WWidget * | widget | ) |
Remove the given widget from the layout.
This method finds the corresponding WWidgetItem and calls removeItem(WLayoutItem *). The widget itself is not destroyed.
virtual WLayoutItem* Wt::WLayout::itemAt | ( | int | index | ) | const [pure virtual] |
Return the layout item at a specific index.
Implemented in Wt::WBorderLayout, Wt::WDefaultLayout, and Wt::WFitLayout.
virtual int Wt::WLayout::indexOf | ( | WLayoutItem * | item | ) | const [pure virtual] |
Return the index of a given item.
Implemented in Wt::WBorderLayout, Wt::WDefaultLayout, and Wt::WFitLayout.
virtual WWidget* Wt::WLayout::widget | ( | ) | [inline, virtual] |
Get the widget that is held by this WLayoutItem.
This implements a type-safe upcasting mechanism to a WWidgetItem.
Implements Wt::WLayoutItem.
virtual WLayout* Wt::WLayout::layout | ( | ) | [inline, virtual] |
Get the layout that implements this WLayoutItem.
This implements a type-safe upcasting mechanism to a WLayout.
Implements Wt::WLayoutItem.
WLayoutItemImpl* Wt::WLayout::impl | ( | ) | const [inline, virtual] |
Get the implementation for this layout item.
The implementation of a layout item depends on the kind of container for which the layout does layout management.
Implements Wt::WLayoutItem.
void Wt::WLayout::addLayoutItem | ( | WLayoutItem * | item | ) | [protected] |
Add the given layout item.
Must be called from the implementation of addItem(WLayoutItem *)
void Wt::WLayout::removeLayoutItem | ( | WLayoutItem * | item | ) | [protected] |
Remove the given layout item.
Must be called from the implementation of removeItem(WLayoutItem *)
void Wt::WLayout::setLayoutInParent | ( | WWidget * | parent | ) | [protected] |