3 This file is part of libmspgltk
4 Copyright © 2007-2011 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
8 #ifndef MSP_GLTK_PANEL_H_
9 #define MSP_GLTK_PANEL_H_
11 #include "container.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 Container
24 class Loader: public Widget::Loader
27 typedef std::map<std::string, Widget *> WidgetMap;
34 Loader(Panel &, WidgetMap &);
37 void child(const std::string &);
38 void panel(const std::string &);
42 struct Child: public Container::Child
44 Child(Panel &, Widget *);
47 void visibility_changed(bool);
50 void ungrab_pointer();
54 Widget *pointer_focus;
59 Panel &operator=(const Panel &);
63 virtual const char *get_class() const { return "panel"; }
66 virtual Child *create_child(Widget *);
70 Widget *get_input_focus() const { return input_focus; }
71 Widget *get_final_input_focus() const;
74 virtual void render_special(const Part &) const;
77 virtual void button_press(int, int, unsigned);
78 virtual void button_release(int, int, unsigned);
79 virtual void pointer_motion(int, int);
80 virtual void pointer_leave();
81 virtual void key_press(unsigned, unsigned, wchar_t);
82 virtual void key_release(unsigned, unsigned);
83 virtual void focus_out();
86 void set_pointer_focus(Widget *);
87 void set_input_focus(Widget *);