CARMA C++
carma::ui::rtd::RtArea Class Reference

A container and an associated line oriented layout manager suitable for multiline layout of grouped objects. More...

#include <carma/ui/rtd/common/RtDisplay.h>

Inheritance diagram for carma::ui::rtd::RtArea:
carma::ui::rtd::RtContainer carma::ui::rtd::RtTitledObj carma::ui::rtd::RtObject

Public Member Functions

CellPtr addCell (const char *fmt, char *legit, const char *string)
 Add a dynamicValue string to the layout. More...
 
CellPtr addCell (const char *fmt, const char *string)
 Add a dynamicValue string to the layout. More...
 
CellPtr addItem (RtLabelPtr label, CellPtr cell, RtLabelPtr units)
 Add a label/dynamicValue/units triplet to the layout. More...
 
CellPtr addItem (const ::std::string &label, CellPtr cell, const char *units)
 Add a label/dynamicValue/units triplet to the layout. More...
 
CellPtr addItem (const ::std::string &label, CellPtr cell, RtLabelPtr units)
 Add a label/dynamicValue/units triplet to the layout. More...
 
CellPtr addItem (const ::std::string &label, CellPtr cell)
 Add a label/dynamicValue doublet to the layout. More...
 
CellPtr addItem (const ::std::string &label, const char *fmt, char *legit, const char *string)
 Add a label/dynamicValue doublet for a dynamic string to the layout. More...
 
CellPtr addItem (const ::std::string &label, const char *fmt, const char *string)
 Add a label/dynamicValue doublet for a dynamic string to the layout. More...
 
CellPtr addItem (const ::std::string &label, const char *fmt, char *legit, short &data)
 Add a label/dynamicValue doublet for a dynamic short int to the layout. More...
 
CellPtr addItem (const ::std::string &label, const char *fmt, char *legit, int &data)
 Add a label/dynamicValue doublet for a dynamic int to the layout. More...
 
CellPtr addItem (const ::std::string &label, const char *fmt, int rod, char *legit, double &data)
 Add a label/dynamicValue doublet for a dynamic double to the layout. More...
 
int getEndPad ()
 Get the padding (in pixels) at the end of the units label. More...
 
int getLabelPad ()
 Get the padding (in pixels) between the label and the value. More...
 
int getUnitPad ()
 Get the padding (in pixels) between the value and the units label. More...
 
 RtArea (const ::std::string &title)
 Constructor, border style defaults to none. More...
 
 RtArea (const std::string &title, Border border)
 Constructor. More...
 
virtual void serialize (bool initialize, int fontSize,::rtdproto::RtObject *rtobj)
 Creates static description of container to stdout. More...
 
void setEndPad (int p)
 Set the padding (in pixels) at the end of the units label. More...
 
void setLabelPad (int p)
 Set the padding (in pixels) between the label and the value. More...
 
void setUnitPad (int p)
 Set the padding (in pixels) between the value and the units label. More...
 
- Public Member Functions inherited from carma::ui::rtd::RtContainer
RtObjectPtr add (RtObjectPtr rtObject)
 Insert an object into the container. More...
 
Border getBorder () const
 
::size_t getNumObjects () const
 Get the number of objects in the container. More...
 
RtObjectPtr getObj (::size_t index) const
 Get object from the container by index. More...
 
RtObjectPtr replace (unsigned int i, RtObjectPtr rtObject)
 Replace an object in the container. More...
 
RtObjectPtr replace (RtObjectPtr oldObj, RtObjectPtr newObj)
 
void setBorder (Border border)
 Set the border code. More...
 
virtual void update ()
 Update all objects contained by container. More...
 
virtual ~RtContainer ()
 Destructor. More...
 
- Public Member Functions inherited from carma::ui::rtd::RtTitledObj
std::string getTitle ()
 Get title. More...
 
void setTitle (const std::string &title)
 Set title for object. More...
 
- Public Member Functions inherited from carma::ui::rtd::RtObject
void appendToolTipText (const std::string &text)
 Append more text to the existing tool tip text. More...
 
Layout getLayout () const
 Get the layout for this object. More...
 
std::string getToolTipText ()
 
void setFontSize (int fontSize)
 Set the absolute font size for this object. More...
 
void setLayout (Layout layout)
 Set the layout for this object. More...
 
void setToolTipText (const std::string &text)
 Set the tool tip text for this RtObject. More...
 
virtual ~RtObject ()
 Destructor. More...
 

Additional Inherited Members

- Protected Types inherited from carma::ui::rtd::RtContainer
typedef ::std::vector
< RtObjectPtr > 
ObjectContainerType
 
- Protected Member Functions inherited from carma::ui::rtd::RtContainer
 RtContainer ()
 Constructor. More...
 
 RtContainer (const ::std::string &title)
 Constructor. More...
 
 RtContainer (Border border)
 Constructor. More...
 
 RtContainer (const ::std::string &title, Border border)
 Constructor. More...
 
- Protected Member Functions inherited from carma::ui::rtd::RtTitledObj
 RtTitledObj (const std::string &title)
 Constructor. More...
 
- Protected Member Functions inherited from carma::ui::rtd::RtObject
int getFontSize (int parentFontSize) const
 Get the absolute font size for this object. More...
 
int getFontSize () const
 Get the absolute font size for this object. More...
 
 RtObject ()
 Constructor. More...
 
- Protected Attributes inherited from carma::ui::rtd::RtContainer
size_t numObjects_
 
ObjectContainerType objects_
 
- Protected Attributes inherited from carma::ui::rtd::RtTitledObj
std::string title_
 Object title. More...
 

Detailed Description

A container and an associated line oriented layout manager suitable for multiline layout of grouped objects.

The linebreaks and groupings are set by single character constraints. The groupings can be of 1 to 3 components and have the general form of: component1 component2 component3 The padding between component1 and component2 is called the labelPad and the padding between component2 and component3 is the unitPad, from a model of LABEL value UNITS The gap between the groups is set to be the same and is just based on available space. Vertical space is also apportioned equally between the lines, so this layout will grow in both dimensions if desired.

The normal layout is "filled" with both end groups being placed near the ends and any space apportioned inbetween the components. If any component on a line has 'U' as the constraint then some of the space (half the intra-component space) goes at the ends.

This layout cannot be modified

If a single object is on the line then it can be centered (default), left justified, or right justified. Layout codes:
'N' none (the default)
'C' chain the next item to this one (don't insert extra space between)
'U' unfilled. Free space is also divided up between the ends (half of the intra-component space). This action will be done if any component of the line specifies it, otherwise components are justified to the right and left at the line ends.
'E' end of line, centered, but only if single component on line
'R' end of line, right justified, but only if single component on line
'L' end of line, left justified, but only if single component on line

This layout cannot be customized beyond what has been described here. If more flexibility is desired, it is better to use an RtHBox and add Labels, Cells, Spacers and Springs to construct individual lines, and then place the lines into an RtVBox to construct an area.

Definition at line 1587 of file RtDisplay.h.

Constructor & Destructor Documentation

carma::ui::rtd::RtArea::RtArea ( const ::std::string &  title)
explicit

Constructor, border style defaults to none.

Parameters
titleobject title
carma::ui::rtd::RtArea::RtArea ( const std::string &  title,
Border  border 
)

Constructor.

Parameters
titleobject title
borderborder style
See Also
RtContainer

Member Function Documentation

CellPtr carma::ui::rtd::RtArea::addCell ( const char *  fmt,
char *  legit,
const char *  string 
)

Add a dynamicValue string to the layout.

Parameters
fmtformat for the cell
legitcharacter flag for legitimate data
stringlocation of the dynamic string
CellPtr carma::ui::rtd::RtArea::addCell ( const char *  fmt,
const char *  string 
)

Add a dynamicValue string to the layout.

Data is assumed to be legitimate.

Parameters
fmtformat for the cell
stringlocation of the dynamic string
CellPtr carma::ui::rtd::RtArea::addItem ( RtLabelPtr  label,
CellPtr  cell,
RtLabelPtr  units 
)

Add a label/dynamicValue/units triplet to the layout.

Parameters
labelRtLabel for
cellcell pointer for the value
unitsstring for the units label
CellPtr carma::ui::rtd::RtArea::addItem ( const ::std::string &  label,
CellPtr  cell,
const char *  units 
)

Add a label/dynamicValue/units triplet to the layout.

Parameters
labelstring for the label
cellcell pointer for the value
unitsRtLabel for the units label
CellPtr carma::ui::rtd::RtArea::addItem ( const ::std::string &  label,
CellPtr  cell,
RtLabelPtr  units 
)

Add a label/dynamicValue/units triplet to the layout.

Parameters
labelstring for the label
cellcell pointer for the value
unitsRtLabel for the units label
CellPtr carma::ui::rtd::RtArea::addItem ( const ::std::string &  label,
CellPtr  cell 
)

Add a label/dynamicValue doublet to the layout.

Parameters
labelstring for the label
cellcell pointer for the value
CellPtr carma::ui::rtd::RtArea::addItem ( const ::std::string &  label,
const char *  fmt,
char *  legit,
const char *  string 
)

Add a label/dynamicValue doublet for a dynamic string to the layout.

Parameters
labelstring for the label
fmtformat for the cell
legitcharacter flag for legitimate data
stringlocation of the dynamic string
CellPtr carma::ui::rtd::RtArea::addItem ( const ::std::string &  label,
const char *  fmt,
const char *  string 
)

Add a label/dynamicValue doublet for a dynamic string to the layout.

The data is assumed to always be legitimate.

Parameters
labelstring for the label
fmtformat for the cell
stringlocation of the dynamic string
CellPtr carma::ui::rtd::RtArea::addItem ( const ::std::string &  label,
const char *  fmt,
char *  legit,
short &  data 
)

Add a label/dynamicValue doublet for a dynamic short int to the layout.

Parameters
labelstring for the label
fmtformat for the cell
legitcharacter flag for legitimate data
datadynamic data
CellPtr carma::ui::rtd::RtArea::addItem ( const ::std::string &  label,
const char *  fmt,
char *  legit,
int &  data 
)

Add a label/dynamicValue doublet for a dynamic int to the layout.

Parameters
labelstring for the label
fmtformat for the cell
legitcharacter flag for legitimate data
datadynamic data
CellPtr carma::ui::rtd::RtArea::addItem ( const ::std::string &  label,
const char *  fmt,
int  rod,
char *  legit,
double &  data 
)

Add a label/dynamicValue doublet for a dynamic double to the layout.

Parameters
labelstring for the label
fmtformat for the cell
rodnumber of places to the right of the decimal point
legitcharacter flag for legitimate data
datadynamic data
int carma::ui::rtd::RtArea::getEndPad ( )

Get the padding (in pixels) at the end of the units label.

int carma::ui::rtd::RtArea::getLabelPad ( )

Get the padding (in pixels) between the label and the value.

int carma::ui::rtd::RtArea::getUnitPad ( )

Get the padding (in pixels) between the value and the units label.

virtual void carma::ui::rtd::RtArea::serialize ( bool  initialize,
int  fontSize,
::rtdproto::RtObject *  rtobj 
)
virtual

Creates static description of container to stdout.

Implements carma::ui::rtd::RtContainer.

void carma::ui::rtd::RtArea::setEndPad ( int  p)

Set the padding (in pixels) at the end of the units label.

void carma::ui::rtd::RtArea::setLabelPad ( int  p)

Set the padding (in pixels) between the label and the value.

void carma::ui::rtd::RtArea::setUnitPad ( int  p)

Set the padding (in pixels) between the value and the units label.


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