Inherits from
- AbstractOverlay: enthought.enable.abstract_overlay.AbstractOverlay
- ToolHistoryMixin: enthought.enable.tools.tool_history_mixin.ToolHistoryMixin
- BaseZoomTool: enthought.enable.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('x', 'y')
- 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.
drag_button = Enum('left', 'right')
- 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'))
- max_zoom
The most that this tool will zoom in on the target. Since zoom is the ratio of the original bounds to the new bounds, a max_zoom value of 2.0 would make the tool stop once it had zoomed into a region half the size of the original bounds.
max_zoom = Float(inf)
- min_zoom
The most that this tool will zoom out from the target. For example, a min_zoom of 0.2 would prevent the tool from showing a view zoomed out more than 5 times from the original bounds.
min_zoom = Float(-Name('inf'))
- 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('range', 'box')
- wheel_zoom_step
Conversion ratio from wheel steps to zoom factors.
wheel_zoom_step = Float(0.25)
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
- 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
- resizable
- set
- tools
- tooltip
- trait_added
- trait_modified
- underlays
- unified_draw
- use_backbuffer
- use_selection
- viewports
- visible
- vpadding
- width
- window
- wrappers
- x
- x2
- y
- y2
Method summary
- __init__(self, component = None, *args, **kw)
- deactivate(self, component)
- disable(self, event = None)
- enable(self, event = None)
- normal_left_down(self, event)
- normal_mouse_wheel(self, event)
- normal_right_down(self, event)
- reset(self, event = None)
Inherited from base classes
- __deepcopy__(self, memo)
- __getstate__(self)
- __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)
- 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
- __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_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. self.component is the viewport self.component.component is the canvas
- 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.
- reset(self, event = None)
Resets the tool to normal state, with no start or end position.