summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a033436)
raw | patch | inline | side by side (parent: a033436)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Fri, 23 Nov 2007 19:40:07 +0000 (19:40 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Fri, 23 Nov 2007 19:40:07 +0000 (19:40 +0000) |
src/ui/widget/registered-enums.h | patch | blob | history | |
src/ui/widget/registered-widget.cpp | patch | blob | history |
index 6dfa48b7af18adf1485ca29e0796a07319b9cf93..0a17aeca369936230a335e657dc5a50bb33afef8 100644 (file)
}
void set_active_by_id (E id) {
- combobox()->set_active_by_id(id);
+ ComboBoxEnum<E> * cb = combobox();
+ if (cb)
+ cb->set_active_by_id(id);
};
void set_active_by_key (const Glib::ustring& key) {
- combobox()->set_active_by_key(key);
+ ComboBoxEnum<E> * cb = combobox();
+ if (cb)
+ cb->set_active_by_key(key);
}
inline const Util::EnumData<E>* get_active_data() {
- return combobox()->get_active_data();
+ ComboBoxEnum<E> * cb = combobox();
+ if (cb)
+ return cb->get_active_data();
+ else
+ return NULL;
}
ComboBoxEnum<E> * combobox() {
index 804a403f6dab0d73db055963b6137a05aba0379f..1ee52cc99cfc2e430c551eb3dc891748d3f63fcc 100644 (file)
void
RegisteredScalarUnit::setValue (double val)
{
- _widget->setValue (val);
+ if (_widget)
+ _widget->setValue (val);
}
void
RegisteredScalarUnit::on_value_changed()
{
+g_message("on_value_changed");
if (_widget->setProgrammatically) {
_widget->setProgrammatically = false;
return;
}
+g_message("on_value_changed1");
if (_wr->isUpdating())
return;
void
RegisteredScalar::setValue (double val)
{
- _widget->setValue (val);
+ if (_widget)
+ _widget->setValue (val);
}
void
@@ -483,9 +487,15 @@ const Glib::ustring& key, Registry& wr, Inkscape::XML::Node* repr_in, SPDocument
void
RegisteredRadioButtonPair::setValue (bool second)
{
+ if (!_rb1 || !_rb2)
+ return;
+
setProgrammatically = true;
- if (second) _rb2->set_active();
- else _rb1->set_active();
+ if (second) {
+ _rb2->set_active();
+ } else {
+ _rb1->set_active();
+ }
}
void
void
RegisteredPoint::setValue (double xval, double yval)
{
- _widget->setValue(xval, yval);
+ if (_widget)
+ _widget->setValue(xval, yval);
}
void
void
RegisteredRandom::setValue (double val, long startseed)
{
+ if (!_widget)
+ return;
+
_widget->setValue (val);
_widget->setStartSeed(startseed);
}