]> git.tdb.fi Git - libs/gltk.git/blob - source/label.h
Use the override specifier when overriding a virtual function
[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         const char *get_class() const override { return "label"; }
32
33         void set_text(const std::string &);
34
35 private:
36         void autosize_special(const Part &, Geometry &) const override;
37         void rebuild_special(const Part &) override;
38
39         void on_style_change() override;
40 };
41
42 } // namespace GLtk
43 } // namespace Msp
44
45 #endif