Wt: Wt::Ext::Container Class Reference

Wt 3.3.0

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

- Class List
- Class Hierarchy
- Class Members

Public Member Functions
Wt::Ext::Container Class Reference

A container class which manages its contents using layout managers. More...

`#include <Wt/Ext/Container>`

Inheritance diagram for Wt::Ext::Container:
[legend]

List of all members.

## Public Member Functions
| Container (WContainerWidget *parent=0)
| Create a new container.
virtual | ~Container ()
| Destroy the container.
void | setLayout (WLayout *layout)
| Set a layout manager for the container.
WLayout * | layout ()
| Get the layout manager that was set for the container.

## Detailed Description

A container class which manages its contents using layout managers.

The Container is the Ext equivalent of WContainerWidget, and manages other widgets. Unlike WContainerWidget, Container can only use layout managers to manage its content.

Typically, panels will be added directly into a layout (which may be part of an Ext::Container or a WContainerWidget), and are components to organize your user interface. You may also add a container inside a plain WContainerWidget, but then you should set a size for the container (using WWidget::resize()), in pixels.

In most cases, using a Panel is more convenient than a Container, since a Panel also manages standard GUI components (such as menu/tool bars), and interactive controls (for resizing, for example). There is however one case where you need to use a Container, which is when you wish to use a layout manager to manage the contents of the entire view port. In that case, you should use a Container to represent the view port, by adding the Container as only child directly to the application's WApplication::root() container.

For example, the following creates a top borderlayout that spans the entire viewport:

     Wt::Ext::Container *rootContainer = new Wt::Ext::Container(app->root());
     Wt::WBorderLayout *topLayout = new Wt::WBorderLayout()
     rootContainer->setLayout(topLayout);

## Constructor & Destructor Documentation

Wt::Ext::Container::Container | ( | WContainerWidget * | parent = `0` | ) |

Create a new container.

When a parent is specified, or the container is after construction added to a WContainerWidget, the container should be given an explicit size in pixels, using WWidget::resize().

## Member Function Documentation

WLayout * Wt::Ext::Container::layout | ( |  | ) | `[virtual]`

Get the layout manager that was set for the container.

If no layout manager was previously set using setLayout(WLayout *), a default layout manager is created (WDefaultLayout), which does not attempt to size widgets to fit the entire container region.

See also:
  setLayout(WLayout *)

Reimplemented from Wt::WWidget.

void Wt::Ext::Container::setLayout | ( | WLayout * | layout | ) | `[virtual]`

Set a layout manager for the container.

Only a single layout manager may be set. Note that you can nest layout managers inside each other, to create a complex layout hierarchy.

See also:
  layout()

Reimplemented from Wt::WWidget.

All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator