X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Foption_editor.h;h=4e3269e43ce208f35d6514ecdbc4a8302db84e48;hb=f23f379b37a5f4e68972a5f6c07a814c10503fdb;hp=47afa77868f6186be211db07894235c8992619e0;hpb=59631acc5f41153a294c97ab820a4b41a886e24c;p=ardour.git diff --git a/gtk2_ardour/option_editor.h b/gtk2_ardour/option_editor.h index 47afa77868..4e3269e43c 100644 --- a/gtk2_ardour/option_editor.h +++ b/gtk2_ardour/option_editor.h @@ -169,11 +169,11 @@ public: _button->set_sensitive (yn); } - Gtk::Widget& tip_widget() { return *_button; } + Gtk::Widget& tip_widget() { return *_button; } -private: +protected: - void toggled (); + virtual void toggled (); sigc::slot _get; ///< slot to get the configuration variable's value sigc::slot _set; ///< slot to set the configuration variable's value @@ -181,6 +181,31 @@ private: Gtk::Label* _label; ///< label for button, so we can use markup }; +class RouteDisplayBoolOption : public BoolOption +{ +public: + RouteDisplayBoolOption (std::string const &, std::string const &, sigc::slot, sigc::slot); +protected: + virtual void toggled (); +}; + +/** Component which allows to add any GTK Widget - intended for single buttons and custom stateless objects */ +class FooOption : public OptionEditorComponent +{ +public: + FooOption (Gtk::Widget *w) : _w (w) {} + + void add_to_page (OptionEditorPage* p) { + add_widget_to_page (p, _w); + } + + Gtk::Widget& tip_widget() { return *_w; } + void set_state_from_config () {} + void parameter_changed (std::string const &) {} +private: + Gtk::Widget *_w; +}; + /** Component which provides the UI to handle a string option using a GTK Entry */ class EntryOption : public Option { @@ -189,17 +214,22 @@ public: EntryOption (std::string const &, std::string const &, sigc::slot, sigc::slot); void set_state_from_config (); void add_to_page (OptionEditorPage*); + void set_sensitive (bool); + void set_invalid_chars (std::string i) { _invalid = i; } - Gtk::Widget& tip_widget() { return *_entry; } + Gtk::Widget& tip_widget() { return *_entry; } private: void activated (); + bool focus_out (GdkEventFocus*); + void filter_text (const Glib::ustring&, int*); sigc::slot _get; ///< slot to get the configuration variable's value sigc::slot _set; ///< slot to set the configuration variable's value Gtk::Label* _label; ///< UI label Gtk::Entry* _entry; ///< UI entry + std::string _invalid; }; @@ -347,6 +377,7 @@ public: } Gtk::Widget& tip_widget() { return *_hscale; } + Gtk::HScale& scale() { return *_hscale; } private: sigc::slot _get;