Code

string fixes from bug 1516157
[inkscape.git] / src / extension / parameter.cpp
index 3fe9cac65e0895f35fafafe552116d8c97bc5721..70f66c41660c37995e4dc63f1b332797f5358ab0 100644 (file)
@@ -3,10 +3,11 @@
  */
 
 /*
- * Authors:
+ * Author:
  *   Ted Gould <ted@gould.cx>
  *
- * Copyright (C) 2005-2006 Authors
+ * Copyright (C) 2006 Johan Engelen <johan@shouraizou.nl>
+ * Copyright (C) 2005-2006 Author
  *
  * Released under GNU GPL, read the file 'COPYING' for more information
  */
@@ -30,6 +31,8 @@
 #include "sp-object.h"
 
 #include "parameter.h"
+#include "paramnotebook.h"
+#include "paramenum.h"
 
 /** \brief  The root directory in the preferences database for extension
             related parameters. */
@@ -239,6 +242,7 @@ public:
     Glib::ustring * string (void);
 }; /* class ParamEnum */
 
+
 /**
     \return None
     \brief  This function creates a parameter that can be used later.  This
@@ -309,7 +313,9 @@ Parameter::make (Inkscape::XML::Node * in_repr, Inkscape::Extension::Extension *
     } else if (!strcmp(type, "description")) {
         param = new ParamDescription(name, guitext, desc, scope, in_ext, in_repr);
     } else if (!strcmp(type, "enum")) {
-        param = new ParamEnum(name, guitext, desc, scope, in_ext, in_repr);
+        param = new ParamComboBox(name, guitext, desc, scope, in_ext, in_repr);
+    } else if (!strcmp(type, "notebook")) {
+        param = new ParamNotebook(name, guitext, desc, scope, in_ext, in_repr);
     }
 
     /* Note: param could equal NULL */
@@ -694,7 +700,7 @@ ParamIntAdjustment::val_changed (void)
 Gtk::Widget *
 ParamFloat::get_widget (SPDocument * doc, Inkscape::XML::Node * node)
 {
-    Gtk::HBox * hbox = Gtk::manage(new Gtk::HBox());
+    Gtk::HBox * hbox = Gtk::manage(new Gtk::HBox(false, 4));
 
     Gtk::Label * label = Gtk::manage(new Gtk::Label(_(_text), Gtk::ALIGN_LEFT));
     label->show();
@@ -718,7 +724,7 @@ ParamFloat::get_widget (SPDocument * doc, Inkscape::XML::Node * node)
 Gtk::Widget *
 ParamInt::get_widget (SPDocument * doc, Inkscape::XML::Node * node)
 {
-    Gtk::HBox * hbox = Gtk::manage(new Gtk::HBox());
+    Gtk::HBox * hbox = Gtk::manage(new Gtk::HBox(false, 4));
 
     Gtk::Label * label = Gtk::manage(new Gtk::Label(_(_text), Gtk::ALIGN_LEFT));
     label->show();
@@ -779,7 +785,7 @@ ParamBoolCheckButton::on_toggle (void)
 Gtk::Widget *
 ParamBool::get_widget (SPDocument * doc, Inkscape::XML::Node * node)
 {
-    Gtk::HBox * hbox = Gtk::manage(new Gtk::HBox());
+    Gtk::HBox * hbox = Gtk::manage(new Gtk::HBox(false, 4));
 
     Gtk::Label * label = Gtk::manage(new Gtk::Label(_(_text), Gtk::ALIGN_LEFT));
     label->show();
@@ -835,15 +841,15 @@ ParamStringEntry::changed_text (void)
 Gtk::Widget *
 ParamString::get_widget (SPDocument * doc, Inkscape::XML::Node * node)
 {
-    Gtk::HBox * hbox = Gtk::manage(new Gtk::HBox());
+    Gtk::HBox * hbox = Gtk::manage(new Gtk::HBox(false, 4));
 
     Gtk::Label * label = Gtk::manage(new Gtk::Label(_(_text), Gtk::ALIGN_LEFT));
     label->show();
-    hbox->pack_start(*label, true, true);
+    hbox->pack_start(*label, false, false);
 
     ParamStringEntry * textbox = new ParamStringEntry(this, doc, node);
     textbox->show();
-    hbox->pack_start(*textbox, false, false);
+    hbox->pack_start(*textbox, true, true);
 
     hbox->show();
 
@@ -903,7 +909,7 @@ ParamDescription::get_widget (SPDocument * doc, Inkscape::XML::Node * node)
     label->set_line_wrap();
     label->show();
 
-    Gtk::HBox * hbox = Gtk::manage(new Gtk::HBox());
+    Gtk::HBox * hbox = Gtk::manage(new Gtk::HBox(false, 4));
     hbox->pack_start(*label, true, true, 5);
     hbox->show();
 
@@ -931,6 +937,11 @@ ParamEnum::ParamEnum (const gchar * name, const gchar * guitext, const gchar * d
     return;
 }
 
+ParamEnum::~ParamEnum (void)
+{
+
+}
+
 /** \brief  Return the value as a string */
 Glib::ustring *
 ParamEnum::string (void)