]> git.tdb.fi Git - libs/gltk.git/blob - source/label.h
Rearrange members
[libs/gltk.git] / source / label.h
1 /* $Id$
2
3 This file is part of libmspgltk
4 Copyright © 2007, 2009-2011  Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #ifndef MSP_GLTK_LABEL_H_
9 #define MSP_GLTK_LABEL_H_
10
11 #include "text.h"
12 #include "widget.h"
13
14 namespace Msp {
15 namespace GLtk {
16
17 /**
18 Labels display static text.  There is one special part: "text".
19 */
20 class Label: public Widget
21 {
22 public:
23         class Loader: public Widget::Loader
24         {
25         public:
26                 Loader(Label &);
27         private:
28                 void text(const std::string &);
29         };
30
31 private:
32         Text text;
33
34 public:
35         Label(const std::string & = std::string());
36
37         virtual const char *get_class() const { return "label"; }
38
39         virtual void autosize();
40         void set_text(const std::string &);
41
42 private:
43         virtual void render_special(const Part &) const;
44
45         virtual void on_style_change();
46 };
47
48 } // namespace GLtk
49 } // namespace Msp
50
51 #endif