Package gaphas :: Module tool

Module tool

source code

Tools are used to add interactive behavior to a View.

Tools can either not act on an event (None), just handle the event or grab the event and all successive events until the tool is done (e.g. on a button press/release).

The tools in this module are made to work properly in a ToolChain.

Current tools:
ToolChain - for chaining individual tools together. HoverTool - make the item under the mouse cursor the "hovered item" ItemTool - handle selection and movement of items HandleTool - handle selection and movement of handles RubberbandTool - for Rubber band selection PlacementTool - for placing items on the canvas
Maybe even:

TextEditTool - for editing text on canvas items (that support it)

(context.view = view; context.grab() to grab, context.ungrab() to ungrab)


Version: $Revision: 2234 $

Classes
  ToolContext
Special context for tools.
  Tool
  ToolChainContext
ToolChainContext is a wrapper for the ToolContext.
  ToolChain
A ToolChain can be used to chain tools together, for example HoverTool, HandleTool, SelectionTool.
  HoverTool
Make the item under the mouse cursor the "hovered item".
  ItemTool
ItemTool does selection and dragging of items.
  HandleTool
Tool for moving handles around.
  RubberbandTool
  PlacementTool
  TextEditTool
Demo of a text edit tool (just displays a text edit box at the cursor position.
Functions
 
DefaultTool()
The default tool chain build from HoverTool, ItemTool and HandleTool.
source code
Variables
  DEBUG_TOOL = False
  DEBUG_TOOL_CHAIN = False