X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Ftools-switch.cpp;h=e32d8d13d27610869513e3455b97b084443a8a2a;hb=b26cc655b98659f4a33794ee9169b67d908b824b;hp=017aed979e26d66bbdc0437e6121f13fcb45e716;hpb=49de36d0e55a6f5d0c89c00864641df22362049e;p=inkscape.git diff --git a/src/tools-switch.cpp b/src/tools-switch.cpp index 017aed979..e32d8d13d 100644 --- a/src/tools-switch.cpp +++ b/src/tools-switch.cpp @@ -15,6 +15,9 @@ # include "config.h" #endif +#include +#include + #include "inkscape-private.h" #include "desktop.h" #include "desktop-handles.h" @@ -24,9 +27,12 @@ #include "select-context.h" #include "node-context.h" +#include "tweak-context.h" #include "sp-path.h" #include "rect-context.h" #include "sp-rect.h" +#include "box3d-context.h" +#include "box3d.h" #include "arc-context.h" #include "sp-ellipse.h" #include "star-context.h" @@ -34,6 +40,7 @@ #include "spiral-context.h" #include "sp-spiral.h" #include "dyna-draw-context.h" +#include "eraser-context.h" #include "pen-context.h" #include "pencil-context.h" #include "text-context.h" @@ -43,6 +50,7 @@ #include "zoom-context.h" #include "dropper-context.h" #include "connector-context.h" +#include "flood-context.h" #include "sp-offset.h" #include "message-context.h" @@ -52,7 +60,9 @@ static char const *const tool_names[] = { NULL, "tools.select", "tools.nodes", + "tools.tweak", "tools.shapes.rect", + "tools.shapes.3dbox", "tools.shapes.arc", "tools.shapes.star", "tools.shapes.spiral", @@ -64,6 +74,8 @@ static char const *const tool_names[] = { "tools.zoom", "tools.dropper", "tools.connector", + "tools.paintbucket", + "tools.eraser", NULL }; @@ -71,7 +83,9 @@ static char const *const tool_ids[] = { NULL, "select", "nodes", + "tweak", "rect", + "3dbox", "arc", "star", "spiral", @@ -83,6 +97,8 @@ static char const *const tool_ids[] = { "zoom", "dropper", "connector", + "paintbucket", + "eraser", NULL }; @@ -134,12 +150,24 @@ tools_switch(SPDesktop *dt, int num) inkscape_eventcontext_set(sp_desktop_event_context(dt)); dt->tipsMessageContext()->set(Inkscape::NORMAL_MESSAGE, _("To edit a path, click, Shift+click, or drag around nodes to select them, then drag nodes and handles. Click on an object to select.")); break; + case TOOLS_TWEAK: + dt->set_event_context(SP_TYPE_TWEAK_CONTEXT, tool_names[num]); + dt->activate_guides(true); + inkscape_eventcontext_set(sp_desktop_event_context(dt)); + dt->tipsMessageContext()->set(Inkscape::NORMAL_MESSAGE, _("To tweak a path by pushing, select it and drag over it.")); + break; case TOOLS_SHAPES_RECT: dt->set_event_context(SP_TYPE_RECT_CONTEXT, tool_names[num]); dt->activate_guides(false); inkscape_eventcontext_set(sp_desktop_event_context(dt)); dt->tipsMessageContext()->set(Inkscape::NORMAL_MESSAGE, _("Drag to create a rectangle. Drag controls to round corners and resize. Click to select.")); break; + case TOOLS_SHAPES_3DBOX: + dt->set_event_context(SP_TYPE_BOX3D_CONTEXT, tool_names[num]); + dt->activate_guides(false); + inkscape_eventcontext_set(sp_desktop_event_context(dt)); + dt->tipsMessageContext()->set(Inkscape::NORMAL_MESSAGE, _("Drag to create a 3D box. Drag controls to resize in perspective. Click to select (with Ctrl+Alt for single faces).")); + break; case TOOLS_SHAPES_ARC: dt->set_event_context(SP_TYPE_ARC_CONTEXT, tool_names[num]); dt->activate_guides(false); @@ -162,19 +190,19 @@ tools_switch(SPDesktop *dt, int num) dt->set_event_context(SP_TYPE_PENCIL_CONTEXT, tool_names[num]); dt->activate_guides(false); inkscape_eventcontext_set(sp_desktop_event_context(dt)); - dt->tipsMessageContext()->set(Inkscape::NORMAL_MESSAGE, _("Drag to create a freehand line. Start drawing with Shift to append to selected path.")); + dt->tipsMessageContext()->set(Inkscape::NORMAL_MESSAGE, _("Drag to create a freehand line. Start drawing with Shift to append to selected path. Ctrl+click to create single dots.")); break; case TOOLS_FREEHAND_PEN: dt->set_event_context(SP_TYPE_PEN_CONTEXT, tool_names[num]); dt->activate_guides(false); inkscape_eventcontext_set(sp_desktop_event_context(dt)); - dt->tipsMessageContext()->set(Inkscape::NORMAL_MESSAGE, _("Click or click and drag to start a path; with Shift to append to selected path.")); + dt->tipsMessageContext()->set(Inkscape::NORMAL_MESSAGE, _("Click or click and drag to start a path; with Shift to append to selected path. Ctrl+click to create single dots.")); break; case TOOLS_CALLIGRAPHIC: dt->set_event_context(SP_TYPE_DYNA_DRAW_CONTEXT, tool_names[num]); dt->activate_guides(false); inkscape_eventcontext_set(sp_desktop_event_context(dt)); - dt->tipsMessageContext()->set(Inkscape::NORMAL_MESSAGE, _("Drag to paint a calligraphic stroke. Left/right arrow keys adjust width, up/down adjust angle.")); + dt->tipsMessageContext()->set(Inkscape::NORMAL_MESSAGE, _("Drag to draw a calligraphic stroke; with Ctrl to track a guide, with Alt to thin/thicken. Arrow keys adjust width (left/right) and angle (up/down).")); break; case TOOLS_TEXT: dt->set_event_context(SP_TYPE_TEXT_CONTEXT, tool_names[num]); @@ -206,6 +234,18 @@ tools_switch(SPDesktop *dt, int num) inkscape_eventcontext_set(sp_desktop_event_context(dt)); dt->tipsMessageContext()->set(Inkscape::NORMAL_MESSAGE, _("Click and drag between shapes to create a connector.")); break; + case TOOLS_PAINTBUCKET: + dt->set_event_context(SP_TYPE_FLOOD_CONTEXT, tool_names[num]); + dt->activate_guides(false); + inkscape_eventcontext_set(sp_desktop_event_context(dt)); + dt->tipsMessageContext()->set(Inkscape::NORMAL_MESSAGE, _("Click to paint a bounded area, Shift+click to union the new fill with the current selection, Ctrl+click to change the clicked object's fill and stroke to the current setting.")); + break; + case TOOLS_ERASER: + dt->set_event_context(SP_TYPE_ERASER_CONTEXT, tool_names[num]); + dt->activate_guides(false); + inkscape_eventcontext_set(sp_desktop_event_context(dt)); + dt->tipsMessageContext()->set(Inkscape::NORMAL_MESSAGE, _("Drag to erase.")); + break; } } @@ -220,6 +260,8 @@ void tools_switch_by_item(SPDesktop *dt, SPItem *item) { if (SP_IS_RECT(item)) { tools_switch(dt, TOOLS_SHAPES_RECT); + } else if (SP_IS_BOX3D(item)) { + tools_switch(dt, TOOLS_SHAPES_3DBOX); } else if (SP_IS_GENERICELLIPSE(item)) { tools_switch(dt, TOOLS_SHAPES_ARC); } else if (SP_IS_STAR(item)) {