Code

Fixed messed up transformations because of a missing cairo_restore() and removed...
[inkscape.git] / src / extension / paramdescription.cpp
1 /*
2  * Copyright (C) 2005-2007 Authors:
3  *   Ted Gould <ted@gould.cx>
4  *   Johan Engelen <johan@shouraizou.nl> *
5  * Released under GNU GPL, read the file 'COPYING' for more information
6  */
8 #ifdef linux  // does the dollar sign need escaping when passed as string parameter?
9 # define ESCAPE_DOLLAR_COMMANDLINE
10 #endif
12 #ifdef HAVE_CONFIG_H
13 # include "config.h"
14 #endif
17 #include "paramdescription.h"
19 #include <gtkmm/adjustment.h>
20 #include <gtkmm/box.h>
21 #include <gtkmm/spinbutton.h>
22 #include <sstream>
25 #include <glibmm/i18n.h>
27 #include <xml/node.h>
29 #include "extension.h"
30 #include "prefs-utils.h"
32 namespace Inkscape {
33 namespace Extension {
36 /** \brief  Initialize the object, to do that, copy the data. */
37 ParamDescription::ParamDescription (const gchar * name, const gchar * guitext, const gchar * desc, const Parameter::_scope_t scope, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml) :
38     Parameter(name, guitext, desc, scope, ext), _value(NULL)
39 {
40     // printf("Building Description\n");
41     const char * defaultval = NULL;
42     if (sp_repr_children(xml) != NULL)
43         defaultval = sp_repr_children(xml)->content();
45     if (defaultval != NULL)
46         _value = g_strdup(defaultval);
48     return;
49 }
51 /** \brief  Create a label for the description */
52 Gtk::Widget *
53 ParamDescription::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal<void> * changeSignal)
54 {
55     Gtk::Label * label = Gtk::manage(new Gtk::Label(_(_value)));
56     label->set_line_wrap();
57     label->show();
59     Gtk::HBox * hbox = Gtk::manage(new Gtk::HBox(false, 4));
60     hbox->pack_start(*label, true, true, 5);
61     hbox->show();
63     return hbox;
64 }
66 }  /* namespace Extension */
67 }  /* namespace Inkscape */