]> git.tdb.fi Git - libs/gltk.git/blob - source/hslider.cpp
Initial revision
[libs/gltk.git] / source / hslider.cpp
1 #include "hslider.h"
2
3 namespace Msp {
4 namespace GLtk {
5
6 HSlider::HSlider(const Resources &r):
7         Slider(r)
8 {
9 }
10
11 void HSlider::render_part(const Part &part)
12 {
13         if(part.get_name()=="slider")
14         {
15                 const Graphic *graphic=part.get_graphic(state);
16                 const Graphic::Sides &shadow=graphic->get_shadow();
17                 unsigned gw=graphic->get_slice().w-shadow.left-shadow.right;
18                 unsigned gh=(part.get_fill_x() ? geom.h, graphic->get_slice().h)-shadow.bottom-shadow.top;
19                 GL::translate((geom.w-gw)*(value-min)/(max-min), part.get_alignment().y
20         }
21 }
22
23 } // namespace GLtk
24 } // namespace Msp