- list<Widget *>::iterator i=find(children.begin(), children.end(), &wdg);
- if(i==children.end())
- throw InvalidState("That Widget is not in this Panel");
-
- children.erase(i);
- children.push_back(&wdg);
-}
-
-void Panel::button_press(int x, int y, unsigned btn)
-{
- if(pointer_grab>0)
- {
- const Geometry &cgeom=pointer_focus->get_geometry();
- pointer_focus->button_press(x-cgeom.x, y-cgeom.y, btn);
- }
- else if(geom.is_inside_relative(x, y))
- {
- if(Widget *wdg=get_child_at(x, y))
- {
- set_pointer_focus(wdg, btn);
- set_input_focus(wdg);
-
- const Geometry &cgeom=wdg->get_geometry();
- wdg->button_press(x-cgeom.x, y-cgeom.y, btn);
- }
- }
-}
-
-void Panel::button_release(int x, int y, unsigned btn)
-{
- if(pointer_grab>0)
- {
- const Geometry &cgeom=pointer_focus->get_geometry();
- pointer_focus->button_release(x-cgeom.x, y-cgeom.y, btn);
-
- if(btn==pointer_grab)
- set_pointer_focus(get_child_at(x, y), 0);
- }
- else if(geom.is_inside_relative(x, y))
- {
- if(Widget *wdg=get_child_at(x, y))
- {
- const Geometry &cgeom=wdg->get_geometry();
- wdg->button_release(x-cgeom.x, y-cgeom.y, btn);
- }
- }
-}
-
-void Panel::pointer_motion(int x, int y)
-{
- if(pointer_grab>0)
- {
- const Geometry &cgeom=pointer_focus->get_geometry();
- pointer_focus->pointer_motion(x-cgeom.x, y-cgeom.y);
- }
- else if(geom.is_inside_relative(x, y))