#include <xrb_sizeproperties.hpp>
Public Types | |
enum | Property { MIN = 0, MAX } |
Enumeration to specify which half of the properties to change. More... | |
Public Member Functions | |
SizeProperties () | |
Default constructor. | |
~SizeProperties () | |
Destructor. | |
ScreenCoord | AdjustedSizeComponent (Uint32 index, ScreenCoord component) const |
Returns the given size coordinate, adjusted by the constraints of this SizeProperties object. | |
ScreenCoordVector2 | AdjustedSize (ScreenCoordVector2 const &size) const |
Returns the given size vector, adjusted by the constraints of this SizeProperties object. | |
void | AdjustSizeComponent (Uint32 index, ScreenCoord *component) const |
In-place version of AdjustedSizeComponent. | |
void | AdjustSize (ScreenCoordVector2 *size) const |
In-place version of AdjustedSize. | |
Static Public Member Functions | |
static ScreenCoord | DefaultMinSizeComponent () |
Returns the smallest valid minimum size component. | |
static ScreenCoord | DefaultMaxSizeComponent () |
Returns the largest valid maximum size component. | |
Public Attributes | |
Bool2 | m_min_size_enabled |
Indicates if there is a minimum size (for each dimension). | |
ScreenCoordVector2 | m_min_size |
Contains the minimum size for each dimension in screen coordinates. | |
Bool2 | m_max_size_enabled |
Indicates if there is a maximum size (for each dimension). | |
ScreenCoordVector2 | m_max_size |
Contains the maximum size for each dimension in screen coordinates. | |
ScreenCoord const * | m_data |
A pointer to a piece of data used in widget layout code. |
Is also used in various methods of Layout for optimal area allocation.
Definition at line 25 of file xrb_sizeproperties.hpp.
Enumeration to specify which half of the properties to change.
The properties are minimum size, minimum size enabled, maximum size, and maximum size enabled. This enum denotes half of the necessary qualifiers for all properties.
Definition at line 34 of file xrb_sizeproperties.hpp.
Xrb::SizeProperties::SizeProperties | ( | ) |
Default constructor.
Sets the min/max size enabled flags to false, and the min/max sizes to their neutral defaults (see DefaultMinSizeComponent and DefaultMaxSizeComponent).
Definition at line 16 of file xrb_sizeproperties.cpp.
References m_data.
Xrb::SizeProperties::~SizeProperties | ( | ) | [inline] |
static ScreenCoord Xrb::SizeProperties::DefaultMinSizeComponent | ( | ) | [inline, static] |
Returns the smallest valid minimum size component.
This is used more extensively in Layout for optimal area allocation.
Definition at line 82 of file xrb_sizeproperties.hpp.
static ScreenCoord Xrb::SizeProperties::DefaultMaxSizeComponent | ( | ) | [inline, static] |
Returns the largest valid maximum size component.
This is used more extensively in Layout for optimal area allocation.
Definition at line 89 of file xrb_sizeproperties.hpp.
ScreenCoord Xrb::SizeProperties::AdjustedSizeComponent | ( | Uint32 | index, | |
ScreenCoord | component | |||
) | const |
Returns the given size coordinate, adjusted by the constraints of this SizeProperties object.
index | Indicates which dimension the component value applies to. | |
component | The screen coordinate to adjust. |
Definition at line 26 of file xrb_sizeproperties.cpp.
References Xrb::Vector< T, dimension >::m, Xrb::NTuple< T, size >::m, m_max_size, m_max_size_enabled, m_min_size, and m_min_size_enabled.
Referenced by AdjustedSize().
ScreenCoordVector2 Xrb::SizeProperties::AdjustedSize | ( | ScreenCoordVector2 const & | size | ) | const |
Returns the given size vector, adjusted by the constraints of this SizeProperties object.
size | The size vector to adjust. |
Definition at line 39 of file xrb_sizeproperties.cpp.
References AdjustedSizeComponent(), Xrb::Dim::X, and Xrb::Dim::Y.
Referenced by Xrb::Widget::Resize().
void Xrb::SizeProperties::AdjustSizeComponent | ( | Uint32 | index, | |
ScreenCoord * | component | |||
) | const |
In-place version of AdjustedSizeComponent.
index | Indicates which dimension the component value applies to. | |
component | A pointer to the screen coordinate to adjust. |
Definition at line 47 of file xrb_sizeproperties.cpp.
References m_max_size, m_max_size_enabled, m_min_size, and m_min_size_enabled.
Referenced by AdjustSize().
void Xrb::SizeProperties::AdjustSize | ( | ScreenCoordVector2 * | size | ) | const |
In-place version of AdjustedSize.
size | A pointer to the size vector to adjust. |
Definition at line 60 of file xrb_sizeproperties.cpp.
References AdjustSizeComponent(), Xrb::Vector< T, dimension >::m, Xrb::Dim::X, and Xrb::Dim::Y.
Indicates if there is a minimum size (for each dimension).
An ordered pair of booleans, applying to the X and Y dimensions, respectively.
Definition at line 44 of file xrb_sizeproperties.hpp.
Referenced by AdjustedSizeComponent(), Xrb::Widget::AdjustFromMinSize(), AdjustSizeComponent(), Xrb::Widget::MinSizeEnabled(), and Xrb::Widget::SetSizePropertyEnabled().
Contains the minimum size for each dimension in screen coordinates.
If the corresponding component in m_min_size_enabled is false, then the size is not used (but it is saved for if/when the min size is re-enabled).
Definition at line 51 of file xrb_sizeproperties.hpp.
Referenced by AdjustedSizeComponent(), Xrb::Widget::AdjustFromMinSize(), AdjustSizeComponent(), Xrb::Widget::MaxSizeUpdated(), Xrb::Widget::MinSize(), Xrb::Widget::MinSizeUpdated(), and Xrb::Widget::SetSizeProperty().
Indicates if there is a maximum size (for each dimension).
An ordered pair of booleans, applying to the X and Y dimensions, respectively.
Definition at line 56 of file xrb_sizeproperties.hpp.
Referenced by AdjustedSizeComponent(), Xrb::Widget::AdjustFromMaxSize(), AdjustSizeComponent(), Xrb::Widget::MaxSizeEnabled(), and Xrb::Widget::SetSizePropertyEnabled().
Contains the maximum size for each dimension in screen coordinates.
If the corresponding component in m_max_size_enabled is false, then the size is not used (but it is saved for if/when the max size is re-enabled).
Definition at line 63 of file xrb_sizeproperties.hpp.
Referenced by AdjustedSizeComponent(), Xrb::Widget::AdjustFromMaxSize(), AdjustSizeComponent(), Xrb::Widget::MaxSize(), Xrb::Widget::MaxSizeUpdated(), Xrb::Widget::MinSizeUpdated(), and Xrb::Widget::SetSizeProperty().