3 This file is part of libmspgltk
4 Copyright © 2007 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
8 #ifndef MSP_GLTK_PANEL_H_
9 #define MSP_GLTK_PANEL_H_
17 Panels are containers for other widgets. Panel styles should have a special
18 part "children" to render the child widgets. All properties of this part are
21 class Panel: public Widget
24 class Loader: public Widget::Loader
28 std::map<std::string, Widget *> &wdg_map;
31 Loader(Panel &, std::map<std::string, Widget *> &);
34 void child(const std::string &);
35 void panel(const std::string &);
39 std::list<Widget *> children;
40 Widget *pointer_focus;
41 unsigned pointer_grab;
45 Panel &operator=(const Panel &);
47 Panel(const Resources &);
51 void remove(Widget &);
52 const std::list<Widget *> &get_children() const { return children; }
54 void set_focus(Widget &);
56 virtual void button_press(int, int, unsigned);
57 virtual void button_release(int, int, unsigned);
58 virtual void pointer_motion(int, int);
59 virtual void pointer_leave();
60 virtual void key_press(unsigned, unsigned, wchar_t);
61 virtual void key_release(unsigned, unsigned);
62 virtual void focus_out();
64 // These functions are not intended to be called from outside GLtk
65 void child_hidden(Widget &);
66 void grab_pointer(Widget &);
67 void ungrab_pointer(Widget &);
68 void grab_focus(Widget &);
70 virtual const char *get_class() const { return "panel"; }
71 virtual void render_special(const Part &) const;
73 void set_pointer_focus(Widget *, int);
74 void set_input_focus(Widget *);
75 Widget *get_child_at(int, int);