tolerance-slider.cpp revision a53fd00014de5e3469827acbab0e4cce9ed39087
/*
* Authors:
* Ralf Stephan <ralf@ark.in-berlin.de>
* Abhishek Sharma
*
* Copyright (C) 2006 Authors
*
* Released under GNU GPL. Read the file 'COPYING' for more information
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#endif
#include <gtkmm/adjustment.h>
#include <gtkmm/radiobutton.h>
#include "svg/stringstream.h"
#include "inkscape.h"
#include "document.h"
#include "document-undo.h"
#include "desktop-handles.h"
#include "sp-namedview.h"
#include "registry.h"
#include "tolerance-slider.h"
namespace Inkscape {
namespace UI {
namespace Widget {
//===================================================
//---------------------------------------------------
//====================================================
ToleranceSlider::ToleranceSlider(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)
: _vbox(0)
{
}
{
}
void 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
//
// e.g.
//
// snap distance |-------X---| 37
// vbox = checkbutton
// +
// hbox
// align the label with the checkbox text above by indenting 22 px.
#if WITH_GTKMM_3_0
#else
#endif
_hscale->set_draw_value (true);
_old_val = 10;
// Here we need some extra pixels to get the vertical spacing right. Why?
_scale_changed_connection = _hscale->signal_value_changed().connect (sigc::mem_fun (*this, &ToleranceSlider::on_scale_changed));
_btn_toggled_connection = _button2->signal_toggled().connect (sigc::mem_fun (*this, &ToleranceSlider::on_toggled));
}
{
#if WITH_GTKMM_3_0
#else
#endif
{
_button1->set_active (true);
_button2->set_active (false);
_hbox->set_sensitive (false);
val = 50.0;
}
else
{
_button1->set_active (false);
_button2->set_active (true);
_hbox->set_sensitive (true);
}
}
{
}
void ToleranceSlider::on_scale_changed()
{
}
void ToleranceSlider::on_toggled()
{
if (!_button2->get_active())
{
_hbox->set_sensitive (false);
setValue (10000.0);
update (10000.0);
}
else
{
_hbox->set_sensitive (true);
}
}
{
if (_wr->isUpdating())
return;
if (!dt)
return;
_wr->setUpdating (true);
_wr->setUpdating (false);
}
} // namespace Dialog
} // namespace UI
} // namespace Inkscape
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=c++:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :