#include <Wt/WLength>
Public Types | |
| enum | Unit { FontEm, FontEx, Pixel, Inch, Centimeter, Millimeter, Point, Pica, Percentage } |
| The unit. More... | |
Public Member Functions | |
| WLength () | |
| Creates an 'auto' length. | |
| WLength (double value, Unit unit=Pixel) | |
| Creates a length with value and unit. | |
| bool | isAuto () const |
| Returns whether the ength is 'auto'. | |
| double | value () const |
| Returns the value. | |
| Unit | unit () const |
| Returns the unit. | |
| const std::string | cssText () const |
| Returns the CSS text. | |
| bool | operator== (const WLength &other) const |
| Comparison operator. | |
| bool | operator!= (const WLength &other) const |
| Comparison operator. | |
| double | toPixels () const |
| Returns the (approximate) length in pixels. | |
Static Public Attributes | |
| static WLength | Auto |
| An 'auto' length. | |
The class combines a value with a unit. There is a special value auto which has a different meaning depending on the context.
| enum Wt::WLength::Unit |
| Wt::WLength::WLength | ( | ) |
| Wt::WLength::WLength | ( | double | value, | |
| Unit | unit = Pixel | |||
| ) |
Creates a length with value and unit.
This constructor will also provide the implicit conversion between a double and WLength, using a pixel unit.
| bool Wt::WLength::isAuto | ( | ) | const [inline] |
| double Wt::WLength::value | ( | ) | const [inline] |
| double Wt::WLength::toPixels | ( | ) | const |
Returns the (approximate) length in pixels.
When the length isAuto(), 0 is returned, otherwise the approximate length in pixels.
WLength Wt::WLength::Auto [static] |
1.5.6