From b417df720584c101f3799874a0c836a543a8d0a8 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 12 Oct 2008 14:55:10 +0000 Subject: user interface updates, work-in-progress --- src/ui/label.h | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) (limited to 'src/ui/label.h') 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 #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; -- cgit v1.2.3