Class to store the left, top, width or height of a widget.
More...
#include <TGUI/Layout.hpp>
|
enum class | Operation {
Value
, Plus
, Minus
, Multiplies
,
Divides
, Minimum
, Maximum
, BindingPosX
,
BindingPosY
, BindingLeft
, BindingTop
, BindingWidth
,
BindingHeight
, BindingInnerWidth
, BindingInnerHeight
, BindingString
} |
| The operation which the layout has to perform to find its value.
|
|
|
| Layout ()=default |
| Default constructor.
|
|
template<typename T , typename = typename std::enable_if_t<std::is_arithmetic<T>::value, T>> |
| Layout (T constant) |
| Constructor to implicitly construct from numeric constant.
|
|
| Layout (RelativeValue ratio) |
| Constructs the layout from a ratio relative to the parent size.
|
|
| Layout (const char *expression) |
| Constructs the layout based on a string which will be parsed to determine the value of the layout.
|
|
| Layout (String expression) |
| Constructs the layout based on a string which will be parsed to determine the value of the layout.
|
|
| Layout (Operation operation, Widget *boundWidget) |
|
| Layout (Operation operation, std::unique_ptr< Layout > leftOperand, std::unique_ptr< Layout > rightOperand) |
|
| Layout (const Layout &other) |
| Copy constructor.
|
|
| Layout (Layout &&other) noexcept |
| Move constructor.
|
|
Layout & | operator= (const Layout &other) |
| Copy assignment operator.
|
|
Layout & | operator= (Layout &&other) noexcept |
| Move assignment operator.
|
|
| ~Layout () |
| Destructor.
|
|
void | replaceValue (const Layout &value) |
| Replaces the value of the layout without overwriting its parent.
|
|
float | getValue () const |
| Return the cached value of the layout.
|
|
bool | isConstant () const |
| Return whether the layout stores a constant value.
|
|
String | toString () const |
|
void | connectWidget (Widget *widget, bool xAxis, std::function< void()> valueChangedCallbackHandler) |
|
void | unbindWidget () |
|
void | recalculateValue () |
|
Layout * | getLeftOperand () const |
|
Layout * | getRightOperand () const |
|
Class to store the left, top, width or height of a widget.
You don't have to create an instance of this class, numbers are implicitly cast to this class.
◆ Layout() [1/4]
template<typename T , typename = typename std::enable_if_t<std::is_arithmetic<T>::value, T>>
tgui::Layout::Layout |
( |
T | constant | ) |
|
|
inline |
Constructor to implicitly construct from numeric constant.
- Parameters
-
constant | Value of the layout |
◆ Layout() [2/4]
Constructs the layout from a ratio relative to the parent size.
- Parameters
-
ratio | Ratio to the size of the parent widget |
Layout(RelativeValue(0.3f)) is equivalent to Layout("30%")
◆ Layout() [3/4]
tgui::Layout::Layout |
( |
const char * | expression | ) |
|
|
inline |
Constructs the layout based on a string which will be parsed to determine the value of the layout.
- Parameters
-
◆ Layout() [4/4]
tgui::Layout::Layout |
( |
String | expression | ) |
|
Constructs the layout based on a string which will be parsed to determine the value of the layout.
- Parameters
-
◆ getValue()
float tgui::Layout::getValue |
( |
| ) |
const |
|
inlinenodiscard |
Return the cached value of the layout.
- Returns
- Value of the layout
◆ isConstant()
bool tgui::Layout::isConstant |
( |
| ) |
const |
|
inlinenodiscard |
Return whether the layout stores a constant value.
- Returns
- Value of the layout
◆ replaceValue()
void tgui::Layout::replaceValue |
( |
const Layout & | value | ) |
|
Replaces the value of the layout without overwriting its parent.
- Parameters
-
value | New value of the layout |
The documentation for this class was generated from the following file: