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