ubit
Classes | Public Member Functions | Public Attributes | Friends | List of all members
ubit::ULength Class Reference

Length of positions (UPos), sizes (USize) and padding (UPadding) More...

#include <ulength.hpp>

Classes

struct  Modes
 

Public Member Functions

 ULength (float value=0.0)
 creates a new length with the specified value, unit = PX and modes = 0.
 
 ULength (float value, UUnit u)
 creates a new length with the specified value and unit (modes = 0).
 
 ULength (float value, UUnit u, Modes m)
 creates a new length with the specified value, unit and modes.
 
 ULength (const UStr &text_spec)
 creates a new length with a value and a unit taken from a textual specification (modes = NONE).
 
bool operator== (const ULength &) const
 
bool operator!= (const ULength &) const
 
 operator float () const
 
float getValue () const
 
UUnit getUnit () const
 
Modes getModes () const
 
ULengthsetValue (float value)
 
ULengthsetUnit (UUnit u)
 
ULengthsetUnit (const char *unit)
 
ULengthsetModes (Modes m)
 
ULengthset (const UStr &text_spec)
 changes the value and the unit from a textual specification (modes are set to NONE).
 
UStr toString () const
 
float toPixels (UDisp *, const UFontDesc &, float view_len, float parview_len) const
 

Public Attributes

float val
 
UUnit unit
 
Modes modes
 

Friends

std::ostream & operator<< (std::ostream &s, const ULength &l)
 prints out this ULength on an output stream.
 
ULength operator| (float len, UUnit u)
 | makes its possible to specify the Unit of a Length in simple way (see exemples). More...
 
ULength operator| (ULength len, UUnit u)
 
ULength operator| (ULength len, ULength::Modes m)
 

Detailed Description

Length of positions (UPos), sizes (USize) and padding (UPadding)

Friends And Related Function Documentation

§ operator|

ULength operator| ( float  len,
UUnit  u 
)
friend

| makes its possible to specify the Unit of a Length in simple way (see exemples).

Exemples:

  • 50|UPX means a length of 50 pixels
  • 50|UPERCENT means a length of 50% of the parent Impl notes: operator|(float, enum) wouldn't work properly because C++ silently converts enums to ints

The documentation for this class was generated from the following files: