File: wx.lib.mixins.rubberband.txt

package info (click to toggle)
wxpython4.0 4.0.4%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 211,112 kB
  • sloc: cpp: 888,355; python: 223,130; makefile: 52,087; ansic: 45,780; sh: 3,012; xml: 1,534; perl: 264
file content (110 lines) | stat: -rw-r--r-- 3,665 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2018 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc

.. module:: wx.lib.mixins.rubberband

.. currentmodule:: wx.lib.mixins.rubberband

.. highlight:: python



.. _wx.lib.mixins.rubberband:

==========================================================================================================================================
|phoenix_title|  **wx.lib.mixins.rubberband**
==========================================================================================================================================

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


|function_summary| Functions Summary
====================================

================================================================================ ================================================================================
:func:`~wx.lib.mixins.rubberband.boxToExtent`                                    Convert a box specification to an extent specification.
:func:`~wx.lib.mixins.rubberband.getCursorPosition`                              Return a position number in the range 0 .. 7 to indicate
:func:`~wx.lib.mixins.rubberband.isNegative`                                     x < 0:   1
:func:`~wx.lib.mixins.rubberband.normalizeBox`                                   Convert any negative measurements in the current
:func:`~wx.lib.mixins.rubberband.pointInBox`                                     Return ``True`` if the given point is contained in the box.
:func:`~wx.lib.mixins.rubberband.pointOnBox`                                     Return ``True`` if the point is on the outside edge
================================================================================ ================================================================================


|


|class_summary| Classes Summary
===============================

================================================================================ ================================================================================
:ref:`~wx.lib.mixins.rubberband.RubberBand`                                      A stretchable border which is drawn on top of an
================================================================================ ================================================================================


|


.. toctree::
   :maxdepth: 1
   :hidden:

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