--- ---
TGUI
1.x-dev
|
Class to store the left, top, width or height of a widget. More...
#include <TGUI/Layout.hpp>
Public Types | |
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. | |
Public Member Functions | |
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 (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. | |
TGUI_NODISCARD float | getValue () const |
Return the cached value of the layout. | |
TGUI_NODISCARD bool | isConstant () const |
Return whether the layout stores a constant value. | |
TGUI_NODISCARD String | toString () const |
void | connectWidget (Widget *widget, bool xAxis, std::function< void()> valueChangedCallbackHandler) |
void | unbindWidget () |
void | recalculateValue () |
TGUI_NODISCARD Layout * | getLeftOperand () const |
TGUI_NODISCARD 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.
|
inline |
Constructor to implicitly construct from numeric constant.
constant | Value of the layout |
|
inline |
Constructs the layout based on a string which will be parsed to determine the value of the layout.
expression | String to parse |
tgui::Layout::Layout | ( | String | expression | ) |
Constructs the layout based on a string which will be parsed to determine the value of the layout.
expression | String to parse |
|
inline |
Return the cached value of the layout.
|
inline |
Return whether the layout stores a constant value.
void tgui::Layout::replaceValue | ( | const Layout & | value | ) |
Replaces the value of the layout without overwriting its parent.
value | New value of the layout |