chaco.tools.tool_history_mixin module

Defines the ToolHistoryMixin class.

class chaco.tools.tool_history_mixin.ToolHistoryMixin

Bases: traits.has_traits.HasTraits

A mix-in class for tools to maintain a tool state history and to move backwards and forwards through that history stack.

This mix-in listens for keypressed events; to handle keypresses in a subclass, call self._history_handle_key(event) to have this mix-in properly process the event.

next_state_key = Instance(KeySpec, args=("Right", "control"))

Key to go to the next state in the history.

normal_key_pressed(event)

Handles a key being pressed, and takes appropriate action if it is one of the history keys defined for this class.

prev_state_key = Instance(KeySpec, args=("Left", "control"))

Key to go to the previous state in the history.

reset_state_key = Instance(KeySpec, args=("Esc",))

Key to go to the original or start state in the history.