Main Page Class Hierarchy Compound List File List Compound Members

# ToolControl Class Reference

all interactive drawing using tools is handled through this class. More...

`#include <toolcont.h>`

List of all members.

## Public Methods
void | OnMouseEvent (wxMouseEvent &event)
| called on mouse events
void | OnChar (wxKeyEvent &event)
| called on key events
void | OnKeyDown (wxKeyEvent &event)
| called on keydown events
void | OnKeyUp (wxKeyEvent &event)
| called on keyup events
ToolSet | GetActiveType ()
| what is the type of the active tool
BaseTool * | GetActiveTool ()
| what tool is active at the moment
bool | PopTool ()
| get the tool that was put on the stack
bool | PushTool ()
| push active tool on the stack
bool | StartTool (ToolSet a_tool, bool onlyonce)
bool | EndTool (bool now=false)
| sets a flag to stop the actove tool
bool | StopTool ()
| end a tool and restore a tool from the stack.
bool | StopTool (bool settoolinfo)
| end a tool and restore a tool from the stack.
void | CalculateCurrent ()
| calculate the mouse position
int | NumberOfTools ()
| how much tools are on the stack
bool | Undo ()
| undo for active tool
bool | Begin ()
| called for every action inside a tool
bool | End ()
| called for every action inside a tool
## Protected Attributes
bool | _toolactive
| active tools or not
DL_List< void * > * | _tool_stack
| stack containing all tools that were started
BaseTool * | _tool
| the active tool
long | _currentX
| mouse x in windows coordinates
long | _currentY
| mouse y in windows coordinates
double | _realcurrentX
| mouse x in world coordinates
double | _realcurrentY
| mouse y in world coordinates

## Detailed Description

all interactive drawing using tools is handled through this class.

All mouse and key events on the canvas/client window are redirected to this class. Depending on the tool that is active, those events are redirected to the right tool. A stack of tools is maintained in order to allow drawing and zooming at the same time. Shortcuts to start tools/certain commands are also handled here. Undo while a tool is in action (busy drawing), is handled by the tool itself. The toolcontroller will receive the undo command, and redirects it to the active tool. The default tool will always be the ZOOMIN_TOOL. If the stack becomes empty, this tool will be started again.

See also:
  BaseTool , DrawDriver , WindowsDriver

## Member Function Documentation

bool ToolControl::StartTool | ( | ToolSet | a_tool,
|  | bool | onlyonce
| ) |

| start a new tool If only once is true, only one action will be performed after that the tool will be ended, and the last pushed tool will be restored.

The documentation for this class was generated from the following file:

- toolcont.h

ToolControl class Reference -- Thu Nov 28 21:24:57 2002 -- 28 Nov 2002 -- 1.2.18 -- -- . -- Main Page