Inherits from
- Component: enthought.enable.component.Component
Attributes
- component
The component we are viewing
component = Instance(Component)
- enable_zoom
Enable Zoom interaction
enable_zoom = Bool(False)
- initiate_layout
Whether to initiate layout on the viewed component. This is necessary if the component is only viewed through viewports, in which case one of the viewports must lay it out or bounds must be set explicitly on the component.
initiate_layout = Bool(False)
- max_zoom
max_zoom = Delegate('zoom_tool', modify = True)
- min_zoom
min_zoom = Delegate('zoom_tool', modify = True)
- stay_inside
Whether or not this viewport should stay constrained to the bounds of the viewed component TODO: Implement this
stay_inside = Bool(False)
- view_bounds
The bounds of our viewport in the space of our component
view_bounds = bounds_trait
- view_position
The position of our viewport into our component (in the component's coordinate space)
view_position = coordinate_trait
- zoom
Zoom scaling factor for this viewport - Ratio of old bounds to new bounds. Zoom less than 1.0 means we are zoomed out, and more than 1.0 means we are zoomed in. Zoom should always be positive and nonzero.
zoom = Float(1.0)
- zoom_tool
The zoom tool
zoom_tool = Instance(ViewportZoomTool)
Inherited from base classes
- accepts_focus
- active_tool
- aspect_ratio
- auto_center
- auto_handle_event
- backbuffer_padding
- bgcolor
- border_color
- border_dash
- border_visible
- border_width
- bounds
- classes
- container
- controller
- cursor_color
- cursor_style
- draw_layer
- draw_order
- draw_valid
- drawn_outer_bounds
- drawn_outer_position
- event_state
- 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
- pointer
- 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, **traits)
- cleanup(self, window)
- components_at(self, x, y, add_containers = False)
- get_event_transform(self, event = None, suffix = '')
- get_preferred_size(self)
- invalidate_draw(self, damaged_regions = None, self_relative = False, view_relative = False)
- is_in(self, x, y)
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)
- 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)
- has_traits_interface(self, *interfaces)
- invalidate_and_redraw(self)
- 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, **traits)
- cleanup(self, window)
When a window viewing or containing a component is destroyed, cleanup is called on the component to give it the opportunity to delete any transient state it may have (such as backbuffers).
- components_at(self, x, y, add_containers = False)
Returns the list of components inside the viewport at the given (x,y) in the viewport's native coordinate space (not in the space of the component it is viewing).
Although Viewports are not containers, they support this method.
- get_event_transform(self, event = None, suffix = '')
- get_preferred_size(self)
If we're initiating layout, act like an OverlayPlotContainer, otherwise do the normal component action
- invalidate_draw(self, damaged_regions = None, self_relative = False, view_relative = False)
- is_in(self, x, y)
Return True if the (x,y) coordinates are within the viewport's native coordinate space.