Wt: Wt::WFitLayout Class Reference

Wt 3.3.0

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

- Class List
- Class Hierarchy
- Class Members

Public Member Functions
Wt::WFitLayout Class Reference

A layout manager which spans a single widget to all available space. More...

`#include <Wt/WFitLayout>`

Inheritance diagram for Wt::WFitLayout:
[legend]

List of all members.

## Public Member Functions
| WFitLayout (WWidget *parent=0)
| Creates a new fit layout.
virtual void | addItem (WLayoutItem *)
| Adds a layout item.
virtual void | removeItem (WLayoutItem *)
| Removes a layout item (widget or nested layout).
virtual WLayoutItem * | itemAt (int index) const
| Returns the layout item at a specific index.
virtual int | indexOf (WLayoutItem *item) const
| Returns the index of a given item.
virtual int | count () const
| Returns the number of items in this layout.
virtual void | clear ()
| Removes and deletes all child widgets and nested layouts.

## Detailed Description

A layout manager which spans a single widget to all available space.

This layout manager may manage only a single child widget, and sizes that widget so that it uses all space available in the parent.

Note:
  This layout manager is applicable only to Ext::Container container widgets. If you wish to fit widgets within a container widgets, use a WBoxLayout instead (with a single child).

## Member Function Documentation

void Wt::WFitLayout::addItem | ( | WLayoutItem * | item | ) | `[virtual]`

Adds 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.

See also:
  removeItem(WLayoutItem *), addWidget(WWidget *)

Implements Wt::WLayout.

void Wt::WFitLayout::clear | ( |  | ) | `[virtual]`

Removes and deletes all child widgets and nested layouts.

This is similar to WContainerWidget::clear(), with the exception that the layout itself is not deleted.

Implements Wt::WLayout.

int Wt::WFitLayout::count | ( |  | ) | const`[virtual]`

Returns 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.

int Wt::WFitLayout::indexOf | ( | WLayoutItem * | item | ) | const`[virtual]`

Returns the index of a given item.

The default implementation loops over all items, and returns the index for which itemAt(index) equals `item`.

See also:
  itemAt(int) const

Reimplemented from Wt::WLayout.

WLayoutItem * Wt::WFitLayout::itemAt | ( | int | index | ) | const`[virtual]`

Returns the layout item at a specific index.

If there is no item at the `index`, `0` is returned.

See also:
  indexOf(WLayoutItem *) const, count()

Implements Wt::WLayout.

void Wt::WFitLayout::removeItem | ( | WLayoutItem * | item | ) | `[virtual]`

Removes a layout item (widget or nested layout).

See also:
  addItem(WLayoutItem *), removeWidget(WWidget *)

Implements Wt::WLayout.

All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator