registered-widget.cpp revision 80db4eb7f4fe34ba6f42344c71338dc8a98302bb
/*
* 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)
* Abhishek Sharma
*
* 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 <gtkmm/radiobutton.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 {
/*#########################################
* Registered CHECKBUTTON
*/
{
}
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, char const *active_str, char const *inactive_str)
{
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::Widget*>::const_iterator i = _slavewidgets.begin(); i != _slavewidgets.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::Widget*>::const_iterator i = _slavewidgets.begin(); i != _slavewidgets.end(); ++i) {
(*i)->set_sensitive(get_active());
}
_wr->setUpdating (false);
}
/*#########################################
* Registered TOGGLEBUTTON
*/
{
}
RegisteredToggleButton::RegisteredToggleButton (const Glib::ustring& label, const Glib::ustring& tip, const Glib::ustring& key, Registry& wr, bool right, Inkscape::XML::Node* repr_in, SPDocument *doc_in, char const *active_str, char const *inactive_str)
{
setProgrammatically = false;
_toggled_connection = signal_toggled().connect (sigc::mem_fun (*this, &RegisteredToggleButton::on_toggled));
}
void
RegisteredToggleButton::setActive (bool b)
{
setProgrammatically = true;
set_active (b);
//The slave button is greyed out if the master button is untoggled
for (std::list<Gtk::Widget*>::const_iterator i = _slavewidgets.begin(); i != _slavewidgets.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 untoggled
for (std::list<Gtk::Widget*>::const_iterator i = _slavewidgets.begin(); i != _slavewidgets.end(); ++i) {
(*i)->set_sensitive(get_active());
}
_wr->setUpdating (false);
}
/*#########################################
* Registered UNITMENU
*/
{
}
RegisteredUnitMenu::RegisteredUnitMenu (const Glib::ustring& label, const Glib::ustring& key, Registry& wr, Inkscape::XML::Node* repr_in, SPDocument *doc_in)
{
_changed_connection = getUnitMenu()->signal_changed().connect (sigc::mem_fun (*this, &RegisteredUnitMenu::on_changed));
}
void
{
}
void
{
if (_wr->isUpdating())
return;
_wr->setUpdating (true);
_wr->setUpdating (false);
}
/*#########################################
* Registered SCALARUNIT
*/
{
}
RegisteredScalarUnit::RegisteredScalarUnit (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)
_um(0)
{
setProgrammatically = false;
setDigits (2);
_value_changed_connection = signal_value_changed().connect (sigc::mem_fun (*this, &RegisteredScalarUnit::on_value_changed));
}
void
{
if (setProgrammatically) {
setProgrammatically = false;
return;
}
if (_wr->isUpdating())
return;
_wr->setUpdating (true);
if (_um)
_wr->setUpdating (false);
}
/*#########################################
* Registered SCALAR
*/
{
}
SPDocument * doc_in )
{
setProgrammatically = false;
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 TEXT
*/
{
}
SPDocument * doc_in )
{
setProgrammatically = false;
setText("");
_activate_connection = signal_activate().connect (sigc::mem_fun (*this, &RegisteredText::on_activate));
}
void
{
if (setProgrammatically) {
setProgrammatically = false;
return;
}
if (_wr->isUpdating()) {
return;
}
_wr->setUpdating (true);
set_sensitive(false);
set_sensitive(true);
_wr->setUpdating (false);
}
/*#########################################
* Registered COLORPICKER
*/
{
_label->set_use_underline (true);
_label->set_mnemonic_widget (*this);
}
{
}
void
{
}
void
{
}
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);
/* TODO: annotate */ "registered-widget.cpp: RegisteredColorPicker::on_changed");
_wr->setUpdating (false);
}
/*#########################################
* Registered SUFFIXEDINTEGER
*/
{
}
RegisteredSuffixedInteger::RegisteredSuffixedInteger (const Glib::ustring& label, const Glib::ustring& tip, const Glib::ustring& suffix, const Glib::ustring& key, Registry& wr, Inkscape::XML::Node* repr_in, SPDocument *doc_in)
setProgrammatically(false)
{
setRange (0, 1e6);
setDigits (0);
_changed_connection = signal_value_changed().connect (sigc::mem_fun(*this, &RegisteredSuffixedInteger::on_value_changed));
}
void
{
if (setProgrammatically) {
setProgrammatically = false;
return;
}
if (_wr->isUpdating())
return;
_wr->setUpdating (true);
_wr->setUpdating (false);
}
/*#########################################
* Registered RADIOBUTTONPAIR
*/
{
}
{
setProgrammatically = false;
_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 TRANSFORMEDPOINT
*/
{
}
RegisteredTransformedPoint::RegisteredTransformedPoint ( const Glib::ustring& label, const Glib::ustring& tip,
SPDocument* doc_in )
{
setDigits (2);
_value_x_changed_connection = signal_x_value_changed().connect (sigc::mem_fun (*this, &RegisteredTransformedPoint::on_value_changed));
_value_y_changed_connection = signal_y_value_changed().connect (sigc::mem_fun (*this, &RegisteredTransformedPoint::on_value_changed));
}
void
{
}
void
{
// check if matrix is singular / has inverse
if ( ! canvas_to_svg.isSingular() ) {
} else {
// set back to default
}
}
void
{
if (setProgrammatically()) {
return;
}
if (_wr->isUpdating())
return;
_wr->setUpdating (true);
_wr->setUpdating (false);
}
/*#########################################
* Registered TRANSFORMEDPOINT
*/
{
}
SPDocument* doc_in )
_polar_coords(false)
{
setDigits (2);
_value_x_changed_connection = signal_x_value_changed().connect (sigc::mem_fun (*this, &RegisteredVector::on_value_changed));
_value_y_changed_connection = signal_y_value_changed().connect (sigc::mem_fun (*this, &RegisteredVector::on_value_changed));
}
void
{
if (!_polar_coords) {
} else {
}
}
void
{
RegisteredVector::setValue(p);
}
{
if (polar_coords) {
} else {
}
}
void
{
if (setProgrammatically()) {
return;
}
if (_wr->isUpdating())
return;
_wr->setUpdating (true);
if (_polar_coords) {
}
_wr->setUpdating (false);
}
/*#########################################
* Registered RANDOM
*/
{
}
SPDocument * doc_in )
{
setProgrammatically = false;
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 :