remove cruft from SliderController
This commit is contained in:
parent
540a12119b
commit
3bfe91c010
|
@ -44,38 +44,30 @@ namespace Gtkmm2ext {
|
||||||
|
|
||||||
class LIBGTKMM2EXT_API SliderController : public Gtkmm2ext::PixFader
|
class LIBGTKMM2EXT_API SliderController : public Gtkmm2ext::PixFader
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SliderController (Gtk::Adjustment* adj, int orientation, int, int);
|
SliderController (Gtk::Adjustment* adj, int orientation, int, int);
|
||||||
|
|
||||||
virtual ~SliderController () {}
|
|
||||||
|
|
||||||
void set_value (float);
|
virtual ~SliderController () {}
|
||||||
|
|
||||||
Gtk::SpinButton& get_spin_button () { return spin; }
|
Gtk::SpinButton& get_spin_button () { return spin; }
|
||||||
|
|
||||||
bool on_button_press_event (GdkEventButton *ev);
|
|
||||||
|
|
||||||
void set_controllable (boost::shared_ptr<PBD::Controllable> c) { binding_proxy.set_controllable (c); }
|
void set_controllable (boost::shared_ptr<PBD::Controllable> c) { binding_proxy.set_controllable (c); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
bool on_button_press_event (GdkEventButton *ev);
|
||||||
BindingProxy binding_proxy;
|
BindingProxy binding_proxy;
|
||||||
Gtk::SpinButton spin;
|
Gtk::SpinButton spin;
|
||||||
Gtk::Frame spin_frame;
|
|
||||||
Gtk::HBox spin_hbox;
|
|
||||||
|
|
||||||
void init ();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class LIBGTKMM2EXT_API VSliderController : public SliderController
|
class LIBGTKMM2EXT_API VSliderController : public SliderController
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
VSliderController (Gtk::Adjustment *adj, int, int, bool with_numeric = true);
|
VSliderController (Gtk::Adjustment *adj, int, int);
|
||||||
};
|
};
|
||||||
|
|
||||||
class LIBGTKMM2EXT_API HSliderController : public SliderController
|
class LIBGTKMM2EXT_API HSliderController : public SliderController
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
HSliderController (Gtk::Adjustment *adj, int, int, bool with_numeric = true);
|
HSliderController (Gtk::Adjustment *adj, int, int);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -33,17 +33,10 @@ SliderController::SliderController (Gtk::Adjustment *adj, int orientation, int f
|
||||||
, spin (*adj, 0, 2)
|
, spin (*adj, 0, 2)
|
||||||
{
|
{
|
||||||
spin.set_name ("SliderControllerValue");
|
spin.set_name ("SliderControllerValue");
|
||||||
spin.set_size_request (70,-1); // should be based on font size somehow
|
|
||||||
spin.set_numeric (true);
|
spin.set_numeric (true);
|
||||||
spin.set_snap_to_ticks (false);
|
spin.set_snap_to_ticks (false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
SliderController::set_value (float v)
|
|
||||||
{
|
|
||||||
adjustment.set_value (v);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
SliderController::on_button_press_event (GdkEventButton *ev)
|
SliderController::on_button_press_event (GdkEventButton *ev)
|
||||||
{
|
{
|
||||||
|
@ -54,29 +47,12 @@ SliderController::on_button_press_event (GdkEventButton *ev)
|
||||||
return PixFader::on_button_press_event (ev);
|
return PixFader::on_button_press_event (ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
VSliderController::VSliderController (Gtk::Adjustment *adj, int fader_length, int fader_girth, bool with_numeric)
|
VSliderController::VSliderController (Gtk::Adjustment *adj, int fader_length, int fader_girth)
|
||||||
|
|
||||||
: SliderController (adj, VERT, fader_length, fader_girth)
|
: SliderController (adj, VERT, fader_length, fader_girth)
|
||||||
{
|
{
|
||||||
if (with_numeric) {
|
|
||||||
spin_frame.add (spin);
|
|
||||||
spin_frame.set_shadow_type (Gtk::SHADOW_IN);
|
|
||||||
spin_frame.set_name ("BaseFrame");
|
|
||||||
spin_hbox.pack_start (spin_frame, false, true);
|
|
||||||
// pack_start (spin_hbox, false, false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HSliderController::HSliderController (Gtk::Adjustment *adj, int fader_length, int fader_girth,
|
HSliderController::HSliderController (Gtk::Adjustment *adj, int fader_length, int fader_girth)
|
||||||
bool with_numeric)
|
|
||||||
|
|
||||||
: SliderController (adj, HORIZ, fader_length, fader_girth)
|
: SliderController (adj, HORIZ, fader_length, fader_girth)
|
||||||
{
|
{
|
||||||
if (with_numeric) {
|
|
||||||
spin_frame.add (spin);
|
|
||||||
//spin_frame.set_shadow_type (Gtk::SHADOW_IN);
|
|
||||||
spin_frame.set_name ("BaseFrame");
|
|
||||||
spin_hbox.pack_start (spin_frame, false, true);
|
|
||||||
// pack_start (spin_hbox, false, false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user