Wt: Wt::Ext::Splitter Class Reference

Wt 3.3.0

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

- Class List
- Class Hierarchy
- Class Members

Public Member Functions
Wt::Ext::Splitter Class Reference
Ext widgets (Wt::Ext, deprecated)

A container widget with resize handles between its children. More...

`#include <Wt/Ext/Splitter>`

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

List of all members.

## Public Member Functions
| Splitter (WContainerWidget *parent=0)
| Create a new horizontal splitter.
| Splitter (Orientation orientation, WContainerWidget *parent=0)
| Create a new splitter with the given orientation.
void | setOrientation (Orientation orientation)
| Set the orientation.
Orientation | orientation () const
| Return the orientation.
void | setHandleWidth (int width)
| Set the width of the resize handles (in pixels).
int | handleWidth () const
| Return the width of the resize handles.
SplitterHandle * | handle (int index) const
| Returns the handle to the left (or above) the widget at the given index.
virtual void | addWidget (WWidget *widget)
| Adds a child widget to this container.
virtual void | insertWidget (int index, WWidget *widget)
| Inserts a child widget in this container at given index.
virtual void | insertBefore (WWidget *widget, WWidget *before)
| Inserts a child widget in this container, before another widget.
const std::vector< WWidget * > & | children () const
| Returns contained widgets.

## Detailed Description

A container widget with resize handles between its children.

Provides a container in which widgets are laid out either horizontally (side by side, Horizontal orientation), or vertically (Vertical orientation).

Widgets are separated by a SplitterHandle which the user may use to resize widgets. For this to work properly, you need to properly specify widths, and minimum- and maximum widths for the widgets:

- They MUST have their width (or height) set using WWidget::resize(), in WLength::Pixel units. You cannot specify the size through CSS!

- Optionally, the may have a minimum width (or minimum height) set using WWidget::setMinimumSize() and WWidget::setMaximumSize(). Again, you cannot specify these properties through CSS!

- Probably you will want to insert each widget in a WScrollArea, or set the CSS overflow attribute to hidden (which clips anything that goes outside) or auto (to add scroll bars).

Note: removing or adding widgets after initial render is not yet supported.

## Member Function Documentation

void Wt::Ext::Splitter::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.

const std::vector<WWidget *>& Wt::Ext::Splitter::children | ( |  | ) | const

Returns contained widgets.

See also:
  WContainerWidget::addWidget()

Reimplemented from Wt::WWebWidget.

SplitterHandle * Wt::Ext::Splitter::handle | ( | int | index | ) | const

Returns the handle to the left (or above) the widget at the given index.

There is no handle to the left of the widget at index 0, and 0 will be returned.

int Wt::Ext::Splitter::handleWidth | ( |  | ) | const

Return the width of the resize handles.

The default width is 4 pixels.

See also:
  setHandleWidth()

void Wt::Ext::Splitter::insertBefore | ( | WWidget * | widget,
|  | WWidget * | before
| ) |  | `[virtual]`

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

The widget is inserted at the place of the `before` widget, and subsequent widgets are shifted.

See also:
  insertWidget(int index, WWidget *widget);

Reimplemented from Wt::WContainerWidget.

void Wt::Ext::Splitter::insertWidget | ( | int | index,
|  | WWidget * | widget
| ) |  | `[virtual]`

Inserts a child widget in this container at given index.

The widget is inserted at the given `index`, and subsequent widgets are shifted.

See also:
  insertBefore(WWidget *widget, WWidget *before);

Reimplemented from Wt::WContainerWidget.

void Wt::Ext::Splitter::setHandleWidth | ( | int | width | ) |

Set the width of the resize handles (in pixels).

The default width is 4 pixels.

See also:
  handleWidth()

All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator