- pointer_focus(0),
- pointer_grabbed(false),
- input_focus(0)
-{ }
-
-void Panel::raise(Widget &wdg)
-{
- for(list<Container::Child *>::iterator i=children.begin(); i!=children.end(); ++i)
- if((*i)->widget==&wdg)
- {
- children.splice(children.end(), children, i);
- return;
- }
-
- throw InvalidState("That Widget is not in this Panel");
-}
-
-Widget *Panel::get_final_input_focus() const
-{
- if(Panel *panel = dynamic_cast<Panel *>(input_focus))
- {
- Widget *focus = panel->get_final_input_focus();
- if(focus)
- return focus;
- }
- return input_focus;
-}
-
-void Panel::button_press(int x, int y, unsigned btn)
-{
- if(pointer_grabbed)
- {
- const Geometry &cgeom = pointer_focus->get_geometry();
- pointer_focus->button_press(x-cgeom.x, y-cgeom.y, btn);
- }
- else
- {
- if(Widget *wdg = get_child_at(x, y))
- {
- set_pointer_focus(wdg);
- if(wdg->is_focusable())
- set_input_focus(wdg);
- }
- Container::button_press(x, y, btn);
- }
-}
-
-void Panel::button_release(int x, int y, unsigned btn)
-{
- if(pointer_grabbed)
- {
- const Geometry &cgeom = pointer_focus->get_geometry();
- pointer_focus->button_release(x-cgeom.x, y-cgeom.y, btn);
- }
- else
- Container::button_release(x, y, btn);
-}
-
-void Panel::pointer_motion(int x, int y)