File: wx.propgrid.CursorProperty.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 (194 lines) | stat: -rw-r--r-- 6,297 bytes parent folder | download
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
.. 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



.. _wx.propgrid.CursorProperty:

==========================================================================================================================================
|phoenix_title|  **wx.propgrid.CursorProperty**
==========================================================================================================================================

Property representing :ref:`wx.Cursor`.           




|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>CursorProperty</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.propgrid.CursorProperty_inheritance.png" alt="Inheritance diagram of CursorProperty" usemap="#dummy" class="inheritance"/></center>
   </div>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.propgrid.CursorProperty.html" title="wx.propgrid.CursorProperty" alt="" coords="5,237,200,267"/> <area shape="rect" id="node2" href="wx.propgrid.EnumProperty.html" title="wx.propgrid.EnumProperty" alt="" coords="7,160,197,189"/> <area shape="rect" id="node3" href="wx.Object.html" title="wx.Object" alt="" coords="61,5,143,35"/> <area shape="rect" id="node4" href="wx.propgrid.PGProperty.html" title="wx.propgrid.PGProperty" alt="" coords="17,83,188,112"/> </map> 
   </p>

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.propgrid.CursorProperty.__init__`                                     
:meth:`~wx.propgrid.CursorProperty.OnCustomPaint`                                Override to paint an image in front of the property value text or drop-down list item (but only if :meth:`wx.propgrid.PGProperty.OnMeasureImage`   is overridden as well).
:meth:`~wx.propgrid.CursorProperty.OnMeasureImage`                               Returns size of the custom painted image in front of property.
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: wx.propgrid.CursorProperty(EnumProperty)

   **Possible constructors**::

       CursorProperty(label=PG_LABEL, name=PG_LABEL, value=0)
       
   
   Property representing Cursor.



   .. method:: __init__(self, label=PG_LABEL, name=PG_LABEL, value=0)




      :param `label`: 
      :type `label`: string
      :param `name`: 
      :type `name`: string
      :param `value`: 
      :type `value`: int







   .. method:: OnCustomPaint(self, dc, rect, paintdata)

      Override to paint an image in front of the property value text or drop-down list item (but only if :meth:`wx.propgrid.PGProperty.OnMeasureImage`   is overridden as well).                  

      If property's :meth:`OnMeasureImage`   returns size that has height != 0 but less than row height ( < 0 has special meanings), :ref:`wx.propgrid.PropertyGrid`  calls this method to draw a custom image in a limited area in front of the editor control or value text/graphics, and if control has drop-down list, then the image is drawn there as well (even in the case :meth:`OnMeasureImage`   returned higher height than row height). 

      ``NOTE``: Following applies when :meth:`OnMeasureImage`   returns a "flexible" height ( using PG_FLEXIBLE_SIZE(W,H) macro), which implies variable height items: If rect.x is < 0, then this is a measure item call, which means that dc is invalid and only thing that should be done is to set paintdata.m_drawnHeight to the height of the image of item at index paintdata.m_choiceItem. This call may be done even as often as once every drop-down popup show. 




      :param `dc`: :ref:`wx.DC`  to paint on.   
      :type `dc`: wx.DC
      :param `rect`: Box reserved for custom graphics. Includes surrounding rectangle, if any. If x is < 0, then this is a measure item call (see above).   
      :type `rect`: wx.Rect
      :param `paintdata`: :ref:`wx.propgrid.PGPaintData`  structure with much useful data about painted item. ::




      :type `paintdata`: wx.propgrid.PGPaintData








                  



      .. note:: 

   

         - You can actually exceed rect width, but if you do so then paintdata.m_drawnWidth must be set to the full width drawn in pixels. 
         - Due to technical reasons, rect's height will be default even if custom height was reported during measure call. 
         - Brush is guaranteed to be default background colour. It has been already used to clear the background of area being painted. It can be modified. 
         - Pen is guaranteed to be 1-wide 'black' (or whatever is the proper colour) pen for drawing framing rectangle. It can be changed as well. 










      .. seealso:: :meth:`ValueToString`     








   .. method:: OnMeasureImage(self, item)

      Returns size of the custom painted image in front of property.                  

      This method must be overridden to return non-default value if OnCustomPaint is to be called. 




      :param `item`: Normally -1, but can be an index to the property's list of items.  
      :type `item`: int






      :rtype: :ref:`Size`



                  



      .. note:: 

   

         - Default behaviour is to return :ref:`wx.Size`, which means no image. 
         - Default image width or height is indicated with dimension -1. 
         - You can also return ``wx.propgrid.PG_DEFAULT_IMAGE_SIZE`` which equals :ref:`wx.Size`(-1, -1).