]> git.tdb.fi Git - libs/gltk.git/blob - source/label.h
Add Text class with multiline support
[libs/gltk.git] / source / label.h
1 /* $Id$
2
3 This file is part of libmspgltk
4 Copyright © 2007  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 Resources &, const std::string & =std::string());
36
37         virtual void autosize();
38         void set_text(const std::string &);
39
40 private:
41         virtual const char *get_class() const { return "label"; }
42         virtual void render_special(const Part &) const;
43 };
44
45 } // namespace GLtk
46 } // namespace Msp
47
48 #endif