summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f0ed14f)
raw | patch | inline | side by side (parent: f0ed14f)
author | cilix42 <cilix42@users.sourceforge.net> | |
Wed, 30 Jul 2008 10:56:10 +0000 (10:56 +0000) | ||
committer | cilix42 <cilix42@users.sourceforge.net> | |
Wed, 30 Jul 2008 10:56:10 +0000 (10:56 +0000) |
index 4b36edf78cf33dee126781358516552bc7ad7954..bf11192dd23cf5778947f4cf93260f310fb8595e 100644 (file)
const Glib::ustring& key, Inkscape::UI::Widget::Registry* wr,
Effect* effect, const Glib::ustring default_value )
: Parameter(label, tip, key, wr, effect),
+ value(default_value),
defvalue(default_value)
{
canvas_text = (SPCanvasText *) sp_canvastext_new(sp_desktop_tempgroup(inkscape_active_desktop()), Geom::Point(0,0), "");
gchar *
TextParam::param_getSVGValue() const
{
- return (gchar *) defvalue.c_str();
+ return (gchar *) value.c_str();
}
Gtk::Widget *
TextParam::param_newWidget(Gtk::Tooltips * /*tooltips*/)
{
- /**
Inkscape::UI::Widget::RegisteredText *rsu = Gtk::manage(new Inkscape::UI::Widget::RegisteredText(
param_label, param_tooltip, param_key, *param_wr, param_effect->getRepr(), param_effect->getSPDoc()));
- rsu->setText("");
+ rsu->setText(value.c_str());
rsu->setProgrammatically = false;
rsu->set_undo_parameters(SP_VERB_DIALOG_LIVE_PATH_EFFECT, _("Change text parameter"));
return dynamic_cast<Gtk::Widget *> (rsu);
- **/
-
- // widget is disabled until it works correctly
- return NULL;
}
void
TextParam::param_setValue(const Glib::ustring newvalue)
{
- defvalue = newvalue;
+ value = newvalue;
sp_canvastext_set_text (canvas_text, newvalue.c_str());
}
index 432ceeed193a82daeebd001d4e9e77a60bd3f9c6..ee47f028f199513017d0f0f1f05084eadb4dd636 100644 (file)
double anchor_x;
double anchor_y;
+ Glib::ustring value;
Glib::ustring defvalue;
SPCanvasText *canvas_text;
index b91e5d998987cf32a8d8a05f47adee3d80c250ea..2cc6e3c62d9121d6cb37e8a21c5c647a1115e5fb 100644 (file)
write_to_xml(os.str().c_str());
set_sensitive(true);
+ setText(os.str().c_str());
+
_wr->setUpdating (false);
}
diff --git a/src/ui/widget/text.cpp b/src/ui/widget/text.cpp
index 974e85054cfb02962fa1ccc943e3b62010efb9a0..3284af54a277354608463debd3be9e8b3fde8fef 100644 (file)
--- a/src/ui/widget/text.cpp
+++ b/src/ui/widget/text.cpp
: Labelled(label, tooltip, new Gtk::Entry(), suffix, icon, mnemonic),
setProgrammatically(false)
{
- //static_cast<Gtk::Entry*>(_widget)->set_numeric();
}
/** Get the text in the entry */
Text::getText() const
{
g_assert(_widget != NULL);
- //return g_strdup_printf("%f", static_cast<Gtk::SpinButton*>(_widget)->get_value());
return static_cast<Gtk::Entry*>(_widget)->get_text().c_str();
}
/** Sets the text of the text entry */
void
-Text::setText(char* text)
+Text::setText(const char* text)
{
g_assert(_widget != NULL);
setProgrammatically = true; // callback is supposed to reset back, if it cares
- //static_cast<Gtk::SpinButton*>(_widget)->set_value(42.43); // FIXME: set correctly
static_cast<Gtk::Entry*>(_widget)->set_text(text); // FIXME: set correctly
}
Glib::SignalProxy0<void>
Text::signal_activate()
{
- //return static_cast<Gtk::SpinButton*>(_widget)->signal_value_changed();
return static_cast<Gtk::Entry*>(_widget)->signal_activate();
}
diff --git a/src/ui/widget/text.h b/src/ui/widget/text.h
index a1ec033555550ccab06a56e6c8db2e9b5604545f..038e6e5dd57a99427de369dab1e72e7d41c5c87d 100644 (file)
--- a/src/ui/widget/text.h
+++ b/src/ui/widget/text.h
const char* getText() const;
- void setText(char* text);
+ void setText(const char* text);
void update();