description.cpp revision 75f37a9204e1316d4884ee3017cffc2bea6b10c5
1494N/A/*
1607N/A * Copyright (C) 2005-2007 Authors:
1494N/A * Ted Gould <ted@gould.cx>
1494N/A * Johan Engelen <johan@shouraizou.nl> *
1494N/A * Released under GNU GPL, read the file 'COPYING' for more information
1494N/A */
1494N/A
1494N/A#ifdef linux // does the dollar sign need escaping when passed as string parameter?
1494N/A# define ESCAPE_DOLLAR_COMMANDLINE
1494N/A#endif
1494N/A
1494N/A#ifdef HAVE_CONFIG_H
1494N/A# include "config.h"
1494N/A#endif
1494N/A
1494N/A
1494N/A#include "description.h"
1494N/A
1494N/A#include <gtkmm/adjustment.h>
1494N/A#include <gtkmm/box.h>
1494N/A#include <gtkmm/spinbutton.h>
1494N/A#include <sstream>
1494N/A#include <glibmm/i18n.h>
1494N/A
1494N/A#include "xml/node.h"
1494N/A#include "extension/extension.h"
1494N/A
1494N/Anamespace Inkscape {
1494N/Anamespace Extension {
1494N/A
1494N/A
1494N/A/** \brief Initialize the object, to do that, copy the data. */
1494N/AParamDescription::ParamDescription (const gchar * name, const gchar * guitext, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, const gchar * gui_tip, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml) :
1500N/A Parameter(name, guitext, desc, scope, gui_hidden, gui_tip, ext), _value(NULL)
1494N/A{
1494N/A // printf("Building Description\n");
1494N/A const char * defaultval = NULL;
1494N/A if (sp_repr_children(xml) != NULL)
1494N/A defaultval = sp_repr_children(xml)->content();
1494N/A
1494N/A if (defaultval != NULL)
1494N/A _value = g_strdup(defaultval);
1494N/A
1611N/A return;
1611N/A}
1494N/A
1512N/A/** \brief Create a label for the description */
1611N/AGtk::Widget *
1611N/AParamDescription::get_widget (SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/, sigc::signal<void> * /*changeSignal*/)
1611N/A{
1500N/A if (_gui_hidden) return NULL;
1494N/A
1607N/A Gtk::Label * label = Gtk::manage(new Gtk::Label(_(_value), Gtk::ALIGN_LEFT));
1494N/A label->set_line_wrap();
1494N/A label->show();
1494N/A
1494N/A Gtk::HBox * hbox = Gtk::manage(new Gtk::HBox(false, 4));
1494N/A hbox->pack_start(*label, true, true, 12);
1494N/A hbox->show();
1494N/A
1494N/A return hbox;
1494N/A}
1494N/A
1494N/A} /* namespace Extension */
1494N/A} /* namespace Inkscape */
1494N/A