Inherits from
- AbstractOverlay: enthought.chaco.abstract_overlay.AbstractOverlay
- ToolHistoryMixin: enthought.chaco.tools.tool_history_mixin.ToolHistoryMixin
- BaseZoomTool: enthought.chaco.tools.base_zoom_tool.BaseZoomTool
Attributes
- alpha
The alpha value to apply to color when filling in the selection region. Because it is almost certainly useless to have an opaque zoom rectangle, but it's also extremely useful to be able to use the normal named colors from Enable, this attribute allows the specification of a separate alpha value that replaces the alpha value of color at draw time.
alpha = Trait(0.40000000000000002, None, Float)
- always_on
Is the tool always "on"? If True, left-clicking always initiates a zoom operation; if False, the user must press a key to enter zoom mode.
always_on = Bool(False)
- axis
The axis to which the selection made by this tool is perpendicular. This only applies in 'range' mode.
axis = Enum('index', 'value')
- border_color
The color of the outside selection rectangle.
border_color = ColorTrait('dodgerblue') - border_size
The thickness of selection rectangle border.
border_size = Int(1)
- cancel_zoom_key
The key that cancels the zoom and resets the view to the original defaults.
cancel_zoom_key = Instance(KeySpec, args = ('Esc'))
- color
The color of the selection box.
color = ColorTrait('lightskyblue') - disable_on_complete
Disable the tool after the zoom is completed?
disable_on_complete = Bool(True)
- drag_button
The mouse button that initiates the drag. If "None", then the tool will not respond to drag. (It can still respond to mousewheel events.)
drag_button = Enum('left', 'right', None)
- enable_wheel
Enable the mousewheel for zooming?
enable_wheel = Bool(True)
- enter_zoom_key
The key press to enter zoom mode, if always_on is False. Has no effect if always_on is True.
enter_zoom_key = Instance(KeySpec, args = ('z'))
- event_state
The possible event states of this zoom tool.
event_state = Enum('normal', 'selecting')
- exit_zoom_key
The key press to leave zoom mode, if always_on is False. Has no effect if always_on is True.
exit_zoom_key = Instance(KeySpec, args = ('z'))
- minimum_screen_delta
The minimum amount of screen space the user must select in order for the tool to actually take effect.
minimum_screen_delta = Int(10)
- pointer
The pointer to use when drawing a zoom box.
pointer = 'magnifier'
- tool_mode
The selection mode:
- range:
- Select a range across a single index or value axis.
- box:
- Perform a "box" selection on two axes.
tool_mode = Enum('box', 'range')
- wheel_zoom_step
Conversion ratio from wheel steps to zoom factors.
wheel_zoom_step = Float(1.0)
Inherited from base classes
- accepts_focus
- active_tool
- aspect_ratio
- auto_center
- auto_handle_event
- backbuffer_padding
- border_dash
- border_visible
- border_width
- bounds
- classes
- container
- controller
- cursor_color
- cursor_style
- draw_order
- draw_valid
- drawn_outer_bounds
- drawn_outer_position
- fill_padding
- get
- height
- hpadding
- id
- inset_border
- invisible_layout
- layout_needed
- next_state_key
- on_trait_event
- outer_bounds
- outer_height
- outer_position
- outer_width
- outer_x
- outer_x2
- outer_y
- outer_y2
- overlay_border
- overlays
- padding
- padding_accepts_focus
- padding_bottom
- padding_left
- padding_right
- padding_top
- position
- prev_state_key
- reset_state_key
- resizable
- set
- tools
- tooltip
- trait_added
- trait_modified
- underlays
- unified_draw
- use_backbuffer
- use_draw_order
- use_selection
- viewports
- visible
- vpadding
- width
- window
- wrappers
- x
- x2
- y
- y2
Method summary
- __getstate__(self)
- __init__(self, component = None, *args, **kw)
- deactivate(self, component)
- disable(self, event = None)
- enable(self, event = None)
- normal_key_pressed(self, event)
- normal_left_down(self, event)
- normal_mouse_wheel(self, event)
- normal_right_down(self, event)
- overlay(self, component, gc, view_bounds = None, mode = 'normal')
- overlay_box(self, component, gc)
- overlay_range(self, component, gc)
- reset(self, event = None)
- selecting_key_pressed(self, event)
- selecting_left_up(self, event)
- selecting_mouse_leave(self, event)
- selecting_mouse_move(self, event)
- selecting_right_up(self, event)
Inherited from base classes
- __deepcopy__(self, memo)
- __prefix_trait__(self, name, is_set)
- __reduce_ex__(self, protocol)
- __setstate__(self, state, trait_change_notify = True)
- add_class_trait(cls, name, *trait)
- add_trait(self, name, *trait)
- add_trait_category(cls, category)
- add_trait_listener(self, object, prefix = '')
- all_trait_names(self)
- as_coordinates(self)
- base_trait(self, name)
- class_default_traits_view(cls)
- class_editable_traits(cls)
- class_trait_names(cls, **metadata)
- class_trait_view(cls, name = None, view_element = None)
- class_trait_view_elements(cls)
- class_traits(cls, **metadata)
- cleanup(self, window)
- clone_traits(self, traits = None, memo = None, copy = None, **metadata)
- configure_traits(self, filename = None, view = None, kind = None, edit = True, context = None, handler = None, id = '', scrollable = None, **args)
- copy_traits(self, other, traits = None, memo = None, copy = None, **metadata)
- copyable_trait_names(self, **metadata)
- default_traits_view(self)
- dispatch(self, event, suffix)
- do_layout(self, size = None, force = False)
- draw(self, gc, view_bounds = None, mode = 'default')
- draw_select_box(self, gc, position, bounds, width, dash, inset, color, bgcolor, marker_size)
- edit_traits(self, view = None, parent = None, kind = None, context = None, handler = None, id = '', scrollable = None, **args)
- editable_traits(self)
- get_absolute_coords(self, *coords)
- get_event_transform(self, event = None, suffix = '')
- get_preferred_size(self)
- has_traits_interface(self, *interfaces)
- invalidate_and_redraw(self)
- invalidate_draw(self, damaged_regions = None, self_relative = False)
- is_in(self, x, y)
- on_trait_change(self, handler, name = None, remove = False, dispatch = 'same', priority = False, deferred = False)
- print_traits(self, show_help = False, **metadata)
- remove_trait(self, name)
- remove_trait_listener(self, object, prefix = '')
- request_redraw(self)
- reset_traits(self, traits = None, **metadata)
- set_outer_bounds(self, ndx, val)
- set_outer_position(self, ndx, val)
- set_trait_dispatch_handler(cls, name, klass, override = False)
- sync_trait(self, trait_name, object, alias = None, mutual = True, remove = False)
- trait(self, name, force = False, copy = False)
- trait_context(self)
- trait_get(self, *names, **metadata)
- trait_monitor(cls, handler, remove = False)
- trait_names(self, **metadata)
- trait_set(self, trait_change_notify = True, **traits)
- trait_setq(self, **traits)
- trait_subclasses(cls, all = False)
- trait_view(self, name = None, view_element = None)
- trait_view_elements(self)
- trait_views(self, klass = None)
- traits(self, **metadata)
- validate_trait(self, name, value)
Methods
- __getstate__(self)
- __init__(self, component = None, *args, **kw)
- deactivate(self, component)
Called when this is no longer the active tool.
- disable(self, event = None)
Provides a programmatic way to enable this tool, if always_on is False.
Calling this method has the same effect as if the user pressed the exit_zoom_key.
- enable(self, event = None)
Provides a programmatic way to enable this tool, if always_on is False.
Calling this method has the same effect as if the user pressed the enter_zoom_key.
- normal_key_pressed(self, event)
Handles a key being pressed when the tool is in 'normal' state.
If the tool is not always on, this method handles turning it on and off when the appropriate keys are pressed. Also handles keys to manipulate the tool history.
- normal_left_down(self, event)
Handles the left mouse button being pressed while the tool is in the 'normal' state.
If the tool is enabled or always on, it starts selecting.
- normal_mouse_wheel(self, event)
Handles the mouse wheel being used when the tool is in the 'normal' state.
Scrolling the wheel "up" zooms in; scrolling it "down" zooms out.
- normal_right_down(self, event)
Handles the right mouse button being pressed while the tool is in the 'normal' state.
If the tool is enabled or always on, it starts selecting.
- overlay(self, component, gc, view_bounds = None, mode = 'normal')
Draws this component overlaid on another component.
Overrides AbstractOverlay.
- overlay_box(self, component, gc)
Draws the overlay as a box.
- overlay_range(self, component, gc)
Draws the overlay as a range.
- reset(self, event = None)
Resets the tool to normal state, with no start or end position.
- selecting_key_pressed(self, event)
Handles a key being pressed when the tool is in the 'selecting' state.
If the key pressed is the cancel_zoom_key, then selecting is canceled.
- selecting_left_up(self, event)
Handles the left mouse button being released when the tool is in the 'selecting' state.
Finishes selecting and does the zoom.
- selecting_mouse_leave(self, event)
Handles the mouse leaving the plot when the tool is in the 'selecting' state.
Ends the selection operation without zooming.
- selecting_mouse_move(self, event)
Handles the mouse moving when the tool is in the 'selecting' state.
The selection is extended to the current mouse position.
- selecting_right_up(self, event)
Handles the right mouse button being released when the tool is in the 'selecting' state.
Finishes selecting and does the zoom.