Table class for doing rectangular layouts. More...
#include <glv_layout.h>
Public Member Functions | |
Table (const char *arrangement, space_t padX=4, space_t padY=4, const Rect &r=Rect(0)) | |
Table & | arrange () |
Arrange child Views according to cell arrangement specification. | |
Table & | arrangement (const char *v) |
Set table cell arrangement. | |
const std::string & | arrangement () const |
Get arrangement string. | |
virtual const char * | className () const |
Get class name. | |
virtual void | onDraw (GLV &g) |
Drawing callback. |
Table class for doing rectangular layouts.
glv::Table::Table | ( | const char * | arrangement, | |
space_t | padX = 4 , |
|||
space_t | padY = 4 , |
|||
const Rect & | r = Rect(0) | |||
) |
[in] | arrangement | Arrangement string (see arrangement()) |
[in] | padX | Padding in x-direction between cells |
[in] | padY | Padding in y-direction between cells |
[in] | r | Geometry |
Table & glv::Table::arrange | ( | ) |
Arrange child Views according to cell arrangement specification.
If there are more children than the arrangement accounts for, then the arrangement string will copied the appropriate number of times.
Table & glv::Table::arrangement | ( | const char * | v | ) |
Set table cell arrangement.
The arrangement string specifies where Views will lie in the table, the alignment within each cell, and how cells should span multiple columns and/or rows. The string cell alignment characters are:
/// p ^ q top-left top-center top-right /// < x > center-left center-center center-right /// b v d bottom-left bottom-center bottom-right
The string layout characters are:
/// . empty region /// - span first leftward neighboring element rightward /// | span first upward neighboring element downward /// , end of row
Views added as children will fill in the cells with an alignment specification starting at the top-left cell and then proceeding column-by-column, row-by-row.
The alignment code will set the View's anchor factors.