Wt  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Public Member Functions | List of all members
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:
Inheritance graph
[legend]

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.
- Public Member Functions inherited from Wt::WLayout
virtual ~WLayout ()
 Destructor.
void addWidget (WWidget *widget)
 Adds the given widget to the layout.
bool removeWidget (WWidget *widget)
 Removes the given widget from the layout.
virtual WWidgetItem * findWidgetItem (WWidget *widget)
 Finds the widget item associated with the given widget.
void setLayoutHint (const std::string &name, const std::string &value)
 Provides a hint to the layout implementation.
virtual WWidget * widget ()
 Returns the widget that is held by this WLayoutItem.
virtual WLayout * layout ()
 Returns the layout that implements this WLayoutItem.
virtual WLayout * parentLayout () const
 Returns the layout in which this item is contained.
WLayoutItemImpl * impl () const
 Returns the implementation for this layout item.
void setContentsMargins (int left, int top, int right, int bottom)
 Set contents margins (in pixels).
void getContentsMargins (int *left, int *top, int *right, int *bottom) const
 Returns the contents margins.
- Public Member Functions inherited from Wt::WLayoutItem
virtual ~WLayoutItem ()
 Destructor.
- Public Member Functions inherited from Wt::WObject
 WObject (WObject *parent=0)
 Create a WObject with a given parent object.
virtual ~WObject ()
 Destructor.
virtual const std::string id () const
 Returns the (unique) identifier for this object.
void setObjectName (const std::string &name)
 Sets an object name.
virtual std::string objectName () const
 Returns the object name.
void resetLearnedSlots ()
 Resets learned stateless slot implementations.
template<class T >
void resetLearnedSlot (void(T::*method)())
 Resets a learned stateless slot implementation.
template<class T >
WStatelessSlot * implementStateless (void(T::*method)())
 Declares a slot to be stateless and learn client-side behaviour on first invocation.
template<class T >
WStatelessSlot * implementStateless (void(T::*method)(), void(T::*undoMethod)())
 Declares a slot to be stateless and learn client-side behaviour in advance.
template<class T >
WStatelessSlot * implementJavaScript (void(T::*method)(), const std::string &jsCode)
 Provides a JavaScript implementation for a method.
void addChild (WObject *child)
 Adds a child object.
virtual void removeChild (WObject *child)
 Removes a child object.
const std::vector< WObject * > & children () const
 Returns the children.
WObject * parent () const
 Returns the parent object.

Additional Inherited Members

- Public Types inherited from Wt::WObject
typedef void(WObject::* Method )()
 Typedef for a WObject method without arguments.
- Protected Member Functions inherited from Wt::WLayout
 WLayout ()
 Create a layout.
void update (WLayoutItem *item=0)
 Update the layout.
void updateAddItem (WLayoutItem *item)
 Update the layout, adding the given layout item.
void updateRemoveItem (WLayoutItem *item)
 Update the layout, remove the given layout item.
void setLayoutInParent (WWidget *parent)
 Set the layout in the parent.
- Static Protected Member Functions inherited from Wt::WObject
static WObject * sender ()
 Returns the sender of the current slot call.

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.


Generated on Mon Aug 25 2014 for the C++ Web Toolkit (Wt) by doxygen 1.8.1.2