]> git.tdb.fi Git - libs/gltk.git/blob - source/panel.h
Enable loading of widgets from datafiles (not implemented for all widgets yet)
[libs/gltk.git] / source / panel.h
1 #ifndef MSP_GLTK_PANEL_H_
2 #define MSP_GLTK_PANEL_H_
3
4 #include "widget.h"
5
6 namespace Msp {
7 namespace GLtk {
8
9 class Panel: public Widget
10 {
11 public:
12         class Loader: public Widget::Loader
13         {
14         private:
15                 Panel &panel;
16                 std::map<std::string, Widget *> &wdg_map;
17         
18         public:
19                 Loader(Panel &, std::map<std::string, Widget *> &);
20         private:
21                 template<typename T>
22                 void child(const std::string &);
23         };
24
25         Panel(const Resources &);
26         ~Panel();
27
28         void add(Widget &);
29         void button_press(int, int, unsigned);
30         void button_release(int, int, unsigned);
31         void pointer_motion(int, int);
32         void key_press(unsigned, unsigned, wchar_t);
33         void key_release(unsigned, unsigned);
34         void focus_out();
35 private:
36         typedef std::list<Widget *> ChildSeq;
37
38         ChildSeq children;
39         Widget *pointer_focus;
40         unsigned pointer_grab;
41         Widget *input_focus;
42
43         Panel(const Panel &);
44         Panel &operator=(const Panel &);
45         const char *get_class() const { return "panel"; }
46         void render_part(const Part &) const;
47         void set_pointer_focus(Widget *);
48         void set_input_focus(Widget *);
49 };
50
51 } // namespace GLtk
52 } // namespace Msp
53
54 #endif