+
+void List::Item::autosize()
+{
+ Widget::autosize();
+
+ if(const Part *part = style->get_part("children"))
+ {
+ const Sides &margin = part->get_margin();
+ for(list<Child *>::const_iterator i=children.begin(); i!=children.end(); ++i)
+ {
+ const Geometry &cgeom = (*i)->widget->get_geometry();
+ geom.w = max(geom.w, cgeom.x+cgeom.w+margin.right);
+ geom.h = max(geom.h, cgeom.y+cgeom.h+margin.top);
+ }
+ }
+}
+
+void List::Item::set_active(bool a)
+{
+ set_state(ACTIVE, (a ? ACTIVE : NORMAL));
+}
+
+void List::Item::render_special(const Part &part, GL::Renderer &renderer) const
+{
+ if(part.get_name()=="children")
+ {
+ for(list<Child *>::const_iterator i=children.begin(); i!=children.end(); ++i)
+ (*i)->widget->render(renderer);
+ }
+}
+
+
+List::BasicItem::BasicItem(const string &text):
+ label(text)
+{
+ add(label);
+}
+
+void List::BasicItem::on_style_change()
+{
+ if(!style)
+ return;
+
+ label.autosize();
+ if(const Part *part = style->get_part("children"))
+ {
+ const Sides &margin = part->get_margin();
+ label.set_position(margin.left, margin.bottom);
+ }
+}
+
+