]> git.tdb.fi Git - libs/gltk.git/blob - source/label.h
3275bca091962e4d77555c45590a733fab80f578
[libs/gltk.git] / source / label.h
1 #ifndef MSP_GLTK_LABEL_H_
2 #define MSP_GLTK_LABEL_H_
3
4 #include "mspgltk_api.h"
5 #include "text.h"
6 #include "widget.h"
7
8 namespace Msp {
9 namespace GLtk {
10
11 /**
12 Labels display static text.  There is one special part: "text".
13 */
14 class MSPGLTK_API Label: public Widget
15 {
16 public:
17         class Loader: public DataFile::DerivedObjectLoader<Label, Widget::Loader>
18         {
19         public:
20                 Loader(Label &);
21         private:
22                 void text(const std::string &);
23         };
24
25 private:
26         Text text;
27
28 public:
29         Label(const std::string & = std::string());
30
31         virtual const char *get_class() const { return "label"; }
32
33         void set_text(const std::string &);
34
35 private:
36         virtual void autosize_special(const Part &, Geometry &) const;
37         virtual void rebuild_special(const Part &);
38
39         virtual void on_style_change();
40 };
41
42 } // namespace GLtk
43 } // namespace Msp
44
45 #endif