Wt
4.11.0
|
A layout manager which arranges widgets vertically. More...
#include <Wt/WVBoxLayout.h>
Public Member Functions | |
WVBoxLayout () | |
Create a new vertical box layout. | |
Public Member Functions inherited from Wt::WBoxLayout | |
WBoxLayout (LayoutDirection dir) | |
Creates a new box layout. | |
virtual void | addItem (std::unique_ptr< WLayoutItem > item) override |
Adds a layout item. | |
virtual std::unique_ptr< WLayoutItem > | removeItem (WLayoutItem *item) override |
Removes a layout item (widget or nested layout). | |
virtual WLayoutItem * | itemAt (int index) const override |
Returns the layout item at a specific index. | |
virtual int | count () const override |
Returns the number of items in this layout. | |
void | setDirection (LayoutDirection direction) |
Sets the layout direction. | |
LayoutDirection | direction () const |
Returns the layout direction. | |
void | setSpacing (int size) |
Sets spacing between each item. | |
int | spacing () const |
Returns the spacing between each item. | |
void | addWidget (std::unique_ptr< WWidget > widget, int stretch, WFlags< AlignmentFlag > alignment) |
Adds a widget to the layout. | |
template<typename Widget > | |
Widget * | addWidget (std::unique_ptr< Widget > widget, int stretch=0, WFlags< AlignmentFlag > alignment=None) |
Adds a widget to the layout, returning a raw pointer. | |
void | addLayout (std::unique_ptr< WLayout > layout, int stretch, WFlags< AlignmentFlag > alignment) |
Adds a nested layout to the layout. | |
template<typename Layout > | |
Layout * | addLayout (std::unique_ptr< Layout > layout, int stretch=0, WFlags< AlignmentFlag > alignment=None) |
void | addSpacing (const WLength &size) |
Adds extra spacing. | |
void | addStretch (int stretch=0) |
Adds a stretch element. | |
void | insertWidget (int index, std::unique_ptr< WWidget > widget, int stretch=0, WFlags< AlignmentFlag > alignment=None) |
Inserts a widget in the layout. | |
template<typename Widget > | |
Widget * | insertWidget (int index, std::unique_ptr< Widget > widget, int stretch=0, WFlags< AlignmentFlag > alignment=None) |
Inserts a widget in the layout, returning a raw pointer. | |
void | insertLayout (int index, std::unique_ptr< WLayout > layout, int stretch=0, WFlags< AlignmentFlag > alignment=None) |
Inserts a nested layout in the layout. | |
template<typename Layout > | |
Layout * | insertLayout (int index, std::unique_ptr< Layout > layout, int stretch=0, WFlags< AlignmentFlag > alignment=None) |
void | insertSpacing (int index, const WLength &size) |
Inserts extra spacing in the layout. | |
void | insertStretch (int index, int stretch=0) |
Inserts a stretch element in the layout. | |
bool | setStretchFactor (WLayout *layout, int stretch) |
Sets the stretch factor for a nested layout. | |
bool | setStretchFactor (WWidget *widget, int stretch) |
Sets the stretch factor for a widget. | |
void | setResizable (int index, bool enabled=true, const WLength &initialSize=WLength::Auto) |
Sets whether the use may drag a particular border. | |
bool | isResizable (int index) const |
Returns whether the user may drag a particular border. | |
Public Member Functions inherited from Wt::WLayout | |
virtual | ~WLayout () |
Destructor. | |
void | setPreferredImplementation (LayoutImplementation implementation) |
Set the preferred layout implementation. | |
void | addWidget (std::unique_ptr< WWidget > widget) |
Adds the given widget to the layout. | |
std::unique_ptr< WWidget > | removeWidget (WWidget *widget) |
Removes the given widget from the layout. | |
virtual int | indexOf (WLayoutItem *item) const |
Returns the index of a given item. | |
virtual WWidgetItem * | findWidgetItem (WWidget *widget) override |
Finds the widget item associated with the given widget. | |
virtual WWidget * | widget () override |
Returns the widget that is held by this WLayoutItem. | |
virtual WLayout * | layout () override |
Returns the layout that implements this WLayoutItem. | |
virtual WLayout * | parentLayout () const override |
Returns the layout in which this item is contained. | |
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 | |
void | addChild (std::unique_ptr< WObject > child) |
Add a child WObject whose lifetime is determined by this WObject. | |
template<typename Child > | |
Child * | addChild (std::unique_ptr< Child > child) |
Add a child WObject, returning a raw pointer. | |
std::unique_ptr< WObject > | removeChild (WObject *child) |
Remove a child WObject, so its lifetime is no longer determined by this WObject. | |
template<typename Child > | |
std::unique_ptr< Child > | removeChild (Child *child) |
Remove a child WObject, so its lifetime is no longer determined by this WObject. | |
virtual const std::string | id () const |
Returns the (unique) identifier for this object. | |
virtual 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. | |
void | isNotStateless () |
Marks the current function as not stateless. | |
template<class T > | |
WStatelessSlot * | implementJavaScript (void(T::*method)(), const std::string &jsCode) |
Provides a JavaScript implementation for a method. | |
Public Member Functions inherited from Wt::Core::observable | |
observable () noexcept | |
Default constructor. | |
virtual | ~observable () |
Destructor. | |
template<typename... Args, typename C > | |
auto | bindSafe (void(C::*method)(Args...)) noexcept |
Protects a method call against object destruction. | |
template<typename... Args, typename C > | |
auto | bindSafe (void(C::*method)(Args...) const) const noexcept |
Protects a const method call against object destruction. | |
template<typename Function > | |
auto | bindSafe (const Function &function) noexcept |
Protects a function against object destruction. | |
Additional Inherited Members | |
Public Types inherited from Wt::WObject | |
typedef void(WObject::* | Method) () |
Typedef for a WObject method without arguments. | |
Static Public Member Functions inherited from Wt::WLayout | |
static void | setDefaultImplementation (LayoutImplementation implementation) |
Sets the preferred layout implementation globally. | |
Protected Member Functions inherited from Wt::WLayout | |
WLayout () | |
Create a layout. | |
void | update (WLayoutItem *item=nullptr) |
Update the layout. | |
Protected Member Functions inherited from Wt::WObject | |
virtual WStatelessSlot * | getStateless (Method method) |
On-demand stateless slot implementation. | |
A layout manager which arranges widgets vertically.
This convenience class creates a vertical box layout, laying contained widgets out from top to bottom.
See WBoxLayout for available member methods and more information.
Usage example: