2 Copyright (C) 1998-99 Paul Davis
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2 of the License, or
6 (at your option) any later version.
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
13 You should have received a copy of the GNU General Public License
14 along with this program; if not, write to the Free Software
15 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #include <gtkmm2ext/gtk_ui.h>
23 #include <gtkmm2ext/pixfader.h>
24 #include <gtkmm2ext/slider_controller.h>
28 using namespace Gtkmm2ext;
31 SliderController::SliderController (
32 Glib::RefPtr<Gdk::Pixbuf> image,
33 Glib::RefPtr<Gdk::Pixbuf> image_desensitised,
38 : PixFader (image, image_desensitised, *adj, orientation, fader_length),
41 spin.set_name ("SliderControllerValue");
42 spin.set_size_request (70,-1); // should be based on font size somehow
43 spin.set_numeric (true);
44 spin.set_snap_to_ticks (false);
48 SliderController::set_value (float v)
50 adjustment.set_value (v);
54 SliderController::on_button_press_event (GdkEventButton *ev)
56 if (binding_proxy.button_press_handler (ev)) {
60 return PixFader::on_button_press_event (ev);
63 VSliderController::VSliderController (Glib::RefPtr<Gdk::Pixbuf> image, Glib::RefPtr<Gdk::Pixbuf> image_desensitised,
64 Gtk::Adjustment *adj, int fader_length,
67 : SliderController (image, image_desensitised, adj, VERT, fader_length)
70 spin_frame.add (spin);
71 spin_frame.set_shadow_type (Gtk::SHADOW_IN);
72 spin_frame.set_name ("BaseFrame");
73 spin_hbox.pack_start (spin_frame, false, true);
74 // pack_start (spin_hbox, false, false);
78 HSliderController::HSliderController (Glib::RefPtr<Gdk::Pixbuf> image, Glib::RefPtr<Gdk::Pixbuf> image_desensitised,
79 Gtk::Adjustment *adj, int fader_length,
82 : SliderController (image, image_desensitised, adj, HORIZ, fader_length)
85 spin_frame.add (spin);
86 //spin_frame.set_shadow_type (Gtk::SHADOW_IN);
87 spin_frame.set_name ("BaseFrame");
88 spin_hbox.pack_start (spin_frame, false, true);
89 // pack_start (spin_hbox, false, false);