+void Widget::pointer_enter()
+{
+ state|=HOVER;
+}
+
+void Widget::pointer_leave()
+{
+ state&=~HOVER;
+}
+
+void Widget::focus_in()
+{
+ state|=FOCUS;
+}
+
+void Widget::focus_out()
+{
+ state&=~FOCUS;
+}
+
+void Widget::update_style()
+{
+ string sname=get_class();
+ if(!style_name.empty())
+ {
+ sname+='-';
+ sname+=style_name;
+ }
+ style=res.get<Style>(sname);
+ on_style_change();
+}
+
+void Widget::set_parent(Panel *p)
+{
+ if(parent && p)
+ throw InvalidState("Widget is already in a Panel");
+ parent=p;
+
+ on_reparent();
+}
+
+void Widget::set_parent(Widget &w, Panel *p)
+{
+ w.set_parent(p);
+}
+