]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/hslider.cpp
Enable loading of entry widgets from datafiles
[libs/gltk.git] / source / hslider.cpp
index f19eafee419db334409007df3eb1e02be402856a..d764797971029c08da73015f391e6ab6a9867795 100644 (file)
@@ -55,27 +55,26 @@ void HSlider::pointer_motion(int x, int)
        }
 }
 
-void HSlider::render_part(const Part &part) const
+void HSlider::render_special(const Part &part) const
 {
        if(part.get_name()=="slider")
        {
-               unsigned gw=part.get_width();
-               unsigned gh=(part.get_fill_y() ? geom.h : part.get_height());
+               const Geometry &pgeom=part.get_geometry();
+               unsigned gw=pgeom.w;
+               unsigned gh=(part.get_fill_y() ? geom.h : pgeom.h);
                GL::push_matrix();
                GL::translate((geom.w-gw)*(value-min)/(max-min), (geom.h-gh)*(part.get_alignment().y+1)/2, 0);
                const Graphic *graphic=part.get_graphic(state);
                graphic->render(gw, gh);
                GL::pop_matrix();
        }
-       else
-               Widget::render_part(part);
 }
 
 unsigned HSlider::get_slider_width() const
 {
        for(PartSeq::const_iterator i=style->get_parts().begin(); i!=style->get_parts().end(); ++i)
                if(i->get_name()=="slider")
-                       return i->get_width();
+                       return i->get_geometry().w;
 
        return 0;
 }