File: wx.ListItem.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 (628 lines) | stat: -rw-r--r-- 17,417 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
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
.. 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.ListItem:

==========================================================================================================================================
|phoenix_title|  **wx.ListItem**
==========================================================================================================================================

This class stores information about a :ref:`wx.ListCtrl`  item or column.          

:ref:`wx.ListItem`  is a class which contains information about:

- Zero based item position; see :meth:`~wx.ListItem.SetId`  and :meth:`~wx.ListItem.GetId`. 
- Zero based column index; see :meth:`~wx.ListItem.SetColumn`  and :meth:`~wx.ListItem.GetColumn`. 
- The label (or header for columns); see :meth:`~wx.ListItem.SetText`  and :meth:`~wx.ListItem.GetText`. 
- The zero based index into an image list; see :meth:`~wx.ListItem.GetImage`  and :meth:`~wx.ListItem.SetImage`. 
- Application defined data; see :meth:`~wx.ListItem.SetData`  and :meth:`~wx.ListItem.GetData`. 
- For columns only: the width of the column; see :meth:`~wx.ListItem.SetWidth`  and :meth:`~wx.ListItem.GetWidth`. 
- For columns only: the format of the column; one of  ``LIST_FORMAT_LEFT`` ,   ``LIST_FORMAT_RIGHT`` ,   ``LIST_FORMAT_CENTRE`` . See  :meth:`~wx.ListItem.SetAlign`  and :meth:`~wx.ListItem.GetAlign`. 
- The state of the item; see :meth:`~wx.ListItem.SetState`  and :meth:`~wx.ListItem.GetState`. This is a bitlist of the following flags:

  -  ``LIST_STATE_FOCUSED:``   The item has the focus. 
  -  ``LIST_STATE_SELECTED:``   The item is selected. 
  -  ``LIST_STATE_DONTCARE:``   Don't care what the state is. Win32 only. 
  -  ``LIST_STATE_DROPHILITED:``   The item is highlighted to receive a drop event. Win32 only. 
  -  ``LIST_STATE_CUT:``   The item is in the cut state. Win32 only. 



- A mask indicating which state flags are valid; this is a bitlist of the flags reported above for the item state. See :meth:`~wx.ListItem.SetStateMask`  and GetStateMask(). 
- A mask indicating which fields of this class are valid; see :meth:`~wx.ListItem.SetMask`  and :meth:`~wx.ListItem.GetMask`. This is a bitlist of the following flags:

  -  ``LIST_MASK_STATE:``   The state field is valid. 
  -  ``LIST_MASK_TEXT:``   The label field is valid. 
  -  ``LIST_MASK_IMAGE:``   The image field is valid. 
  -  ``LIST_MASK_DATA:``   The application-defined data field is valid. 
  -  ``LIST_MASK_WIDTH:``   The column width field is valid. 
  -  ``LIST_MASK_FORMAT:``   The column format field is valid. 







The :ref:`wx.ListItem`  object can also contain item-specific colour and font information: for this you need to call one of :meth:`~wx.ListItem.SetTextColour`, :meth:`~wx.ListItem.SetBackgroundColour`  or :meth:`~wx.ListItem.SetFont`  functions on it passing it the colour/font to use. If the colour/font is not specified, the default list control colour/font is used. 







         



.. seealso:: :ref:`wx.ListCtrl`    







|

|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>ListItem</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.ListItem_inheritance.png" alt="Inheritance diagram of ListItem" 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.ListItem.html" title="wx.ListItem" alt="" coords="5,83,99,112"/> <area shape="rect" id="node2" href="wx.Object.html" title="wx.Object" alt="" coords="11,5,92,35"/> </map> 
   </p>

|


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

================================================================================ ================================================================================
:meth:`~wx.ListItem.__init__`                                                    Constructor.
:meth:`~wx.ListItem.Clear`                                                       Resets the item state to the default.
:meth:`~wx.ListItem.GetAlign`                                                    Returns the alignment for this item.
:meth:`~wx.ListItem.GetBackgroundColour`                                         Returns the background colour for this item.
:meth:`~wx.ListItem.GetColumn`                                                   Returns the zero-based column; meaningful only in report mode.
:meth:`~wx.ListItem.GetData`                                                     Returns client data associated with the control.
:meth:`~wx.ListItem.GetFont`                                                     Returns the font used to display the item.
:meth:`~wx.ListItem.GetId`                                                       Returns the zero-based item position.
:meth:`~wx.ListItem.GetImage`                                                    Returns the zero-based index of the image associated with the item into the image list.
:meth:`~wx.ListItem.GetMask`                                                     Returns a bit mask indicating which fields of the structure are valid.
:meth:`~wx.ListItem.GetState`                                                    Returns a bit field representing the state of the item.
:meth:`~wx.ListItem.GetText`                                                     Returns the label/header text.
:meth:`~wx.ListItem.GetTextColour`                                               Returns the text colour.
:meth:`~wx.ListItem.GetWidth`                                                    Meaningful only for column headers in report mode.
:meth:`~wx.ListItem.SetAlign`                                                    Sets the alignment for the item.
:meth:`~wx.ListItem.SetBackgroundColour`                                         Sets the background colour for the item.
:meth:`~wx.ListItem.SetColumn`                                                   Sets the zero-based column.
:meth:`~wx.ListItem.SetData`                                                     Sets client data for the item.
:meth:`~wx.ListItem.SetFont`                                                     Sets the font for the item.
:meth:`~wx.ListItem.SetId`                                                       Sets the zero-based item position.
:meth:`~wx.ListItem.SetImage`                                                    Sets the zero-based index of the image associated with the item into the image list.
:meth:`~wx.ListItem.SetMask`                                                     Sets the mask of valid fields.
:meth:`~wx.ListItem.SetState`                                                    Sets the item state flags (note that the valid state flags are influenced by the value of the state mask, see :meth:`wx.ListItem.SetStateMask` ).
:meth:`~wx.ListItem.SetStateMask`                                                Sets the bitmask that is used to determine which of the state flags are to be set.
:meth:`~wx.ListItem.SetText`                                                     Sets the text label for the item.
:meth:`~wx.ListItem.SetTextColour`                                               Sets the text colour for the item.
:meth:`~wx.ListItem.SetWidth`                                                    Meaningful only for column headers in report mode.
================================================================================ ================================================================================


|


|property_summary| Properties Summary
=====================================

================================================================================ ================================================================================
:attr:`~wx.ListItem.Align`                                                       See :meth:`~wx.ListItem.GetAlign` and :meth:`~wx.ListItem.SetAlign`
:attr:`~wx.ListItem.BackgroundColour`                                            See :meth:`~wx.ListItem.GetBackgroundColour` and :meth:`~wx.ListItem.SetBackgroundColour`
:attr:`~wx.ListItem.Column`                                                      See :meth:`~wx.ListItem.GetColumn` and :meth:`~wx.ListItem.SetColumn`
:attr:`~wx.ListItem.Data`                                                        See :meth:`~wx.ListItem.GetData` and :meth:`~wx.ListItem.SetData`
:attr:`~wx.ListItem.Font`                                                        See :meth:`~wx.ListItem.GetFont` and :meth:`~wx.ListItem.SetFont`
:attr:`~wx.ListItem.Id`                                                          See :meth:`~wx.ListItem.GetId` and :meth:`~wx.ListItem.SetId`
:attr:`~wx.ListItem.Image`                                                       See :meth:`~wx.ListItem.GetImage` and :meth:`~wx.ListItem.SetImage`
:attr:`~wx.ListItem.Mask`                                                        See :meth:`~wx.ListItem.GetMask` and :meth:`~wx.ListItem.SetMask`
:attr:`~wx.ListItem.State`                                                       See :meth:`~wx.ListItem.GetState` and :meth:`~wx.ListItem.SetState`
:attr:`~wx.ListItem.Text`                                                        See :meth:`~wx.ListItem.GetText` and :meth:`~wx.ListItem.SetText`
:attr:`~wx.ListItem.TextColour`                                                  See :meth:`~wx.ListItem.GetTextColour` and :meth:`~wx.ListItem.SetTextColour`
:attr:`~wx.ListItem.Width`                                                       See :meth:`~wx.ListItem.GetWidth` and :meth:`~wx.ListItem.SetWidth`
================================================================================ ================================================================================


|


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


.. class:: wx.ListItem(Object)

   **Possible constructors**::

       ListItem()
       
   
   This class stores information about a ListCtrl item or column.



   .. method:: __init__(self)

      Constructor.                   





   .. method:: Clear(self)

      Resets the item state to the default.                   





   .. method:: GetAlign(self)

      Returns the alignment for this item.                  

      Can be one of  ``LIST_FORMAT_LEFT`` ,   ``LIST_FORMAT_RIGHT``   or   ``LIST_FORMAT_CENTRE`` .                   

      :rtype: :ref:`wx.ListColumnFormat`








   .. method:: GetBackgroundColour(self)

      Returns the background colour for this item.                  

      :rtype: :ref:`wx.Colour`








   .. method:: GetColumn(self)

      Returns the zero-based column; meaningful only in report mode.                  

      :rtype: `int`








   .. method:: GetData(self)

      Returns client data associated with the control.                  

      Please note that client data is associated with the item and not with subitems.                  

      :rtype: `long`








   .. method:: GetFont(self)

      Returns the font used to display the item.                  

      :rtype: :ref:`wx.Font`








   .. method:: GetId(self)

      Returns the zero-based item position.                  

      :rtype: `long`








   .. method:: GetImage(self)

      Returns the zero-based index of the image associated with the item into the image list.                  

      :rtype: `int`








   .. method:: GetMask(self)

      Returns a bit mask indicating which fields of the structure are valid.                  

      Can be any combination of the following values:

      - ``wx.LIST_MASK_STATE``: **GetState**  is valid. 
      - ``wx.LIST_MASK_TEXT``: **GetText**  is valid. 
      - ``wx.LIST_MASK_IMAGE``: **GetImage**  is valid. 
      - ``wx.LIST_MASK_DATA``: **GetData**  is valid. 
      - ``wx.LIST_MASK_WIDTH``: **GetWidth**  is valid. 
      - ``wx.LIST_MASK_FORMAT``: **GetFormat**  is valid.  


                 

      :rtype: `long`








   .. method:: GetState(self)

      Returns a bit field representing the state of the item.                  

      Can be any combination of:

      - ``wx.LIST_STATE_DONTCARE``: Don't care what the state is. Win32 only. 
      - ``wx.LIST_STATE_DROPHILITED``: The item is highlighted to receive a drop event. Win32 only. 
      - ``wx.LIST_STATE_FOCUSED``: The item has the focus. 
      - ``wx.LIST_STATE_SELECTED``: The item is selected. 
      - ``wx.LIST_STATE_CUT``: The item is in the cut state. Win32 only.  


                 

      :rtype: `long`








   .. method:: GetText(self)

      Returns the label/header text.                  

      :rtype: `string`








   .. method:: GetTextColour(self)

      Returns the text colour.                  

      :rtype: :ref:`wx.Colour`








   .. method:: GetWidth(self)

      Meaningful only for column headers in report mode.                  

      Returns the column width.                  

      :rtype: `int`








   .. method:: SetAlign(self, align)

      Sets the alignment for the item.                  

      See also :meth:`GetAlign`                    


      :param `align`: 
      :type `align`: wx.ListColumnFormat







   .. method:: SetBackgroundColour(self, colBack)

      Sets the background colour for the item.                  


      :param `colBack`: 
      :type `colBack`: wx.Colour







   .. method:: SetColumn(self, col)

      Sets the zero-based column.                  

      Meaningful only in report mode.                  


      :param `col`: 
      :type `col`: int







   .. method:: SetData(self, data)

      Sets client data for the item.                  

      Please note that client data is associated with the item and not with subitems.                  


      :param `data`: 
      :type `data`: long







   .. method:: SetFont(self, font)

      Sets the font for the item.                  


      :param `font`: 
      :type `font`: wx.Font







   .. method:: SetId(self, id)

      Sets the zero-based item position.                  


      :param `id`: 
      :type `id`: long







   .. method:: SetImage(self, image)

      Sets the zero-based index of the image associated with the item into the image list.                  


      :param `image`: 
      :type `image`: int







   .. method:: SetMask(self, mask)

      Sets the mask of valid fields.                  

      See :meth:`GetMask` .                  


      :param `mask`: 
      :type `mask`: long







   .. method:: SetState(self, state)

      Sets the item state flags (note that the valid state flags are influenced by the value of the state mask, see :meth:`wx.ListItem.SetStateMask` ).                  

      See :meth:`GetState`   for valid flag values.                  


      :param `state`: 
      :type `state`: long







   .. method:: SetStateMask(self, stateMask)

      Sets the bitmask that is used to determine which of the state flags are to be set.                  

      See also :meth:`SetState` .                  


      :param `stateMask`: 
      :type `stateMask`: long







   .. method:: SetText(self, text)

      Sets the text label for the item.                  


      :param `text`: 
      :type `text`: string







   .. method:: SetTextColour(self, colText)

      Sets the text colour for the item.                  


      :param `colText`: 
      :type `colText`: wx.Colour







   .. method:: SetWidth(self, width)

      Meaningful only for column headers in report mode.                  

      Sets the column width.                  


      :param `width`: 
      :type `width`: int







   .. attribute:: Align

      See :meth:`~wx.ListItem.GetAlign` and :meth:`~wx.ListItem.SetAlign`


   .. attribute:: BackgroundColour

      See :meth:`~wx.ListItem.GetBackgroundColour` and :meth:`~wx.ListItem.SetBackgroundColour`


   .. attribute:: Column

      See :meth:`~wx.ListItem.GetColumn` and :meth:`~wx.ListItem.SetColumn`


   .. attribute:: Data

      See :meth:`~wx.ListItem.GetData` and :meth:`~wx.ListItem.SetData`


   .. attribute:: Font

      See :meth:`~wx.ListItem.GetFont` and :meth:`~wx.ListItem.SetFont`


   .. attribute:: Id

      See :meth:`~wx.ListItem.GetId` and :meth:`~wx.ListItem.SetId`


   .. attribute:: Image

      See :meth:`~wx.ListItem.GetImage` and :meth:`~wx.ListItem.SetImage`


   .. attribute:: Mask

      See :meth:`~wx.ListItem.GetMask` and :meth:`~wx.ListItem.SetMask`


   .. attribute:: State

      See :meth:`~wx.ListItem.GetState` and :meth:`~wx.ListItem.SetState`


   .. attribute:: Text

      See :meth:`~wx.ListItem.GetText` and :meth:`~wx.ListItem.SetText`


   .. attribute:: TextColour

      See :meth:`~wx.ListItem.GetTextColour` and :meth:`~wx.ListItem.SetTextColour`


   .. attribute:: Width

      See :meth:`~wx.ListItem.GetWidth` and :meth:`~wx.ListItem.SetWidth`