+ if(pointer_focus==&wdg)
+ {
+ set_pointer_focus(0, 0);
+ if(parent)
+ parent->ungrab_pointer(*this);
+ }
+ else if(pointer_grab>0)
+ throw Exception("Someone is trying to steal the pointer!");
+}
+
+void Panel::grab_focus(Widget &wdg)
+{
+ list<Widget *>::iterator i=find(children.begin(), children.end(), &wdg);
+ if(i==children.end())
+ throw InvalidState("That Widget is not in this Panel");
+
+ set_input_focus(&wdg);
+ if(parent)
+ parent->grab_focus(*this);
+}
+
+void Panel::render_special(const Part &part) const
+{
+ if(part.get_name()=="children")
+ {
+ for(list<Widget *>::const_iterator i=children.begin(); i!=children.end(); ++i)
+ if((*i)->is_visible())
+ (*i)->render();
+ }
+}
+
+void Panel::set_pointer_focus(Widget *wdg, int grab)
+{
+ if(grab>0 && !wdg)
+ throw InvalidParameterValue("Can't grab on null widget");
+
+ if(wdg!=pointer_focus)