index 8e2cbc0264bda7505094f24642e79247c37b0e9c..b90895df8ec1802317968ca2fb006645b6eb8622 100644 (file)
*
* Author:
* Nicholas Bishop <nicholasbishop@gmail.com>
*
* Author:
* Nicholas Bishop <nicholasbishop@gmail.com>
+ * Felipe C. da S. Sanches <felipe.sanches@gmail.com>
*
* Copyright (C) 2007 Author
*
*
* Copyright (C) 2007 Author
*
namespace Widget {
SpinSlider::SpinSlider(double value, double lower, double upper, double step_inc,
namespace Widget {
SpinSlider::SpinSlider(double value, double lower, double upper, double step_inc,
- double climb_rate, int digits, const SPAttributeEnum a)
- : AttrWidget(a), _adjustment(value, lower, upper, step_inc),
+ double climb_rate, int digits, const SPAttributeEnum a, char* tip_text)
+ : AttrWidget(a, value), _adjustment(value, lower, upper, step_inc),
_scale(_adjustment), _spin(_adjustment, climb_rate, digits)
{
signal_value_changed().connect(signal_attr_changed().make_slot());
pack_start(_scale);
pack_start(_spin, false, false);
_scale(_adjustment), _spin(_adjustment, climb_rate, digits)
{
signal_value_changed().connect(signal_attr_changed().make_slot());
pack_start(_scale);
pack_start(_spin, false, false);
+ if (tip_text){
+ _tt.set_tip(_scale, tip_text);
+ _tt.set_tip(_spin, tip_text);
+ }
_scale.set_draw_value(false);
_scale.set_draw_value(false);
const gchar* val = attribute_value(o);
if(val)
_adjustment.set_value(Glib::Ascii::strtod(val));
const gchar* val = attribute_value(o);
if(val)
_adjustment.set_value(Glib::Ascii::strtod(val));
+ else
+ _adjustment.set_value(get_default()->as_double());
}
Glib::SignalProxy0<void> SpinSlider::signal_value_changed()
}
Glib::SignalProxy0<void> SpinSlider::signal_value_changed()
}
DualSpinSlider::DualSpinSlider(double value, double lower, double upper, double step_inc,
}
DualSpinSlider::DualSpinSlider(double value, double lower, double upper, double step_inc,
- double climb_rate, int digits, const SPAttributeEnum a)
+ double climb_rate, int digits, const SPAttributeEnum a, char* tip_text1, char* tip_text2)
: AttrWidget(a),
: AttrWidget(a),
- _s1(value, lower, upper, step_inc, climb_rate, digits),
- _s2(value, lower, upper, step_inc, climb_rate, digits),
- _link(_("Link"))
+ _s1(value, lower, upper, step_inc, climb_rate, digits, SP_ATTR_INVALID, tip_text1),
+ _s2(value, lower, upper, step_inc, climb_rate, digits, SP_ATTR_INVALID, tip_text2),
+ //TRANSLATORS: Only translate the word "Link" - means to _link_ two sliders together
+ _link(Q_("sliders|Link"))
{
signal_value_changed().connect(signal_attr_changed().make_slot());
{
signal_value_changed().connect(signal_attr_changed().make_slot());
if(toks[1])
v2 = Glib::Ascii::strtod(toks[1]);
if(toks[1])
v2 = Glib::Ascii::strtod(toks[1]);
+ _link.set_active(toks[1] == 0);
+
_s1.get_adjustment().set_value(v1);
_s2.get_adjustment().set_value(v2);
_s1.get_adjustment().set_value(v1);
_s2.get_adjustment().set_value(v2);