X-Git-Url: http://git.tdb.fi/?p=libs%2Fgltk.git;a=blobdiff_plain;f=source%2Fpanel.cpp;fp=source%2Fpanel.cpp;h=fa16ec7de2826733d04a876f7ec445953bc76a8d;hp=957385e0dbb82ae14c586e045a9c5ac1e0aa7cad;hb=b4a3d651f57c46507aaa99a71a14fea15f0e430d;hpb=70e7a223a069874cda84673a4ca541aa44b12bf2 diff --git a/source/panel.cpp b/source/panel.cpp index 957385e..fa16ec7 100644 --- a/source/panel.cpp +++ b/source/panel.cpp @@ -56,9 +56,9 @@ void Panel::render_special(const Part &part, GL::Renderer &renderer) const { if(part.get_name()=="children") { - for(list::const_iterator i=children.begin(); i!=children.end(); ++i) - if((*i)->widget->is_visible()) - (*i)->widget->render(renderer); + for(const Container::Child *c: children) + if(c->widget->is_visible()) + c->widget->render(renderer); } } @@ -109,7 +109,7 @@ bool Panel::navigate(Navigation nav) } else if(nav==NAV_NEXT || nav==NAV_PREVIOUS) { - vector::iterator i = find(nav_order, input_focus); + auto i = find(nav_order, input_focus); if(nav==NAV_NEXT) { @@ -137,12 +137,12 @@ Widget *Panel::find_next_child(int origin_x, int origin_y, int origin_dim, int n { Widget *sibling = 0; int best_score = 0; - for(list::const_iterator i=children.begin(); i!=children.end(); ++i) + for(const Child *c: children) { - if((*i)->widget==input_focus || !(*i)->widget->is_focusable()) + if(c->widget==input_focus || !c->widget->is_focusable()) continue; - const Geometry &cgeom = (*i)->widget->get_geometry(); + const Geometry &cgeom = c->widget->get_geometry(); int dx = compute_delta(cgeom.x, cgeom.w, origin_x, origin_dim, nav_x); int dy = compute_delta(cgeom.y, cgeom.h, origin_y, origin_dim, nav_y); @@ -154,7 +154,7 @@ Widget *Panel::find_next_child(int origin_x, int origin_y, int origin_dim, int n if(score>=0 && (!sibling || scorewidget; + sibling = c->widget; best_score = score; } } @@ -196,7 +196,7 @@ void Panel::on_child_added(Widget &wdg) void Panel::on_child_removed(Widget &wdg) { - vector::iterator i = std::remove(nav_order.begin(), nav_order.end(), &wdg); + auto i = std::remove(nav_order.begin(), nav_order.end(), &wdg); if(i!=nav_order.end()) nav_order.erase(i, nav_order.end());