registered-widget.cpp revision 8283ce7ee10f55326dff69df260418eccea35633
/** \file
*
*
* Authors:
* Johan Engelen <j.b.c.engelen@utwente.nl>
* bulia byak <buliabyak@users.sf.net>
* Bryce W. Harrington <bryce@bryceharrington.org>
* Lauris Kaplinski <lauris@kaplinski.com>
* Jon Phillips <jon@rejon.org>
* Ralf Stephan <ralf@ark.in-berlin.de> (Gtkmm)
*
* Copyright (C) 2000 - 2007 Authors
*
* Released under GNU GPL. Read the file 'COPYING' for more information
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "ui/widget/color-picker.h"
#include "ui/widget/registry.h"
#include "ui/widget/scalar-unit.h"
#include "widgets/spinbutton-events.h"
#include "svg/svg-color.h"
#include "svg/stringstream.h"
#include "inkscape.h"
#include "document.h"
#include "desktop-handles.h"
#include "sp-namedview.h"
#include "registered-widget.h"
#include "verbs.h"
// for interruptability bug:
#include "display/sp-canvas.h"
namespace Inkscape {
namespace UI {
namespace Widget {
//===================================================
//---------------------------------------------------
void
{
// Use local repr here. When repr is specified, use that one, but
// if repr==NULL, get the repr of namedview of active desktop.
if (!local_repr) {
// no repr specified, use active desktop's namedview's repr
}
sp_document_set_undo_sensitive (local_doc, false);
if (write_undo) {
}
}
//====================================================
: _button(0)
{
}
{
}
void
RegisteredCheckButton::init (const Glib::ustring& label, const Glib::ustring& tip, const Glib::ustring& key, Registry& wr, bool right, Inkscape::XML::Node* repr_in, SPDocument *doc_in)
{
l->set_use_underline (true);
_toggled_connection = _button->signal_toggled().connect (sigc::mem_fun (*this, &RegisteredCheckButton::on_toggled));
}
void
RegisteredCheckButton::setActive (bool b)
{
_button->set_active (b);
//The slave button is greyed out if the master button is unchecked
for (std::list<Gtk::ToggleButton*>::const_iterator i = _slavebuttons.begin(); i != _slavebuttons.end(); i++) {
(*i)->set_sensitive(b);
}
}
void
{
if (_wr->isUpdating())
return;
_wr->setUpdating (true);
//The slave button is greyed out if the master button is unchecked
for (std::list<Gtk::ToggleButton*>::const_iterator i = _slavebuttons.begin(); i != _slavebuttons.end(); i++) {
}
_wr->setUpdating (false);
}
{
}
{
}
void
RegisteredUnitMenu::init (const Glib::ustring& label, const Glib::ustring& key, Registry& wr, Inkscape::XML::Node* repr_in, SPDocument *doc_in)
{
_label->set_use_underline (true);
_changed_connection = _sel->signal_changed().connect (sigc::mem_fun (*this, &RegisteredUnitMenu::on_changed));
}
void
{
}
void
{
if (_wr->isUpdating())
return;
_wr->setUpdating (true);
_wr->setUpdating (false);
}
{
}
{
}
void
RegisteredScalarUnit::init (const Glib::ustring& label, const Glib::ustring& tip, const Glib::ustring& key, const RegisteredUnitMenu &rum, Registry& wr, Inkscape::XML::Node* repr_in, SPDocument *doc_in)
{
_value_changed_connection = _widget->signal_value_changed().connect (sigc::mem_fun (*this, &RegisteredScalarUnit::on_value_changed));
}
{
return _widget;
}
void
{
}
void
{
if (_wr->isUpdating())
return;
_wr->setUpdating (true);
if (_um)
_wr->setUpdating (false);
}
{
}
{
if (_widget)
delete _widget;
}
void
SPDocument * doc_in )
{
_value_changed_connection = _widget->signal_value_changed().connect (sigc::mem_fun (*this, &RegisteredScalar::on_value_changed));
}
{
return _widget;
}
void
{
}
void
{
if (_wr->isUpdating()) {
return;
}
_wr->setUpdating (true);
_widget->set_sensitive(false);
_widget->set_sensitive(true);
_wr->setUpdating (false);
}
{
}
{
}
void
RegisteredColorPicker::init (const Glib::ustring& label, const Glib::ustring& title, const Glib::ustring& tip, const Glib::ustring& ckey, const Glib::ustring& akey, Registry& wr, Inkscape::XML::Node* repr_in, SPDocument *doc_in)
{
_label->set_use_underline (true);
_changed_connection = _cp->connectChanged (sigc::mem_fun (*this, &RegisteredColorPicker::on_changed));
}
void
{
}
void
{
_cp->closeWindow();
}
void
{
if (_wr->isUpdating())
return;
_wr->setUpdating (true);
// Use local repr here. When repr is specified, use that one, but
// if repr==NULL, get the repr of namedview of active desktop.
if (!local_repr) {
// no repr specified, use active desktop's namedview's repr
if (!dt)
return;
}
gchar c[32];
sp_document_set_undo_sensitive (local_doc, false);
/* TODO: annotate */ "registered-widget.cpp: RegisteredColorPicker::on_changed");
_wr->setUpdating (false);
}
_suffix(0)
{
}
{
}
void
RegisteredSuffixedInteger::init (const Glib::ustring& label, const Glib::ustring& suffix, const Glib::ustring& key, Registry& wr, Inkscape::XML::Node* repr_in, SPDocument *doc_in)
{
_changed_connection = _adj.signal_value_changed().connect (sigc::mem_fun(*this, &RegisteredSuffixedInteger::on_value_changed));
}
void
RegisteredSuffixedInteger::setValue (int i)
{
}
void
{
if (_wr->isUpdating())
return;
_wr->setUpdating (true);
_wr->setUpdating (false);
}
: _hbox(0)
{
}
{
}
void
{
_rb2->set_active();
_changed_connection = _rb1->signal_toggled().connect (sigc::mem_fun (*this, &RegisteredRadioButtonPair::on_value_changed));
}
void
{
else _rb1->set_active();
}
void
{
if (_wr->isUpdating())
return;
_wr->setUpdating (true);
_wr->setUpdating (false);
}
/*#########################################
* Registered POINT
*/
{
}
{
if (_widget)
delete _widget;
}
void
SPDocument* doc_in )
{
_value_x_changed_connection = _widget->signal_x_value_changed().connect (sigc::mem_fun (*this, &RegisteredPoint::on_value_changed));
_value_y_changed_connection = _widget->signal_y_value_changed().connect (sigc::mem_fun (*this, &RegisteredPoint::on_value_changed));
}
{
return _widget;
}
void
{
}
void
{
if (_wr->isUpdating())
return;
_wr->setUpdating (true);
_wr->setUpdating (false);
}
/*#########################################
* Registered RANDOM
*/
{
}
{
if (_widget)
delete _widget;
}
void
SPDocument * doc_in )
{
_value_changed_connection = _widget->signal_value_changed().connect (sigc::mem_fun (*this, &RegisteredRandom::on_value_changed));
_reseeded_connection = _widget->signal_reseeded.connect(sigc::mem_fun(*this, &RegisteredRandom::on_value_changed));
}
{
return _widget;
}
void
{
}
void
{
if (_wr->isUpdating())
return;
_wr->setUpdating (true);
// FIXME: gtk bug?
// disable interruptibility: see http://inkscape.svn.sourceforge.net/viewvc/inkscape/inkscape/trunk/src/ui/widget/selected-style.cpp?r1=13149&r2=13257&sortby=date
// resume interruptibility
_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 :