libsuit
0.1.1
SFML User Interface Toolkit
|
An element of the graphical interface. More...
#include <ui/Widget.h>
Public Member Functions | |
Widget () | |
Construct a widget. More... | |
Widget (const Widget &)=delete | |
Widget & | operator= (const Widget &)=delete |
Widget (Widget &&)=delete | |
Widget & | operator= (Widget &&)=delete |
virtual | ~Widget () |
Destroy a widget. More... | |
virtual void | accept (WidgetVisitor &visitor)=0 |
Accept the visitor. More... | |
Geometry | |
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 Geometry & | getHorizontalGeometry () const |
Get the horizontal geometry. More... | |
Geometry & | getHorizontalGeometry () |
Get the horizontal geometry. More... | |
const Geometry & | getVerticalGeometry () const |
Get the vertical geometry. More... | |
Geometry & | getVerticalGeometry () |
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... | |
Interactions | |
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... | |
virtual void | onClick (sf::Mouse::Button button, const sf::Vector2f &mouse) |
Do something when the widget is clicked. More... | |
Layout | |
virtual void | layoutRequest ()=0 |
Compute the size hint of the widget. More... | |
virtual void | layoutAllocation ()=0 |
Compute the size of the widget. More... | |
An element of the graphical interface.
|
inline |
Construct a widget.
|
delete |
|
delete |
|
virtual |
Destroy a widget.
|
pure virtual |
Accept the visitor.
visitor | the visitor. |
Implemented in ui::Table, ui::Select, ui::Stack, ui::Area, ui::Form, ui::Button, ui::Bin, ui::Toggle, ui::Label, ui::HBox, and ui::VBox.
|
inline |
Get the center of the widget.
|
inline |
Get the geometry of the widget.
|
inline |
Get the horizontal geometry.
|
inline |
Get the horizontal geometry.
|
inline |
Get the size hint of the widget.
|
inline |
Get the vertical geometry.
|
inline |
Get the vertical geometry.
|
pure virtual |
|
pure virtual |
|
virtual |
Do something when the widget is clicked.
Reimplemented in ui::Container, ui::Select, ui::Stack, ui::Button, ui::Bin, and ui::Toggle.
|
virtual |
Do something if a primary action has been triggered.
Reimplemented in ui::Select, ui::Area, ui::Toggle, ui::Button, and ui::Bin.
|
virtual |
Do something if a secondary action has been triggered.
Reimplemented in ui::Select, ui::Area, and ui::Bin.
|
inline |
Set the vertical geometry thanks to a rectangle.
geometry | the rectangle describing the geometry. |
|
inline |
Set the horizontal alignment policy.
alignment | the alignment policy. |
|
inline |
Set the horizontal size policy.
policy | the size policy. |
|
inline |
Set the size hint of the widget.
width | the desired width |
height | the desired height |
|
inline |
Set the size policy.
horizontal | the horizontal size policy. |
vertical | the vertical size policy. |
|
inline |
Set the vertical alignment policy.
alignment | the alignment policy. |
|
inline |
Set the vertical size policy.
policy | the size policy. |