libsuit  0.1.1
SFML User Interface Toolkit
Public Member Functions | List of all members
ui::Stack Class Reference

A stack widget. More...

#include <ui/Stack.h>

Inheritance diagram for ui::Stack:
Inheritance graph
[legend]

Public Member Functions

virtual ~Stack ()
 
void addChild (Widget *widget)
 Add a child to the stack. More...
 
void removeChild ()
 Remove the top child. More...
 
bool hasChildren () const
 Tell whether the stack has children. More...
 
WidgetgetTopChild ()
 Get the top child. More...
 
virtual void onClick (sf::Mouse::Button button, const sf::Vector2f &mouse) override
 Do something when the widget is clicked. More...
 
virtual void layoutRequest () override
 Compute the size hint of the widget. More...
 
virtual void layoutAllocation () override
 Compute the size of the widget. More...
 
virtual void accept (WidgetVisitor &visitor) override
 Accept the visitor. More...
 
- Public Member Functions inherited from ui::Widget
 Widget ()
 Construct a widget. More...
 
 Widget (const Widget &)=delete
 
Widgetoperator= (const Widget &)=delete
 
 Widget (Widget &&)=delete
 
Widgetoperator= (Widget &&)=delete
 
virtual ~Widget ()
 Destroy a widget. More...
 
void setSizeHint (float width, float height)
 Set the size hint of the widget. More...
 
sf::Vector2f getSizeHint () const
 Get the size hint of the widget. More...
 
void setHorizontalPolicy (SizePolicy policy)
 Set the horizontal size policy. More...
 
void setVerticalPolicy (SizePolicy policy)
 Set the vertical size policy. More...
 
void setSizePolicy (SizePolicy horizontal, SizePolicy vertical)
 Set the size policy. More...
 
void setHorizontalAlignment (Alignment alignment)
 Set the horizontal alignment policy. More...
 
void setVerticalAlignment (Alignment alignment)
 Set the vertical alignment policy. More...
 
const GeometrygetHorizontalGeometry () const
 Get the horizontal geometry. More...
 
GeometrygetHorizontalGeometry ()
 Get the horizontal geometry. More...
 
const GeometrygetVerticalGeometry () const
 Get the vertical geometry. More...
 
GeometrygetVerticalGeometry ()
 Get the vertical geometry. More...
 
void setGeometry (const sf::FloatRect &geometry)
 Set the vertical geometry thanks to a rectangle. More...
 
const sf::FloatRect getGeometry () const
 Get the geometry of the widget. More...
 
sf::Vector2f getCenter () const
 Get the center of the widget. More...
 
virtual void onPrimaryAction ()
 Do something if a primary action has been triggered. More...
 
virtual void onSecondaryAction ()
 Do something if a secondary action has been triggered. More...
 

Detailed Description

A stack widget.

A stack widget is a collection of widgets in which only one is visible.

Constructor & Destructor Documentation

virtual ui::Stack::~Stack ( )
virtual

Member Function Documentation

virtual void ui::Stack::accept ( WidgetVisitor visitor)
overridevirtual

Accept the visitor.

Parameters
visitorthe visitor.

Implements ui::Widget.

Reimplemented in ui::Area.

void ui::Stack::addChild ( Widget widget)
inline

Add a child to the stack.

Parameters
widgetthe new child
Widget* ui::Stack::getTopChild ( )
inline

Get the top child.

Returns
the top child.
bool ui::Stack::hasChildren ( ) const
inline

Tell whether the stack has children.

Returns
true if the stack has children.
virtual void ui::Stack::layoutAllocation ( )
overridevirtual

Compute the size of the widget.

The computation of the size takes into account the size of the parent of the widget. This is a top-down process.

Implements ui::Widget.

virtual void ui::Stack::layoutRequest ( )
overridevirtual

Compute the size hint of the widget.

The computation of the size hint takes into account the size of the children of the widget. This is a bottom-up process.

Implements ui::Widget.

virtual void ui::Stack::onClick ( sf::Mouse::Button  button,
const sf::Vector2f &  mouse 
)
overridevirtual

Do something when the widget is clicked.

Reimplemented from ui::Widget.

void ui::Stack::removeChild ( )
inline

Remove the top child.