_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<bool> _get; ///< slot to get the configuration variable's value
sigc::slot<bool, bool> _set; ///< slot to set the configuration variable's value
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<bool>, sigc::slot<bool, bool>);
+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
{
EntryOption (std::string const &, std::string const &, sigc::slot<std::string>, sigc::slot<bool, std::string>);
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<std::string> _get; ///< slot to get the configuration variable's value
sigc::slot<bool, std::string> _set; ///< slot to set the configuration variable's value
Gtk::Label* _label; ///< UI label
Gtk::Entry* _entry; ///< UI entry
+ std::string _invalid;
};
}
Gtk::Widget& tip_widget() { return *_hscale; }
+ Gtk::HScale& scale() { return *_hscale; }
private:
sigc::slot<float> _get;