void Container::add(Widget &wdg)
{
wdg.set_parent(this);
- children.push_back(create_child(&wdg));
+ children.push_back(new Child(*this, &wdg));
if(wdg.get_animation_interval())
check_animation_interval();
children_rebuild_needed = true;
on_child_removed(wdg);
}
-Container::Child *Container::create_child(Widget *wdg)
-{
- return new Child(*this, wdg);
-}
-
Geometry Container::determine_child_geometry(const Widget &child, const Part &part) const
{
Geometry pgeom = part.get_geometry();
if(Container *cont = dynamic_cast<Container *>(wdg))
{
const Geometry &cgeom = wdg->get_geometry();
- Widget *wdg2 = cont->find_descendant_at(x-cgeom.x, y-cgeom.y);
- if(wdg2)
+ if(Widget *wdg2 = cont->find_descendant_at(x-cgeom.x, y-cgeom.y))
return wdg2;
}
return wdg;