From 63273692c4e638b46a9e84026f62721784ec2cb4 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Tue, 15 Jan 2008 14:29:14 +0000 Subject: prepare LPE parameter widgets to be owned by multiple dialogs, as it should be. For each parameter function that has not been re-implemented, a warning is issued. Sorry for the huge number of warnings showing when working with LPE. It is important to fix this asap. (bzr r4495) --- src/live_effects/parameter/path.cpp | 67 ++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 38 deletions(-) (limited to 'src/live_effects/parameter/path.cpp') diff --git a/src/live_effects/parameter/path.cpp b/src/live_effects/parameter/path.cpp index 1f0e6f3be..59655d62e 100644 --- a/src/live_effects/parameter/path.cpp +++ b/src/live_effects/parameter/path.cpp @@ -42,8 +42,6 @@ PathParam::PathParam( const Glib::ustring& label, const Glib::ustring& tip, Effect* effect, const gchar * default_value) : Parameter(label, tip, key, wr, effect) { - _widget = NULL; - _tooltips = NULL; edit_button = NULL; defvalue = g_strdup(default_value); param_readSVGValue(defvalue); @@ -52,10 +50,6 @@ PathParam::PathParam( const Glib::ustring& label, const Glib::ustring& tip, PathParam::~PathParam() { - if (_tooltips) - delete _tooltips; - // _widget is managed by GTK so do not delete! - g_free(defvalue); } @@ -92,40 +86,37 @@ PathParam::param_writeSVGValue() const } Gtk::Widget * -PathParam::param_getWidget() +PathParam::param_newWidget(Gtk::Tooltips * tooltips) { - if (!_widget) { - _widget = Gtk::manage(new Gtk::HBox()); - _tooltips = new Gtk::Tooltips(); - - Gtk::Label* pLabel = Gtk::manage(new Gtk::Label(param_label)); - static_cast(_widget)->pack_start(*pLabel, true, true); - _tooltips->set_tip(*pLabel, param_tooltip); - - Gtk::Widget* pIcon = Gtk::manage( sp_icon_get_icon( "draw_node", Inkscape::ICON_SIZE_BUTTON) ); - Gtk::Button * pButton = Gtk::manage(new Gtk::Button()); - pButton->set_relief(Gtk::RELIEF_NONE); - pIcon->show(); - pButton->add(*pIcon); - pButton->show(); - pButton->signal_clicked().connect(sigc::mem_fun(*this, &PathParam::on_edit_button_click)); - static_cast(_widget)->pack_start(*pButton, true, true); - _tooltips->set_tip(*pButton, _("Edit on-canvas")); - edit_button = pButton; - - pIcon = Gtk::manage( sp_icon_get_icon( GTK_STOCK_PASTE, Inkscape::ICON_SIZE_BUTTON) ); - pButton = Gtk::manage(new Gtk::Button()); - pButton->set_relief(Gtk::RELIEF_NONE); - pIcon->show(); - pButton->add(*pIcon); - pButton->show(); - pButton->signal_clicked().connect(sigc::mem_fun(*this, &PathParam::on_paste_button_click)); - static_cast(_widget)->pack_start(*pButton, true, true); - _tooltips->set_tip(*pButton, _("Paste path")); - - static_cast(_widget)->show_all_children(); + Gtk::HBox * _widget = Gtk::manage(new Gtk::HBox()); + + Gtk::Label* pLabel = Gtk::manage(new Gtk::Label(param_label)); + static_cast(_widget)->pack_start(*pLabel, true, true); + tooltips->set_tip(*pLabel, param_tooltip); + + Gtk::Widget* pIcon = Gtk::manage( sp_icon_get_icon( "draw_node", Inkscape::ICON_SIZE_BUTTON) ); + Gtk::Button * pButton = Gtk::manage(new Gtk::Button()); + pButton->set_relief(Gtk::RELIEF_NONE); + pIcon->show(); + pButton->add(*pIcon); + pButton->show(); + pButton->signal_clicked().connect(sigc::mem_fun(*this, &PathParam::on_edit_button_click)); + static_cast(_widget)->pack_start(*pButton, true, true); + tooltips->set_tip(*pButton, _("Edit on-canvas")); + edit_button = pButton; + + pIcon = Gtk::manage( sp_icon_get_icon( GTK_STOCK_PASTE, Inkscape::ICON_SIZE_BUTTON) ); + pButton = Gtk::manage(new Gtk::Button()); + pButton->set_relief(Gtk::RELIEF_NONE); + pIcon->show(); + pButton->add(*pIcon); + pButton->show(); + pButton->signal_clicked().connect(sigc::mem_fun(*this, &PathParam::on_paste_button_click)); + static_cast(_widget)->pack_start(*pButton, true, true); + tooltips->set_tip(*pButton, _("Paste path")); + + static_cast(_widget)->show_all_children(); - } return dynamic_cast (_widget); } -- cgit v1.2.3