Code

initial filter UI code drop from Nick
[inkscape.git] / src / ui / widget / spin-slider.cpp
1 /**
2  * \brief Groups an HScale and a SpinButton together using the same Adjustment
3  *
4  * Author:
5  *   Nicholas Bishop <nicholasbishop@gmail.com>
6  *
7  * Copyright (C) 2007 Author
8  *
9  * Released under GNU GPL.  Read the file 'COPYING' for more information.
10  */
12 #include "spin-slider.h"
14 namespace Inkscape {
15 namespace UI {
16 namespace Widget {
19 SpinSlider::SpinSlider(double value, double lower, double upper, double step_inc,
20                        double climb_rate, int digits)
21     : _adjustment(value, lower, upper, step_inc),
22       _scale(_adjustment), _spin(_adjustment, climb_rate, digits)
23 {
24     pack_start(_scale);
25     pack_start(_spin, false, false);
27     _scale.set_draw_value(false);
29     show_all_children();
30 }
32 Glib::SignalProxy0<void> SpinSlider::signal_value_changed()
33 {
34     return _adjustment.signal_value_changed();
35 }
37 double SpinSlider::get_value() const
38 {
39     return _adjustment.get_value();
40 }
42 void SpinSlider::set_value(const double val)
43 {
44     _adjustment.set_value(val);
45 }
47 const Gtk::Adjustment& SpinSlider::get_adjustment() const
48 {
49     return _adjustment;
50 }
51 Gtk::Adjustment& SpinSlider::get_adjustment()
52 {
53     return _adjustment;
54 }
56 const Gtk::HScale& SpinSlider::get_scale() const
57 {
58     return _scale;
59 }
60 Gtk::HScale& SpinSlider::get_scale()
61 {
62     return _scale;
63 }
65 const Gtk::SpinButton& SpinSlider::get_spin_button() const
66 {
67     return _spin;
68 }
69 Gtk::SpinButton& SpinSlider::get_spin_button()
70 {
71     return _spin;
72 }
74 } // namespace Widget
75 } // namespace UI
76 } // namespace Inkscape
78 /* 
79   Local Variables:
80   mode:c++
81   c-file-style:"stroustrup"
82   c-file-offsets:((innamespace . 0)(inline-open . 0))
83   indent-tabs-mode:nil
84   fill-column:99
85   End:
86 */
87 // vim: filetype=c++:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :