|
LibCXXW 0.32.1
LibCXX Widget Toolkit
|
A dimension specification. More...
#include <dim_arg.H>
Public Types | |
| typedef std::variant< std::string, double > | variant_t |
| Alias. | |
Public Member Functions | |
| template<typename T , std::size_t n = is_numeric_or_string <std::remove_cv_t<std::remove_reference_t<T>>>::index> | |
| dim_arg (T &&t) | |
| Constructor. | |
| dim_arg () | |
| Default constructor. | |
| template<typename T , std::size_t n = is_numeric_or_string <std::remove_cv_t<std::remove_reference_t<T>>>::index> | |
| dim_arg & | operator= (T &&t) |
| Assignment operator. | |
| variant_t & | variant () |
| Helper to return the underlying variant type. | |
| const variant_t & | variant () const |
| Helper to return the underlying variant type. | |
A dimension specification.
Certain parameters may be specified either as a numeric value, or as a text string. A numerical value specifies a size expressed in millimeters. A text string references a size specified by the current display theme (this is mostly for the library's internal use).
The numeric value must be positive. The actual number of pixels gets computed based on the current theme's scaling factor. A non-0 dimension is always at least one pixel.
This is a tiny subclass of std::variant, providing a helping hand in constructing it.
| typedef std::variant<std::string, double> x::w::dim_arg::variant_t |
Alias.
|
inline |
Constructor.
Determine the appropriate variant_t constructor based on the parameter, to avoid some ambigous edge cases.
|
inline |
Default constructor.
|
inline |
Assignment operator.
Determine the appropriate variant_t alternative to assign based on the parameter, to avoid some ambigous edge cases.
|
inline |
Helper to return the underlying variant type.
|
inline |
Helper to return the underlying variant type.