File: wx.HeaderCtrlSimple.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 (350 lines) | stat: -rw-r--r-- 9,835 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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
.. 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.HeaderCtrlSimple:

==========================================================================================================================================
|phoenix_title|  **wx.HeaderCtrlSimple**
==========================================================================================================================================

:ref:`wx.HeaderCtrlSimple`  is a concrete header control which can be used directly, without inheriting from it as you need to do when using :ref:`wx.HeaderCtrl`  itself.          

When using it, you need to use simple :meth:`~wx.HeaderCtrlSimple.AppendColumn`, :meth:`~wx.HeaderCtrlSimple.InsertColumn`  and :meth:`~wx.HeaderCtrlSimple.DeleteColumn`  methods instead of setting the number of columns with :meth:`~wx.HeaderCtrlSimple.SetColumnCount`  and returning the information about them from the overridden :meth:`~wx.HeaderCtrlSimple.GetColumn`. 







         



.. seealso:: :ref:`wx.HeaderCtrl`    







|

|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>HeaderCtrlSimple</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.HeaderCtrlSimple_inheritance.png" alt="Inheritance diagram of HeaderCtrlSimple" 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.HeaderCtrl.html" title="wx.HeaderCtrl" alt="" coords="49,315,159,344"/> <area shape="rect" id="node7" href="wx.HeaderCtrlSimple.html" title="wx.HeaderCtrlSimple" alt="" coords="27,392,180,421"/> <area shape="rect" id="node2" href="wx.Control.html" title="wx.Control" alt="" coords="60,237,148,267"/> <area shape="rect" id="node3" href="wx.Object.html" title="wx.Object" alt="" coords="5,5,87,35"/> <area shape="rect" id="node5" href="wx.EvtHandler.html" title="wx.EvtHandler" alt="" coords="48,83,159,112"/> <area shape="rect" id="node4" href="wx.Window.html" title="wx.Window" alt="" coords="59,160,148,189"/> <area shape="rect" id="node6" href="wx.Trackable.html" title="wx.Trackable" alt="" coords="112,5,213,35"/> </map> 
   </p>

|


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

================================================================================ ================================================================================
:meth:`~wx.HeaderCtrlSimple.__init__`                                            Default constructor not creating the underlying window.
:meth:`~wx.HeaderCtrlSimple.AppendColumn`                                        Append the column to the end of the control.
:meth:`~wx.HeaderCtrlSimple.DeleteColumn`                                        Delete the column at the given position.
:meth:`~wx.HeaderCtrlSimple.GetBestFittingWidth`                                 This function can be overridden in the classes deriving from this control instead of overriding :meth:`~HeaderCtrlSimple.UpdateColumnWidthToFit` .
:meth:`~wx.HeaderCtrlSimple.HideColumn`                                          Hide the column with the given index.
:meth:`~wx.HeaderCtrlSimple.InsertColumn`                                        Insert the column at the given position.
:meth:`~wx.HeaderCtrlSimple.RemoveSortIndicator`                                 Remove the sort indicator from the column being used as sort key.
:meth:`~wx.HeaderCtrlSimple.ShowColumn`                                          Show or hide the column.
:meth:`~wx.HeaderCtrlSimple.ShowSortIndicator`                                   Update the column sort indicator.
================================================================================ ================================================================================


|


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


.. class:: wx.HeaderCtrlSimple(HeaderCtrl)

   **Possible constructors**::

       HeaderCtrlSimple()
       
       HeaderCtrlSimple(parent, winid=ID_ANY, pos=DefaultPosition,
                        size=DefaultSize, style=HD_DEFAULT_STYLE, name=HeaderCtrlNameStr)
       
   
   HeaderCtrlSimple is a concrete header control which can be used
   directly, without inheriting from it as you need to do when using
   HeaderCtrl itself.



   .. method:: __init__(self, *args, **kw)



      |overload| Overloaded Implementations:

      **~~~**

      
      **__init__** `(self)`
      
      Default constructor not creating the underlying window.                  
      
      You must use :meth:`Create`   after creating the object using this constructor.                   
      
      
      
      
      **~~~**

      
      **__init__** `(self, parent, winid=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=HD_DEFAULT_STYLE, name=HeaderCtrlNameStr)`
      
      Constructor creating the window.                  
      
      Please see the base class :meth:`wx.HeaderCtrl.Create`   method for the parameters description.                  
      
      
      :param `parent`: 
      :type `parent`: wx.Window
      :param `winid`: 
      :type `winid`: wx.WindowID
      :param `pos`: 
      :type `pos`: wx.Point
      :param `size`: 
      :type `size`: wx.Size
      :param `style`: 
      :type `style`: long
      :param `name`: 
      :type `name`: string
      
      
      
      
      
      
      **~~~**






   .. method:: AppendColumn(self, col)

      Append the column to the end of the control.                  

                


      :param `col`: 
      :type `col`: wx.HeaderColumnSimple






      .. seealso:: :meth:`InsertColumn`     








   .. method:: DeleteColumn(self, idx)

      Delete the column at the given position.                  

                


      :param `idx`: 
      :type `idx`: int






      .. seealso:: :meth:`InsertColumn` , :meth:`AppendColumn`     








   .. method:: GetBestFittingWidth(self, idx)

      This function can be overridden in the classes deriving from this control instead of overriding :meth:`UpdateColumnWidthToFit` .                  

      To implement automatic column resizing to fit its contents width when the column divider is double clicked, you need to simply return the fitting width for the given column `idx`  from this method, the control will automatically use the biggest value between the one returned from here and the one needed for the display of the column title itself. 

      The base class version returns -1 indicating that this function is not implemented.                  


      :param `idx`: 
      :type `idx`: int




      :rtype: `int`








   .. method:: HideColumn(self, idx)

      Hide the column with the given index.                  

      This is the same as calling::

              self.ShowColumn(idx, False)






      :param `idx`: The index of the column to show or hide, from 0 to :meth:`GetColumnCount` .   
      :type `idx`: int




                  





   .. method:: InsertColumn(self, col, idx)

      Insert the column at the given position.                  




      :param `col`: The column to insert. Notice that because of the existence of implicit conversion from :ref:`String`  to :ref:`wx.HeaderColumn`  a string can be passed directly here.   
      :type `col`: wx.HeaderColumnSimple
      :param `idx`: The position of the new column, from 0 to :meth:`GetColumnCount` . Using :meth:`GetColumnCount`   means to append the column to the end.  
      :type `idx`: int






                  



      .. seealso:: :meth:`AppendColumn`     








   .. method:: RemoveSortIndicator(self)

      Remove the sort indicator from the column being used as sort key.                  

                 



      .. seealso:: :meth:`ShowSortIndicator`     








   .. method:: ShowColumn(self, idx, show=True)

      Show or hide the column.                  

      Initially the column is shown by default or hidden if it was added with ``wx.COL_HIDDEN`` flag set. 

      When a column is hidden, it doesn't appear at all on the screen but its index is still taken into account when working with other columns. E.g. if there are three columns 0, 1 and 2 and the column 1 is hidden you still need to use index 2 to refer to the last visible column. 




      :param `idx`: The index of the column to show or hide, from 0 to :meth:`GetColumnCount` .   
      :type `idx`: int
      :param `show`: Indicates whether the column should be shown (default) or hidden.   
      :type `show`: bool






                  





   .. method:: ShowSortIndicator(self, idx, sortOrder=True)

      Update the column sort indicator.                  

      The sort indicator, if shown, is typically an arrow pointing upwards or downwards depending on whether the control contents is sorted in ascending or descending order. 




      :param `idx`: The column to set the sort indicator for. If  ``-1``   is given, then the currently shown sort indicator will be removed.    
      :type `idx`: int
      :param `sortOrder`: If ``True`` or ``False`` show the sort indicator corresponding to ascending or descending sort order respectively.   
      :type `sortOrder`: bool