CARMA C++
|
Class to describe the layout of text within a cell. More...
#include <carma/ui/rtd/common/RtDisplay.h>
Public Member Functions | |
void | dump () |
Debugging dump on width/indent/length. More... | |
void | fmt (const char *s) |
Interprets a string containing the format information. More... | |
Format () | |
Constructor. More... | |
Format (int width, int indent, int len) | |
Constructor. More... | |
Format (const Format &rhs) | |
Constructor. More... | |
Format (const char *s) | |
Constructor. More... | |
Public Attributes | |
int | indent |
Left indent to the start of text in characters. More... | |
int | len |
Length of formatted text in characters. More... | |
int | width |
Total width of the cell in characters. More... | |
Class to describe the layout of text within a cell.
A text cell can contain any of the following:
The final cell output must be a fixed number of chars at a fixed indent, (len and indent). So when the cell is formed, we take the input indent and length (flen & findent), and do the arithmetic and the padding that accounts for the fact that the ALT strings can be longer than the dynamically formatted strings, to produce the final (len and indent).
A Text Cell
| ? | | 12.34567 | | 123.45678 | | ALT_TEXT_A | | ALT_TEXT_AB || TinyALT |
|<-findent-> | | <-flen–> | |<-indent-> | | <—len—> | |<----—width------—>|
Definition at line 216 of file RtDisplay.h.
|
explicit |
Constructor.
carma::ui::rtd::Format::Format | ( | int | width, |
int | indent, | ||
int | len | ||
) |
Constructor.
width | the total width of the cell |
indent | left indent to start of dynamic text |
len | length of dynamic text |
carma::ui::rtd::Format::Format | ( | const Format & | rhs | ) |
Constructor.
format | reference to a format |
|
explicit |
Constructor.
string | the width, indent and length as a decimal dot separated string, such as "11.2.8". Or as just the width, e.g. |
void carma::ui::rtd::Format::dump | ( | ) |
Debugging dump on width/indent/length.
void carma::ui::rtd::Format::fmt | ( | const char * | s | ) |
Interprets a string containing the format information.
int carma::ui::rtd::Format::indent |
Left indent to the start of text in characters.
Definition at line 250 of file RtDisplay.h.
int carma::ui::rtd::Format::len |
Length of formatted text in characters.
Definition at line 252 of file RtDisplay.h.
int carma::ui::rtd::Format::width |
Total width of the cell in characters.
Definition at line 248 of file RtDisplay.h.