Public Types | |
enum | Position { SBAR_LEFT, SBAR_CENTER, SBAR_RIGHT } |
Public Member Functions | |
StatusBarGroup (int x, int y, int w, int h, const char *l=0, bool begin=false) | |
StatusBarGroup (int H=24) | |
void | layout () |
void | show () |
void | hide () |
void | set (const char *t, Position pos=SBAR_RIGHT) |
void | set (Position pos, const char *format,...) |
void | child_box (Box *b) |
void | child_box (Box *b, Position i) |
Static Public Attributes | |
NamedStyle * | default_style |
Protected Member Functions | |
void | draw_label (Position pos, const char *label) |
void | update_box (InvisibleBox *b, Position pos) |
Here's some typical code you can use to create a status bar:
Sample implementation:
my_status_bar = new StatusBarGroup(24); my_status_bar->child_box(StatusBarGroup::SBAR_RIGHT, THIN_DOWN_BOX); //... more code ... // sets a right-aligned formatted text : my_status_bar->set(StatusBarGroup::SBAR_RIGHT, "%d items", count); // sets a centered text : my_status_bar->set("Hi", StatusBarGroup::SBAR_CENTER); //... more code ... // using a null or 0-len text removes the text box : my_status_bar->set(0, StatusBarGroup::SBAR_CENTER);
|
|
|
statusbar default constructor
|
|
set a default box to text at particular position inside the status bar
|
|
set a default box to all texts inside the status bar
|
|
draw a label on a particular (left,middle, right) Position
|
|
sets the label at a particular pos, automatically handles alloc + drawing, variable parmeter format set a formatable (printf-like) text in the status bar at a given Position 'pos' alignment spec. |
|
sets the label at a particular pos, automatically handles alloc + drawing set a simple string in the status bar at a given Position 'pos' alignment spec. |
|
adapt box position and size according to Position pos and statusbar dimensions
|