7 Panel::Panel(const Resources &r):
18 for(ChildSeq::iterator i=children.begin(); i!=children.end(); ++i)
22 void Panel::button_press(int x, int y, unsigned btn)
25 pointer_focus->button_press(x-geom.x, y-geom.y, btn);
26 else if(geom.is_inside(x, y))
28 for(ChildSeq::iterator i=children.begin(); i!=children.end(); ++i)
29 if((*i)->get_geometry().is_inside(x-geom.x, y-geom.y))
31 (*i)->button_press(x-geom.x, y-geom.y, btn);
38 void Panel::button_release(int x, int y, unsigned btn)
42 pointer_focus->button_release(x-geom.x, y-geom.y, btn);
48 for(ChildSeq::iterator i=children.begin(); i!=children.end(); ++i)
49 if((*i)->get_geometry().is_inside(x-geom.x, y-geom.y))
51 set_pointer_focus(*i);
56 else if(geom.is_inside(x, y))
58 for(ChildSeq::iterator i=children.begin(); i!=children.end(); ++i)
59 if((*i)->get_geometry().is_inside(x-geom.x, y-geom.y))
60 (*i)->button_release(x-geom.x, y-geom.y, btn);
64 void Panel::pointer_motion(int x, int y)
67 pointer_focus->pointer_motion(x-geom.x, y-geom.y);
68 else if(geom.is_inside(x, y))
71 for(ChildSeq::iterator i=children.begin(); i!=children.end(); ++i)
72 if((*i)->get_geometry().is_inside(x-geom.x, y-geom.y))
74 set_pointer_focus(*i);
75 (*i)->pointer_motion(x-geom.x, y-geom.y);
84 void Panel::key_press(unsigned key, unsigned mod, wchar_t ch)
87 input_focus->key_press(key, mod, ch);
90 void Panel::key_release(unsigned key, unsigned mod)
93 input_focus->key_release(key, mod);
96 void Panel::focus_out()
101 void Panel::add(Widget &wdg)
103 children.push_back(&wdg);
106 void Panel::render_part(const Part &part) const
108 if(part.get_name()=="children")
110 for(ChildSeq::const_iterator i=children.begin(); i!=children.end(); ++i)
114 Widget::render_part(part);
117 void Panel::set_pointer_focus(Widget *wdg)
119 if(wdg!=pointer_focus && pointer_grab==0)
122 pointer_focus->pointer_leave();
127 pointer_focus->pointer_enter();
131 void Panel::set_input_focus(Widget *wdg)
136 input_focus->focus_out();
141 input_focus->focus_in();