]> git.tdb.fi Git - libs/gltk.git/blob - source/panel.h
d922a991eb281b16017304786388d8915bc78170
[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 &pnl;
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                 void panel(const std::string &);
24         };
25
26         Panel(const Resources &);
27         ~Panel();
28
29         void add(Widget &);
30         void button_press(int, int, unsigned);
31         void button_release(int, int, unsigned);
32         void pointer_motion(int, int);
33         void key_press(unsigned, unsigned, wchar_t);
34         void key_release(unsigned, unsigned);
35         void focus_out();
36 private:
37         typedef std::list<Widget *> ChildSeq;
38
39         ChildSeq children;
40         Widget *pointer_focus;
41         unsigned pointer_grab;
42         Widget *input_focus;
43
44         Panel(const Panel &);
45         Panel &operator=(const Panel &);
46         const char *get_class() const { return "panel"; }
47         void render_part(const Part &) const;
48         void set_pointer_focus(Widget *);
49         void set_input_focus(Widget *);
50         Widget *get_child_at(int, int);
51 };
52
53 } // namespace GLtk
54 } // namespace Msp
55
56 #endif