diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2007-10-28 16:03:07 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2007-10-28 16:03:07 +0000 |
| commit | 96b65f32d922a989131ae91798801ea54c4e8b10 (patch) | |
| tree | 627327d9468b399e064111734831864c4730bc2a /src/live_effects/parameter/path.cpp | |
| parent | added perfectboundcover.inx to translatable extensions (diff) | |
| download | inkscape-96b65f32d922a989131ae91798801ea54c4e8b10.tar.gz inkscape-96b65f32d922a989131ae91798801ea54c4e8b10.zip | |
LPE: implement 'edit next LPE parameter'. Accessible through key '7'.
(bzr r3968)
Diffstat (limited to 'src/live_effects/parameter/path.cpp')
| -rw-r--r-- | src/live_effects/parameter/path.cpp | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/src/live_effects/parameter/path.cpp b/src/live_effects/parameter/path.cpp index db1064511..2b558d2dd 100644 --- a/src/live_effects/parameter/path.cpp +++ b/src/live_effects/parameter/path.cpp @@ -46,6 +46,7 @@ PathParam::PathParam( const Glib::ustring& label, const Glib::ustring& tip, edit_button = NULL; defvalue = g_strdup(default_value); param_readSVGValue(defvalue); + oncanvas_editable = true; } PathParam::~PathParam() @@ -128,18 +129,35 @@ PathParam::param_getWidget() } void -PathParam::on_edit_button_click() +PathParam::param_editOncanvas(SPItem * item, SPDesktop * dt) { - // Switch to node edit tool: - tools_switch_current(TOOLS_NODES); + // If not already in nodecontext, goto it! + if (!tools_isactive(dt, TOOLS_NODES)) { + tools_switch_current(TOOLS_NODES); + } - // set this parameter to edit: - ShapeEditor * shape_editor = SP_NODE_CONTEXT( SP_ACTIVE_DESKTOP->event_context )->shape_editor; - SPItem * item = sp_desktop_selection(SP_ACTIVE_DESKTOP)->singleItem(); + ShapeEditor * shape_editor = SP_NODE_CONTEXT( dt->event_context )->shape_editor; shape_editor->set_item_livepatheffect_parameter(item, SP_OBJECT(param_effect->getLPEObj()), param_key.c_str()); } void +PathParam::param_write_to_repr(const char * svgd) +{ + param_effect->getRepr()->setAttribute(param_key.c_str(), svgd); +} + + +/* CALLBACK FUNCTIONS FOR THE BUTTONS */ +void +PathParam::on_edit_button_click() +{ + SPItem * item = sp_desktop_selection(SP_ACTIVE_DESKTOP)->singleItem(); + if (item != NULL) { + param_editOncanvas(item, SP_ACTIVE_DESKTOP); + } +} + +void PathParam::on_paste_button_click() { // check if something is in the clipboard @@ -170,12 +188,6 @@ PathParam::on_paste_button_click() } } -void -PathParam::param_write_to_repr(const char * svgd) -{ - param_effect->getRepr()->setAttribute(param_key.c_str(), svgd); -} - } /* namespace LivePathEffect */ |
