X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Foption_editor.h;h=749df8f90c70e5631770da0e315b19fa44c71ca2;hb=9ccc56e1625;hp=93e217f7e7b3f88789fe9f911f771e5376eaf1a0;hpb=f114a20aa93e7753d65918e1052c08ff0357611a;p=ardour.git diff --git a/gtk2_ardour/option_editor.h b/gtk2_ardour/option_editor.h index 93e217f7e7..749df8f90c 100644 --- a/gtk2_ardour/option_editor.h +++ b/gtk2_ardour/option_editor.h @@ -19,15 +19,21 @@ #ifndef __gtk_ardour_option_editor_h__ #define __gtk_ardour_option_editor_h__ -#include #include #include +#include +#include +#include +#include #include #include +#include +#include #include -#include "gtkmm2ext/slider_controller.h" +#include "widgets/slider_controller.h" +#include "actions.h" #include "ardour_window.h" #include "audio_clock.h" #include "ardour/types.h" @@ -182,6 +188,36 @@ protected: std::string _name; }; +/** Just a Gtk Checkbutton, masquerading as an option component */ +class CheckOption : public OptionEditorComponent , public Gtkmm2ext::Activatable +{ +public: + CheckOption (std::string const &, std::string const &, Glib::RefPtr act ); + virtual ~CheckOption (); + void set_state_from_config () {} + void parameter_changed (std::string const &) {} + void add_to_page (OptionEditorPage*); + + void set_sensitive (bool yn) { + _button->set_sensitive (yn); + } + + Gtk::Widget& tip_widget() { return *_button; } + +protected: + void action_toggled (); + void action_sensitivity_changed () {} + void action_visibility_changed () {} + + virtual void toggled (); + + Gtk::CheckButton* _button; ///< UI button + Gtk::Label* _label; ///< label for button, so we can use markup + +private: + sigc::connection _callback_connection; +}; + /** Component which provides the UI to handle a boolean option using a GTK CheckButton */ class BoolOption : public Option { @@ -544,7 +580,7 @@ private: bool on_key_press (GdkEventKey* ev); Gtk::Adjustment _db_adjustment; - Gtkmm2ext::HSliderController* _db_slider; + ArdourWidgets::HSliderController* _db_slider; Gtk::Entry _db_display; Gtk::Label _label; Gtk::HBox _box; @@ -553,6 +589,21 @@ private: sigc::slot _set; }; +class WidgetOption : public Option +{ + public: + WidgetOption (std::string const & i, std::string const & n, Gtk::Widget& w); + + void add_to_page (OptionEditorPage*); + void parameter_changed (std::string const &) {} + void set_state_from_config () {} + + Gtk::Widget& tip_widget() { return *_widget; } + + private: + Gtk::Widget* _widget; +}; + class ClockOption : public Option { public: