diff options
author | Stijn Buys <ingar@osirion.org> | 2008-10-12 14:55:10 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-10-12 14:55:10 +0000 |
commit | b417df720584c101f3799874a0c836a543a8d0a8 (patch) | |
tree | fb7105ed662f13753a6ab8d3efb047bad04f2316 /src/ui/label.h | |
parent | 18383a5fc596bf9546f14d7393ee66c57720b116 (diff) |
user interface updates, work-in-progress
Diffstat (limited to 'src/ui/label.h')
-rw-r--r-- | src/ui/label.h | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/src/ui/label.h b/src/ui/label.h index 45171b2..b7925c7 100644 --- a/src/ui/label.h +++ b/src/ui/label.h @@ -10,39 +10,45 @@ #include <string> #include "ui/widget.h" -namespace ui { +namespace ui +{ /// a widget displaying centered text -class Label : public Widget { +class Label : public Widget +{ public: Label(Widget *parent, const char *text=0); ~Label(); - + /// set the text displayed by the label - void set_text(std::string const &text); - + void set_text(const std::string &text); + /// set the text displayed by the label void set_text(const char *text); - + /// set the text alignment - void set_alignment(unsigned int alignment); - + void set_alignment(const unsigned int alignment); + /// return the text displayed by the label - inline std::string const &text() const { return label_text; } - + inline const std::string &text() const { + return label_text; + } + /// text alignment - inline unsigned int alignment() const { return label_alignment; } - + inline unsigned int alignment() const { + return label_alignment; + } + /// print label description - virtual void print(size_t indent); - + virtual void print(const size_t indent) const; + protected: /// draw the label virtual void draw(); - + /// draw the label text virtual void draw_text(); - + private: std::string label_text; unsigned int label_alignment; |