enable.tools.pyface.move_command_tool module

MoveCommandTool

A MoveTool that uses Pyface’s undo/redo infrastructure to create undoable move commands.

class enable.tools.pyface.move_command_tool.MoveCommandTool(component=None, **traits)[source]

Bases: enable.tools.move_tool.MoveTool, enable.tools.pyface.command_tool.BaseCommandTool

Move tool which pushes MoveCommands onto a CommandStack

This tool pushes a single MoveCommands onto its CommandStack at the end of the drag operation. If the drag is cancelled, then no command is issued, and no commands are issued during the drag operation.

drag_cancel(event)[source]

Restore the component’s position if the drag is cancelled.

A drag is usually cancelled by receiving a mouse_leave event when end_drag_on_leave is True, or by the user pressing any of the cancel_keys.

drag_end(event)[source]

End the drag operation, issuing a MoveCommands

drag_start(event)[source]

Called when the drag operation starts.

The event parameter is the mouse event that established the drag operation; its x and y attributes correspond to the current location of the mouse, and not to the position of the mouse when the initial left_down or right_down event happened.

mergeable = Bool

Whether or not subsequent moves can be merged with this one.