registered-widget.cpp revision fd5e7b511a23f6228ce4cd3ef54795664811e615
/** \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 "registered-widget.h"
#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 "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) {
}
}
//====================================================
{
}
RegisteredCheckButton::RegisteredCheckButton (const Glib::ustring& label, const Glib::ustring& tip, const Glib::ustring& key, Registry& wr, bool right, Inkscape::XML::Node* repr_in, SPDocument *doc_in)
{
setProgrammatically = false;
l->set_use_underline (true);
_toggled_connection = signal_toggled().connect (sigc::mem_fun (*this, &RegisteredCheckButton::on_toggled));
}
void
RegisteredCheckButton::setActive (bool b)
{
setProgrammatically = true;
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);
}
setProgrammatically = false;
}
void
{
if (setProgrammatically) {
setProgrammatically = false;
return;
}
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++) {
(*i)->set_sensitive(get_active());
}
_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
{
if (_widget)
}
void
{
if (_widget->setProgrammatically) {
_widget->setProgrammatically = false;
return;
}
if (_wr->isUpdating())
return;
_wr->setUpdating (true);
if (_um)
_wr->setUpdating (false);
}
/*#########################################
* Registered SCALAR
*/
{
}
SPDocument * doc_in )
{
setDigits (2);
_value_changed_connection = signal_value_changed().connect (sigc::mem_fun (*this, &RegisteredScalar::on_value_changed));
}
void
{
if (setProgrammatically) {
setProgrammatically = false;
return;
}
if (_wr->isUpdating()) {
return;
}
_wr->setUpdating (true);
set_sensitive(false);
set_sensitive(true);
_wr->setUpdating (false);
}
/*#########################################
* Registered COLORPICKER
*/
{
}
{
}
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_svg_write_color(c, sizeof(c), rgba);
sp_document_set_undo_sensitive (local_doc, false);
/* TODO: annotate */ "registered-widget.cpp: RegisteredColorPicker::on_changed");
_wr->setUpdating (false);
}
: _label(0),
setProgrammatically(false),
_sb(0),
_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)
{
_sb->set_numeric();
_changed_connection = _adj.signal_value_changed().connect (sigc::mem_fun(*this, &RegisteredSuffixedInteger::on_value_changed));
}
void
RegisteredSuffixedInteger::setValue (int i)
{
setProgrammatically = true;
}
void
{
if (setProgrammatically) {
setProgrammatically = false;
return;
}
if (_wr->isUpdating())
return;
_wr->setUpdating (true);
_wr->setUpdating (false);
}
: _hbox(0),
setProgrammatically(false)
{
}
{
}
void
{
_rb2->set_active();
_changed_connection = _rb1->signal_toggled().connect (sigc::mem_fun (*this, &RegisteredRadioButtonPair::on_value_changed));
}
void
{
return;
setProgrammatically = true;
if (second) {
_rb2->set_active();
} else {
_rb1->set_active();
}
}
void
{
if (setProgrammatically) {
setProgrammatically = false;
return;
}
if (_wr->isUpdating())
return;
_wr->setUpdating (true);
_wr->setUpdating (false);
}
/*#########################################
* Registered POINT
*/
{
}
SPDocument* doc_in )
{
setDigits (2);
_value_x_changed_connection = signal_x_value_changed().connect (sigc::mem_fun (*this, &RegisteredPoint::on_value_changed));
_value_y_changed_connection = signal_y_value_changed().connect (sigc::mem_fun (*this, &RegisteredPoint::on_value_changed));
}
void
{
if (setProgrammatically()) {
return;
}
if (_wr->isUpdating())
return;
_wr->setUpdating (true);
_wr->setUpdating (false);
}
/*#########################################
* Registered RANDOM
*/
{
}
SPDocument * doc_in )
{
setDigits (2);
_value_changed_connection = signal_value_changed().connect (sigc::mem_fun (*this, &RegisteredRandom::on_value_changed));
_reseeded_connection = signal_reseeded.connect(sigc::mem_fun(*this, &RegisteredRandom::on_value_changed));
}
void
{
}
void
{
if (setProgrammatically) {
setProgrammatically = false;
return;
}
if (_wr->isUpdating()) {
return;
}
_wr->setUpdating (true);
set_sensitive(false);
set_sensitive(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 :