enable.tools.pyface.resize_command_tool module


A CommandTool that uses Pyface’s undo/redo infrastructure to create undoable resize commands.

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

Bases: enable.tools.resize_tool.ResizeTool, enable.tools.pyface.command_tool.BaseCommandTool

Resize tool which pushes ResizeCommands onto a CommandStack

This tool pushes a single ResizeCommand 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.


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.


End the drag operation, issuing a ResizeCommands


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.