X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fhslider.cpp;h=2af6f5a4a71a621574e253c37ee802d3010979c2;hb=HEAD;hp=f19eafee419db334409007df3eb1e02be402856a;hpb=c2635c5a3dca6a6cea5562fd387beb0662b18cf0;p=libs%2Fgltk.git diff --git a/source/hslider.cpp b/source/hslider.cpp deleted file mode 100644 index f19eafe..0000000 --- a/source/hslider.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/* $Id$ - -This file is part of libmspgltk -Copyright © 2007 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - -#include -#include -#include "graphic.h" -#include "hslider.h" -#include "part.h" -#include "style.h" - -namespace Msp { -namespace GLtk { - -HSlider::HSlider(const Resources &r): - Slider(r), - dragging(false) -{ - update_style(); -} - -void HSlider::button_press(int x, int y, unsigned btn) -{ - if(geom.is_inside(x, y)) - { - int sw=get_slider_width(); - int sx=geom.x+static_cast((geom.w-sw)*(value-min)/(max-min)); - if(btn==1 && x>=sx && xrender(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 0; -} - -} // namespace GLtk -} // namespace Msp