summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2008-01-16 20:28:24 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2008-01-16 20:28:24 +0000
commit2da0ea615f4e8293e8937eb38cc3a502a4be0355 (patch)
tree21423803f37b1d14c9537980b260b9f288304fad /src/ui
parentRegisteredEnum is now subclassed from RegisteredWidget<enum> instead of old R... (diff)
downloadinkscape-2da0ea615f4e8293e8937eb38cc3a502a4be0355.tar.gz
inkscape-2da0ea615f4e8293e8937eb38cc3a502a4be0355.zip
remove unnecessary cast + cosmetic changes.
(bzr r4524)
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/widget/registered-widget.cpp35
-rw-r--r--src/ui/widget/registered-widget.h70
2 files changed, 63 insertions, 42 deletions
diff --git a/src/ui/widget/registered-widget.cpp b/src/ui/widget/registered-widget.cpp
index f471dc40d..4d0e05e98 100644
--- a/src/ui/widget/registered-widget.cpp
+++ b/src/ui/widget/registered-widget.cpp
@@ -41,8 +41,6 @@ namespace Inkscape {
namespace UI {
namespace Widget {
-//===================================================
-
void
RegisteredWdg::write_to_xml(const char * svgstr)
{
@@ -70,7 +68,9 @@ RegisteredWdg::write_to_xml(const char * svgstr)
}
-//====================================================
+/*#########################################
+ * Registered CHECKBUTTON
+ */
RegisteredCheckButton::~RegisteredCheckButton()
{
@@ -125,6 +125,11 @@ RegisteredCheckButton::on_toggled()
_wr->setUpdating (false);
}
+
+/*#########################################
+ * Registered UNITMENU
+ */
+
RegisteredUnitMenu::RegisteredUnitMenu()
: _label(0), _sel(0)
{
@@ -173,6 +178,10 @@ RegisteredUnitMenu::on_changed()
}
+/*#########################################
+ * Registered SCALARUNIT
+ */
+
RegisteredScalarUnit::RegisteredScalarUnit()
: _widget(0), _um(0)
{
@@ -358,6 +367,11 @@ RegisteredColorPicker::on_changed (guint32 rgba)
_wr->setUpdating (false);
}
+
+/*#########################################
+ * Registered SUFFIXEDINTEGER
+ */
+
RegisteredSuffixedInteger::RegisteredSuffixedInteger()
: _label(0),
setProgrammatically(false),
@@ -422,6 +436,11 @@ RegisteredSuffixedInteger::on_value_changed()
_wr->setUpdating (false);
}
+
+/*#########################################
+ * Registered RADIOBUTTONPAIR
+ */
+
RegisteredRadioButtonPair::RegisteredRadioButtonPair()
: _hbox(0),
setProgrammatically(false)
@@ -487,6 +506,7 @@ RegisteredRadioButtonPair::on_value_changed()
_wr->setUpdating (false);
}
+
/*#########################################
* Registered POINT
*/
@@ -497,8 +517,8 @@ RegisteredPoint::~RegisteredPoint()
_value_y_changed_connection.disconnect();
}
-RegisteredPoint::RegisteredPoint ( const Glib::ustring& label, const Glib::ustring& tip,
- const Glib::ustring& key, Registry& wr, Inkscape::XML::Node* repr_in,
+RegisteredPoint::RegisteredPoint ( const Glib::ustring& label, const Glib::ustring& tip,
+ const Glib::ustring& key, Registry& wr, Inkscape::XML::Node* repr_in,
SPDocument* doc_in )
: RegisteredWidget<Point> (label, tip)
{
@@ -532,6 +552,7 @@ RegisteredPoint::on_value_changed()
_wr->setUpdating (false);
}
+
/*#########################################
* Registered RANDOM
*/
@@ -542,7 +563,7 @@ RegisteredRandom::~RegisteredRandom()
_reseeded_connection.disconnect();
}
-RegisteredRandom::RegisteredRandom ( const Glib::ustring& label, const Glib::ustring& tip,
+RegisteredRandom::RegisteredRandom ( const Glib::ustring& label, const Glib::ustring& tip,
const Glib::ustring& key, Registry& wr, Inkscape::XML::Node* repr_in,
SPDocument * doc_in )
: RegisteredWidget<Random> (label, tip)
@@ -559,7 +580,7 @@ RegisteredRandom::RegisteredRandom ( const Glib::ustring& label, const Glib::ust
void
RegisteredRandom::setValue (double val, long startseed)
{
- static_cast<Scalar*>(this)->setValue (val);
+ Scalar::setValue (val);
setStartSeed(startseed);
}
diff --git a/src/ui/widget/registered-widget.h b/src/ui/widget/registered-widget.h
index 900eaafbb..3d99aec5b 100644
--- a/src/ui/widget/registered-widget.h
+++ b/src/ui/widget/registered-widget.h
@@ -205,8 +205,8 @@ public:
Registry& wr,
Inkscape::XML::Node* repr_in,
SPDocument *doc_in);
- inline void init ( const Glib::ustring& label,
- const Glib::ustring& key,
+ inline void init ( const Glib::ustring& label,
+ const Glib::ustring& key,
Registry& wr)
{ init(label, key, wr, NULL, NULL); };
@@ -266,19 +266,19 @@ class RegisteredColorPicker : public RegisteredWdg {
public:
RegisteredColorPicker();
~RegisteredColorPicker();
- void init (const Glib::ustring& label,
- const Glib::ustring& title,
- const Glib::ustring& tip,
- const Glib::ustring& ckey,
+ void 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);
- inline void init ( const Glib::ustring& label,
- const Glib::ustring& title,
- const Glib::ustring& tip,
- const Glib::ustring& ckey,
- const Glib::ustring& akey,
+ inline void init ( const Glib::ustring& label,
+ const Glib::ustring& title,
+ const Glib::ustring& tip,
+ const Glib::ustring& ckey,
+ const Glib::ustring& akey,
Registry& wr)
{ init(label, title, tip, ckey, akey, wr, NULL, NULL); };
@@ -298,22 +298,22 @@ class RegisteredSuffixedInteger : public RegisteredWdg {
public:
RegisteredSuffixedInteger();
~RegisteredSuffixedInteger();
- void init (const Glib::ustring& label1,
- const Glib::ustring& label2,
+ void init (const Glib::ustring& label1,
+ const Glib::ustring& label2,
const Glib::ustring& key,
Registry& wr,
Inkscape::XML::Node* repr_in,
SPDocument *doc_in);
- inline void init ( const Glib::ustring& label1,
- const Glib::ustring& label2,
- const Glib::ustring& key,
+ inline void init ( const Glib::ustring& label1,
+ const Glib::ustring& label2,
+ const Glib::ustring& key,
Registry& wr)
{ init(label1, label2, key, wr, NULL, NULL); };
void setValue (int);
Gtk::Label *_label;
Gtk::HBox _hbox;
- bool setProgrammatically; // true if the value was set by setValue, not changed by the user;
+ bool setProgrammatically; // true if the value was set by setValue, not changed by the user;
// if a callback checks it, it must reset it back to false
protected:
@@ -328,28 +328,28 @@ class RegisteredRadioButtonPair : public RegisteredWdg {
public:
RegisteredRadioButtonPair();
~RegisteredRadioButtonPair();
- void init (const Glib::ustring& label,
- const Glib::ustring& label1,
- const Glib::ustring& label2,
- const Glib::ustring& tip1,
- const Glib::ustring& tip2,
+ void init (const Glib::ustring& label,
+ const Glib::ustring& label1,
+ const Glib::ustring& label2,
+ const Glib::ustring& tip1,
+ const Glib::ustring& tip2,
const Glib::ustring& key,
Registry& wr,
Inkscape::XML::Node* repr_in,
SPDocument *doc_in);
- inline void init ( const Glib::ustring& label,
- const Glib::ustring& label1,
- const Glib::ustring& label2,
- const Glib::ustring& tip1,
- const Glib::ustring& tip2,
- const Glib::ustring& key,
+ inline void init ( const Glib::ustring& label,
+ const Glib::ustring& label1,
+ const Glib::ustring& label2,
+ const Glib::ustring& tip1,
+ const Glib::ustring& tip2,
+ const Glib::ustring& key,
Registry& wr)
{ init(label, label1, label2, tip1, tip2, key, wr, NULL, NULL); };
void setValue (bool second);
Gtk::HBox *_hbox;
- bool setProgrammatically; // true if the value was set by setValue, not changed by the user;
+ bool setProgrammatically; // true if the value was set by setValue, not changed by the user;
// if a callback checks it, it must reset it back to false
protected:
Gtk::RadioButton *_rb1, *_rb2;
@@ -361,9 +361,9 @@ protected:
class RegisteredPoint : public RegisteredWidget<Point> {
public:
virtual ~RegisteredPoint();
- RegisteredPoint ( const Glib::ustring& label,
- const Glib::ustring& tip,
- const Glib::ustring& key,
+ RegisteredPoint ( const Glib::ustring& label,
+ const Glib::ustring& tip,
+ const Glib::ustring& key,
Registry& wr,
Inkscape::XML::Node* repr_in = NULL,
SPDocument *doc_in = NULL );
@@ -378,9 +378,9 @@ protected:
class RegisteredRandom : public RegisteredWidget<Random> {
public:
virtual ~RegisteredRandom();
- RegisteredRandom ( const Glib::ustring& label,
- const Glib::ustring& tip,
- const Glib::ustring& key,
+ RegisteredRandom ( const Glib::ustring& label,
+ const Glib::ustring& tip,
+ const Glib::ustring& key,
Registry& wr,
Inkscape::XML::Node* repr_in = NULL,
SPDocument *doc_in = NULL);