summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d7dca9e)
raw | patch | inline | side by side (parent: d7dca9e)
author | dvlierop2 <dvlierop2@users.sourceforge.net> | |
Wed, 30 Apr 2008 18:54:13 +0000 (18:54 +0000) | ||
committer | dvlierop2 <dvlierop2@users.sourceforge.net> | |
Wed, 30 Apr 2008 18:54:13 +0000 (18:54 +0000) |
index ad9466eb86d7a079ce8945834d5c1813922dd540..6c39860b9b5a5ca99d3e667722f36ef7ed674bdc 100644 (file)
#include "ui/widget/registered-widget.h"
#include "ui/widget/registry.h"
-#include "ui/widget/tolerance-slider.h"
+//#include "ui/widget/tolerance-slider.h"
#include "xml/node-event-vector.h"
index 8ae26d4c48928db4eff047462ac68b8c53cfc7d4..0ff2c65f1fdf953a040284a5ca4ad1cffe7f07fc 100644 (file)
#include "ui/widget/scalar-unit.h"
#include "ui/widget/registered-widget.h"
#include "ui/widget/registry.h"
-#include "ui/widget/tolerance-slider.h"
+//#include "ui/widget/tolerance-slider.h"
#include "xml/node-event-vector.h"
#include "snapper.h"
#include "line-snapper.h"
index e7aca0edc7559a8a4dd57b686dc55235a0f9d8ec..6396a61038bf865e13193dfa63bf7f29bbac2099 100644 (file)
{
_page_snap.show();
- _rsu_sno.init (_("Snap _distance"), _("Snap only when _closer than:"),
- _("Snapping distance, in screen pixels, for snapping to objects"),
+ _rsu_sno.init (_("Snap _distance"), _("Snap only when _closer than:"), _("Always snap"),
+ _("Snapping distance, in screen pixels, for snapping to objects"), _("Always snap to objects, regardless of their distance"),
_("If set, objects only snap to another object when it's within the range specified below"),
"objecttolerance", _wr);
//Options for snapping to grids
- _rsu_sn.init (_("Snap d_istance"), _("Snap only when c_loser than:"),
- _("Snapping distance, in screen pixels, for snapping to grid"),
+ _rsu_sn.init (_("Snap d_istance"), _("Snap only when c_loser than:"), _("Always snap"),
+ _("Snapping distance, in screen pixels, for snapping to grid"), _("Always snap to grids, regardless of the distance"),
_("If set, objects only snap to a grid line when it's within the range specified below"),
"gridtolerance", _wr);
//Options for snapping to guides
- _rsu_gusn.init (_("Snap dist_ance"), _("Snap only when close_r than:"),
- _("Snapping distance, in screen pixels, for snapping to guides"),
+ _rsu_gusn.init (_("Snap dist_ance"), _("Snap only when close_r than:"), _("Always snap"),
+ _("Snapping distance, in screen pixels, for snapping to guides"), _("Always snap to guides, regardless of the distance"),
_("If set, objects only snap to a guide when it's within the range specified below"),
"guidetolerance", _wr);
index 0110a6c4c55c536bfc77aedda642305ce3d6314e..3a36127f4d74bd733e271621fd91642bf2a9b2be 100644 (file)
}
void
-ToleranceSlider::init (const Glib::ustring& label1, const Glib::ustring& label2, const Glib::ustring& tip1, const Glib::ustring& tip2, const Glib::ustring& key, Registry& wr)
+ToleranceSlider::init (const Glib::ustring& label1, const Glib::ustring& label2, const Glib::ustring& label3, const Glib::ustring& tip1, const Glib::ustring& tip2, const Glib::ustring& tip3, const Glib::ustring& key, Registry& wr)
{
// hbox = label + slider
//
@@ -87,17 +87,26 @@ ToleranceSlider::init (const Glib::ustring& label1, const Glib::ustring& label2,
Gtk::Label *theLabel2 = manage (new Gtk::Label (label2));
theLabel2->set_use_underline();
- _button = manage (new Gtk::CheckButton);
- _tt.set_tip (*_button, tip2);
- _button->add (*theLabel2);
- _button->set_alignment (0.0, 0.5);
+ Gtk::Label *theLabel3 = manage (new Gtk::Label (label3));
+ theLabel3->set_use_underline();
+ _button1 = manage (new Gtk::RadioButton);
+ _radio_button_group = _button1->get_group();
+ _button2 = manage (new Gtk::RadioButton);
+ _button2->set_group(_radio_button_group);
+ _tt.set_tip (*_button1, tip2);
+ _tt.set_tip (*_button2, tip3);
+ _button1->add (*theLabel3);
+ _button1->set_alignment (0.0, 0.5);
+ _button2->add (*theLabel2);
+ _button2->set_alignment (0.0, 0.5);
- _vbox->add (*_button);
+ _vbox->add (*_button1);
+ _vbox->add (*_button2);
// Here we need some extra pixels to get the vertical spacing right. Why?
_vbox->pack_end(*_hbox, true, true, 3); // add 3 px.
_key = key;
_scale_changed_connection = _hscale->signal_value_changed().connect (sigc::mem_fun (*this, &ToleranceSlider::on_scale_changed));
- _btn_toggled_connection = _button->signal_toggled().connect (sigc::mem_fun (*this, &ToleranceSlider::on_toggled));
+ _btn_toggled_connection = _button2->signal_toggled().connect (sigc::mem_fun (*this, &ToleranceSlider::on_toggled));
_wr = ≀
_vbox->show_all_children();
}
if (val > 9999.9) // magic value 10000.0
{
- _button->set_active (false);
+ _button1->set_active (true);
+ _button2->set_active (false);
_hbox->set_sensitive (false);
val = 50.0;
}
else
{
- _button->set_active (true);
+ _button1->set_active (false);
+ _button2->set_active (true);
_hbox->set_sensitive (true);
}
_hscale->set_value (val);
void
ToleranceSlider::on_toggled()
{
- if (!_button->get_active())
+ if (!_button2->get_active())
{
_old_val = _hscale->get_value();
_hbox->set_sensitive (false);
index e395ede1453a0bc45c111197fd4936f71c58b28c..3d0324c1f70a4dc115d03dd5072477d6208662e0 100644 (file)
#include <gtkmm/tooltips.h>
#include <gtkmm/checkbutton.h>
+#include <gtkmm/radiobutton.h>
namespace Inkscape {
namespace UI {
~ToleranceSlider();
void init (const Glib::ustring& label1,
const Glib::ustring& label2,
+ const Glib::ustring& label3,
const Glib::ustring& tip1,
const Glib::ustring& tip2,
+ const Glib::ustring& tip3,
const Glib::ustring& key,
Registry& wr);
void setValue (double);
void update (double val);
Gtk::HBox *_hbox;
Gtk::HScale *_hscale;
- Gtk::CheckButton *_button;
+ Gtk::RadioButtonGroup _radio_button_group;
+ Gtk::RadioButton *_button1;
+ Gtk::RadioButton *_button2;
Gtk::Tooltips _tt;
Registry *_wr;
Glib::ustring _key;