#include <OpenGUI_FaceDef.h>
This class is designed to assist in creation of Face objects. Since the data used to construct a Face needs to be in a special format and leaves a lot of opportunities for errors and ambiguity, this class must be used to define how a Face should look.
The SliceDefs themselves allow for row and column spanning, but the actual spanning of the resulting Slices is done in later code. So you should not add padding slices to this structure to cover the spanned area. Doing so will result in additional (unexpected) slices created at later stages.
Spanning is processed in a style that similar to HTML tables. Slices are processed in left to right and top to bottom order. As slices are spanned, they will push conflicting slices to the right. This means that a row containing 2 SliceDefs, one with ColSpan=1 and the other ColSpan=0, would actually generate a row in the final Face that contained 3 columns. This effect occurs when using RowSpan as well, but remember that slices are only pushed right, so when RowSpan consumes an cell in a later row, the slice that would normally be in that position is moved to the right until it finds an open space.
Public Types | |
| typedef std::vector< SliceDef > | SliceDefVector |
| vector of SliceDef objects | |
| typedef std::vector< SliceDefVector > | SliceRowDefVector |
| vector of SliceDefVector objects | |
Public Member Functions | |
| SliceDef & | getSlice (size_t col, size_t row) |
| returns a reference to the requested slice definition, lengthening the 2d array if necessary | |
| size_t | getRowSizeEstimate () const |
| returns a rough guess on the number of rows needed, not always accurate but never over estimates | |
| size_t | getColSizeEstimate () const |
| returns a rough guess on the number of columns needed, not always accurate but never over estimates | |
Public Attributes | |
| Face::FaceMetric | Metric |
| The metric the final face will used. | |
| SliceRowDefVector | Rows |
| Direct access to the row/slice data. | |
| typedef std::vector<SliceDef> OpenGUI::FaceDef::SliceDefVector |
vector of SliceDef objects
| typedef std::vector<SliceDefVector> OpenGUI::FaceDef::SliceRowDefVector |
vector of SliceDefVector objects
| size_t OpenGUI::FaceDef::getColSizeEstimate | ( | ) | const |
returns a rough guess on the number of columns needed, not always accurate but never over estimates
| size_t OpenGUI::FaceDef::getRowSizeEstimate | ( | ) | const |
returns a rough guess on the number of rows needed, not always accurate but never over estimates
| SliceDef & OpenGUI::FaceDef::getSlice | ( | size_t | col, | |
| size_t | row | |||
| ) |
returns a reference to the requested slice definition, lengthening the 2d array if necessary
The metric the final face will used.
Direct access to the row/slice data.