Code

Filter effects dialog:
[inkscape.git] / src / tools-switch.cpp
index d42354e8dae86083fc4e7cca0ebeafe84a02c1b2..fd8acad235fb9e95a803b292ce471e432e26be50 100644 (file)
@@ -2,9 +2,10 @@
  * Utility functions for switching tools (= contexts)
  *
  * Authors:
- *   bulia byak <bulia@dr.com>
+ *   bulia byak <buliabyak@users.sf.net>
+ *   Josh Andler <scislac@users.sf.net>
  *
- * Copyright (C) 2003 authors
+ * Copyright (C) 2003-2007 authors
  *
  * Released under GNU GPL, read the file 'COPYING' for more information
  */
@@ -26,6 +27,8 @@
 #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"
@@ -42,6 +45,8 @@
 #include "zoom-context.h"
 #include "dropper-context.h"
 #include "connector-context.h"
+#include "flood-context.h"
+#include "sp-offset.h"
 #include "message-context.h"
 
 #include "tools-switch.h"
@@ -51,6 +56,7 @@ static char const *const tool_names[] = {
     "tools.select",
     "tools.nodes",
     "tools.shapes.rect",
+    "tools.shapes.3dbox",
     "tools.shapes.arc",
     "tools.shapes.star",
     "tools.shapes.spiral",
@@ -62,6 +68,7 @@ static char const *const tool_names[] = {
     "tools.zoom",
     "tools.dropper",
     "tools.connector",
+    "tools.paintbucket",
     NULL
 };
 
@@ -70,6 +77,7 @@ static char const *const tool_ids[] = {
     "select",
     "nodes",
     "rect",
+    "3dbox",
     "arc",
     "star",
     "spiral",
@@ -81,6 +89,7 @@ static char const *const tool_ids[] = {
     "zoom",
     "dropper",
     "connector",
+    "paintbucket",
     NULL
 };
 
@@ -138,6 +147,12 @@ tools_switch(SPDesktop *dt, int num)
             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_3DBOX_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);
@@ -172,7 +187,7 @@ tools_switch(SPDesktop *dt, int num)
             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, _("<b>Drag</b> to paint a calligraphic stroke. <b>Left</b>/<b>right</b> arrow keys adjust width, <b>up</b>/<b>down</b> adjust angle."));
+            dt->tipsMessageContext()->set(Inkscape::NORMAL_MESSAGE, _("<b>Drag</b> to draw a calligraphic stroke; with <b>Ctrl</b> to track a guide, with <b>Alt</b> to thin/thicken. <b>Arrow keys</b> adjust width (left/right) and angle (up/down)."));
             break;
         case TOOLS_TEXT:
             dt->set_event_context(SP_TYPE_TEXT_CONTEXT, tool_names[num]);
@@ -204,6 +219,12 @@ tools_switch(SPDesktop *dt, int num)
             inkscape_eventcontext_set(sp_desktop_event_context(dt));
             dt->tipsMessageContext()->set(Inkscape::NORMAL_MESSAGE, _("<b>Click and drag</b> 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, _("<b>Click</b> to paint a bounded area, <b>Shift+click</b> to union the new fill with the current selection, <b>Ctrl+click</b> to change the clicked object's fill and stroke to the current setting."));
+            break;
     }
 }
 
@@ -233,6 +254,8 @@ void tools_switch_by_item(SPDesktop *dt, SPItem *item)
         }
     } else if (SP_IS_TEXT(item) || SP_IS_FLOWTEXT(item))  {
         tools_switch(dt, TOOLS_TEXT);
+    } else if (SP_IS_OFFSET(item))  {
+        tools_switch(dt, TOOLS_NODES);
     }
 }