+void Panel::remove(Widget &wdg)
+{
+ ChildSeq::iterator i=find(children.begin(), children.end(), &wdg);
+ if(i!=children.end())
+ {
+ set_parent(wdg, 0);
+ children.erase(i);
+ }
+}
+
+void Panel::button_press(int x, int y, unsigned btn)
+{
+ if(pointer_grab>0)
+ pointer_focus->button_press(x-geom.x, y-geom.y, btn);
+ else if(geom.is_inside(x, y))
+ {
+ if(Widget *wdg=get_child_at(x, y))
+ {
+ set_pointer_focus(wdg, btn);
+ set_input_focus(wdg);
+
+ wdg->button_press(x-geom.x, y-geom.y, btn);
+ }
+ }
+}
+
+void Panel::button_release(int x, int y, unsigned btn)
+{
+ if(pointer_grab>0)
+ {
+ pointer_focus->button_release(x-geom.x, y-geom.y, btn);
+
+ if(btn==pointer_grab)
+ set_pointer_focus(get_child_at(x, y), 0);
+ }
+ else if(geom.is_inside(x, y))
+ {
+ if(Widget *wdg=get_child_at(x, y))
+ wdg->button_release(x-geom.x, y-geom.y, btn);
+ }
+}
+
+void Panel::pointer_motion(int x, int y)
+{
+ if(pointer_grab>0)
+ pointer_focus->pointer_motion(x-geom.x, y-geom.y);
+ else if(geom.is_inside(x, y))
+ {
+ Widget *wdg=get_child_at(x, y);
+ set_pointer_focus(wdg, 0);
+ if(wdg)
+ wdg->pointer_motion(x-geom.x, y-geom.y);
+ }
+}
+
+void Panel::pointer_leave()
+{
+ set_pointer_focus(0, 0);
+}
+
+void Panel::key_press(unsigned key, unsigned mod, wchar_t ch)
+{
+ if(input_focus)
+ input_focus->key_press(key, mod, ch);
+}
+
+void Panel::key_release(unsigned key, unsigned mod)
+{
+ if(input_focus)
+ input_focus->key_release(key, mod);
+}
+
+void Panel::focus_out()
+{
+ set_input_focus(0);
+}
+
+void Panel::child_hidden(Widget &wdg)
+{
+ if(&wdg==pointer_focus)
+ set_pointer_focus(0, 0);
+}
+
+void Panel::render_special(const Part &part) const