#include <Wt/WBorderLayout>
Public Types | |
enum | Position { North, East, South, West, Center } |
Enumeration of possible positions in the layout. More... | |
Public Member Functions | |
WBorderLayout (WWidget *parent=0) | |
Create a new border layout. | |
~WBorderLayout () | |
Remove a border layout. | |
virtual void | addItem (WLayoutItem *item) |
Add a layout item. | |
virtual void | removeItem (WLayoutItem *item) |
Remove a layout item (widget or nested layout). | |
virtual WLayoutItem * | itemAt (int index) const |
Return the layout item at a specific index. | |
virtual int | count () const |
Return the number of items in this layout. | |
void | addWidget (WWidget *widget, Position position) |
Add a widget to the given position. | |
void | add (WLayoutItem *item, Position position) |
Add a layout item to the given position. | |
WWidget * | widgetAt (Position position) const |
Return the widget at a position. | |
WLayoutItem * | itemAt (Position position) const |
Return the item at a position. | |
Position | position (WLayoutItem *item) const |
Return the position at which the given layout item is set. |
The five regions are composed of:
------------------------------------ | North | ------------------------------------ | | | | | West | Center | East | | | | | ------------------------------------ | South | ------------------------------------
Each region may hold no more than one widget, and for all but the Center region, the widget is optional.
Widgets in the North and South regions need to have The Center widget takes all available remaining space.
This layout manager is applicable to WContainerWidget or Ext::Container container widgets. They use different properties from the widgets to determine the heights for the border panes:
void Wt::WBorderLayout::addItem | ( | WLayoutItem * | item | ) | [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.
Implements Wt::WLayout.
void Wt::WBorderLayout::removeItem | ( | WLayoutItem * | item | ) | [virtual] |
WLayoutItem * Wt::WBorderLayout::itemAt | ( | int | index | ) | const [virtual] |
Return the layout item at a specific index.
If there is no item at the index, 0 is returned.
Implements Wt::WLayout.
int Wt::WBorderLayout::count | ( | ) | const [virtual] |
Return the number of items in this layout.
This may be a theoretical number, which is greater than the actual number of items. It can be used to iterate over the items in the layout, in conjunction with itemAt().
Implements Wt::WLayout.
Add a widget to the given position.
Only one widget per position is supported.
void Wt::WBorderLayout::add | ( | WLayoutItem * | item, | |
Position | position | |||
) |
Add a layout item to the given position.
Only one widget per position is supported.
Return the widget at a position.
Returns 0 if no widget was set for that position.
WLayoutItem * Wt::WBorderLayout::itemAt | ( | Position | position | ) | const |
Return the item at a position.
Returns 0 if no item was set for that position.