+/** Component which provides the UI for a GTK HScale.
+ */
+class HSliderOption : public Option
+{
+public:
+ HSliderOption (
+ std::string const& i,
+ std::string const& n,
+ sigc::slot<float> g,
+ sigc::slot<bool, float> s,
+ double lower, double upper,
+ double step_increment = 1,
+ double page_increment = 10,
+ double mult = 1.0,
+ bool logarithmic = false
+ );
+
+ void set_state_from_config ();
+ virtual void changed ();
+ void add_to_page (OptionEditorPage* p);
+ void set_sensitive (bool yn);
+
+ Gtk::Widget& tip_widget() { return _hscale; }
+ Gtk::HScale& scale() { return _hscale; }
+
+protected:
+ sigc::slot<float> _get;
+ sigc::slot<bool, float> _set;
+ Gtk::Adjustment _adj;
+ Gtk::HScale _hscale;
+ Gtk::Label _label;
+ double _mult;
+ bool _log;
+};
+
+
+/** Component which provides the UI to handle an enumerated option using a GTK ComboBox.
+ * The template parameter is the enumeration.
+ */
+class ComboStringOption : public Option
+{
+public:
+ /** Construct an ComboOption.
+ * @param i id
+ * @param n User-visible name.
+ * @param g Slot to get the variable's value.
+ * @param s Slot to set the variable's value.
+ */
+ ComboStringOption (
+ std::string const & i,
+ std::string const & n,
+ sigc::slot<std::string> g,
+ sigc::slot<bool, std::string> s
+ );
+
+ void set_state_from_config ();
+ void add_to_page (OptionEditorPage* p);
+
+ /** Set the allowed strings for this option
+ * @param strings a vector of allowed strings
+ */
+ void set_popdown_strings (const std::vector<std::string>& strings);
+
+ void clear ();
+ void changed ();
+ void set_sensitive (bool yn);
+
+ Gtk::Widget& tip_widget() { return *_combo; }
+
+private:
+ sigc::slot<std::string> _get;
+ sigc::slot<bool, std::string> _set;
+ Gtk::Label* _label;
+ Gtk::ComboBoxText* _combo;
+};
+
+