.. include:: headings.inc .. module:: lib.mixins.rubberband .. currentmodule:: lib.mixins.rubberband .. highlight:: python .. _lib.mixins.rubberband: ========================================================================================================================================== |phoenix_title| **rubberband** ========================================================================================================================================== A mixin class for doing "RubberBand"-ing on a window. | |class_hierarchy| Inheritance Diagram ===================================== Inheritance diagram for module **rubberband** .. raw:: html

Inheritance diagram of rubberband

| |function_summary| Functions Summary ==================================== ================================================================================ ================================================================================ :func:`~lib.mixins.rubberband.boxToExtent` Convert a box specification to an extent specification. :func:`~lib.mixins.rubberband.getCursorPosition` Return a position number in the range 0 .. 7 to indicate :func:`~lib.mixins.rubberband.isNegative` x < 0: 1 :func:`~lib.mixins.rubberband.normalizeBox` Convert any negative measurements in the current :func:`~lib.mixins.rubberband.pointInBox` Return ``True`` if the given point is contained in the box. :func:`~lib.mixins.rubberband.pointOnBox` Return ``True`` if the point is on the outside edge ================================================================================ ================================================================================ | |class_summary| Classes Summary =============================== ================================================================================ ================================================================================ :ref:`lib.mixins.rubberband.RubberBand` A stretchable border which is drawn on top of an ================================================================================ ================================================================================ | .. toctree:: :maxdepth: 1 :hidden: lib.mixins.rubberband.RubberBand Functions ------------ .. function:: boxToExtent(box) Convert a box specification to an extent specification. I put this into a seperate function after I realized that I had been implementing it wrong in several places. .. function:: getCursorPosition(x, y, box, thickness=1) Return a position number in the range 0 .. 7 to indicate where on the box border the point is. The layout is: 0 1 2 7 3 6 5 4 .. function:: isNegative(aNumber) x < 0: 1 else: 0 .. function:: normalizeBox(box) Convert any negative measurements in the current box to positive, and adjust the origin. .. function:: pointInBox(x, y, box) Return ``True`` if the given point is contained in the box. .. function:: pointOnBox(x, y, box, thickness=1) Return ``True`` if the point is on the outside edge of the box. The thickness defines how thick the edge should be. This is necessary for HCI reasons: For example, it's normally very difficult for a user to manuever the mouse onto a one pixel border.