enable.tools.resize_tool module

class enable.tools.resize_tool.ResizeTool(component=None, **traits)[source]

Bases: enable.tools.value_drag_tool.ValueDragTool

Generic tool for resizing a component

drag_start(event)[source]

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.

get_value()[source]

Return the current value that is being modified

hotspots = Set(hotspot_trait)

the hotspots which are active for this tool

is_draggable(x, y)[source]

Returns whether the (x,y) position is in a region that is OK to drag.

Used by the tool to determine when to start a drag.

minimum_bounds = bounds_trait

the minimum bounds that we can resize to

set_delta(value, delta_x, delta_y)[source]

Set the value that is being modified

This function should modify the underlying value based on the provided delta_x and delta_y in data coordinates. These deltas are total displacement from the original location, not incremental. The value parameter is the original value at the point where the drag started.

threshhold = Int(10)

the distance in pixels from a hotspot required to register a hit