Code

a bunch of small changes to provide a user readable explanation of filters
[inkscape.git] / src / tools-switch.cpp
index 3393263599c17c0f1348a647c723e5171b0b40a7..c6251fe5bd77595ddb711b41cc1a6a1d70deaadd 100644 (file)
 
 #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"
@@ -53,7 +56,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",
@@ -73,7 +78,9 @@ static char const *const tool_ids[] = {
     NULL,
     "select",
     "nodes",
+    "tweak",
     "rect",
+    "3dbox",
     "arc",
     "star",
     "spiral",
@@ -137,12 +144,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, <b>click</b>, <b>Shift+click</b>, or <b>drag around</b> nodes to select them, then <b>drag</b> nodes and handles. <b>Click</b> 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, _("<b>Drag</b> to create a rectangle. <b>Drag controls</b> to round corners and resize. <b>Click</b> 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, _("<b>Drag</b> to create a 3D box. <b>Drag controls</b> to resize in perspective. <b>Click</b> to select (with <b>Ctrl+Alt</b> for single faces)."));
+            break;
         case TOOLS_SHAPES_ARC:
             dt->set_event_context(SP_TYPE_ARC_CONTEXT, tool_names[num]);
             dt->activate_guides(false);
@@ -165,13 +184,13 @@ 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, _("<b>Drag</b> to create a freehand line. Start drawing with <b>Shift</b> to append to selected path."));
+            dt->tipsMessageContext()->set(Inkscape::NORMAL_MESSAGE, _("<b>Drag</b> to create a freehand line. Start drawing with <b>Shift</b> to append to selected path. <b>Ctrl+click</b> 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, _("<b>Click</b> or <b>click and drag</b> to start a path; with <b>Shift</b> to append to selected path."));
+            dt->tipsMessageContext()->set(Inkscape::NORMAL_MESSAGE, _("<b>Click</b> or <b>click and drag</b> to start a path; with <b>Shift</b> to append to selected path. <b>Ctrl+click</b> to create single dots."));
             break;
         case TOOLS_CALLIGRAPHIC:
             dt->set_event_context(SP_TYPE_DYNA_DRAW_CONTEXT, tool_names[num]);
@@ -229,6 +248,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)) {