Package wx :: Package lib :: Package mixins :: Module rubberband

[frames | no frames]

## Module wx.lib.mixins.rubberband

A mixin class for doing "RubberBand"-ing on a window.

Classes
`RubberBand` | A stretchable border which is drawn on top of an image to define an area.

Function Summary
| ``boxToExtent`(box)` Convert a box specification to an extent specification.
| ``getCursorPosition`(x, y, box, thickness)` Return a position number in the range 0 ..
| ``isNegative`(aNumber)` x < 0: 1 else: 0
| ``normalizeBox`(box)` Convert any negative measurements in the current box to positive, and adjust the origin.
| ``pointInBox`(x, y, box)` Return True if the given point is contained in the box.
| ``pointOnBox`(x, y, box, thickness)` Return True if the point is on the outside edge of the box.

Function Details

### 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.

### 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

### isNegative(aNumber)

x < 0: 1 else: 0

### normalizeBox(box)

Convert any negative measurements in the current box to positive, and adjust the origin.

### pointInBox(x, y, box)

Return True if the given point is contained in the box.

### 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.

Generated by Epydoc 2.1.20050511.rpd on Thu Mar 22 12:13:29 2007 | http://epydoc.sf.net