1wxListCtrl(3) Erlang Module Definition wxListCtrl(3)
2
3
4
6 wxListCtrl - Functions for wxListCtrl class
7
9 A list control presents lists in a number of formats: list view, report
10 view, icon view and small icon view. In any case, elements are numbered
11 from zero. For all these modes, the items are stored in the control and
12 must be added to it using insertItem/4 method.
13
14 A special case of report view quite different from the other modes of
15 the list control is a virtual control in which the items data (includ‐
16 ing text, images and attributes) is managed by the main program and is
17 requested by the control itself only when needed which allows having
18 controls with millions of items without consuming much memory. To use
19 virtual list control you must use setItemCount/2 first and override at
20 least wxListCtrl::OnGetItemText (not implemented in wx) (and optionally
21 wxListCtrl::OnGetItemImage (not implemented in wx) or wxListC‐
22 trl::OnGetItemColumnImage (not implemented in wx) and wxListC‐
23 trl::OnGetItemAttr (not implemented in wx)) to return the information
24 about the items when the control requests it.
25
26 Virtual list control can be used as a normal one except that no opera‐
27 tions which can take time proportional to the number of items in the
28 control happen - this is required to allow having a practically infi‐
29 nite number of items. For example, in a multiple selection virtual list
30 control, the selections won't be sent when many items are selected at
31 once because this could mean iterating over all the items.
32
33 Using many of wxListCtrl features is shown in the corresponding sample.
34
35 To intercept events from a list control, use the event table macros de‐
36 scribed in wxListEvent.
37
38 wxMac Note: Starting with wxWidgets 2.8, wxListCtrl uses a native im‐
39 plementation for report mode, and uses a generic implementation for
40 other modes. You can use the generic implementation for report mode as
41 well by setting the mac.listctrl.always_use_generic system option (see
42 wxSystemOptions) to 1.
43
44 Styles
45
46 This class supports the following styles:
47
48 Note: Under wxMSW this control uses wxSystemThemedControl (not imple‐
49 mented in wx) for an explorer style appearance by default since wxWid‐
50 gets 3.1.0. If this is not desired, you can call wxSystemThemedCon‐
51 trol::EnableSystemTheme (not implemented in wx) with false argument to
52 disable this.
53
54 See: Overview listctrl, wxListView, wxListBox, wxTreeCtrl, wxImageList,
55 wxListEvent, wxListItem, wxEditableListBox (not implemented in wx)
56
57 This class is derived (and can use functions) from: wxControl wxWindow
58 wxEvtHandler
59
60 wxWidgets docs: wxListCtrl
61
63 Event types emitted from this class: command_list_begin_drag, com‐
64 mand_list_begin_rdrag, command_list_begin_label_edit, com‐
65 mand_list_end_label_edit, command_list_delete_item, com‐
66 mand_list_delete_all_items, command_list_item_selected, com‐
67 mand_list_item_deselected, command_list_item_activated, com‐
68 mand_list_item_focused, command_list_item_middle_click, com‐
69 mand_list_item_right_click, command_list_key_down, command_list_in‐
70 sert_item, command_list_col_click, command_list_col_right_click, com‐
71 mand_list_col_begin_drag, command_list_col_dragging, com‐
72 mand_list_col_end_drag, command_list_cache_hint
73
75 wxListCtrl() = wx:wx_object()
76
78 new() -> wxListCtrl()
79
80 Default constructor.
81
82 new(Parent, Options :: [Option]) -> wxListCtrl()
83
84 Types:
85
86 Parent = wxWindow:wxWindow()
87 Option =
88 {winid, integer()} |
89 {pos, {X :: integer(), Y :: integer()}} |
90 {size, {W :: integer(), H :: integer()}} |
91 {style, integer()} |
92 {validator, wx:wx_object()} |
93 {onGetItemText, function()} |
94 {onGetItemAttr, function()} |
95 {onGetItemColumnImage, function()}
96
97 Constructor, creating and showing a list control.
98
99 See: create/3, wxValidator (not implemented in wx)
100
101 destroy(This :: wxListCtrl()) -> ok
102
103 Destructor, destroying the list control.
104
105 arrange(This) -> boolean()
106
107 Types:
108
109 This = wxListCtrl()
110
111 arrange(This, Options :: [Option]) -> boolean()
112
113 Types:
114
115 This = wxListCtrl()
116 Option = {flag, integer()}
117
118 Arranges the items in icon or small icon view.
119
120 This only has effect on Win32. flag is one of:
121
122 assignImageList(This, ImageList, Which) -> ok
123
124 Types:
125
126 This = wxListCtrl()
127 ImageList = wxImageList:wxImageList()
128 Which = integer()
129
130 Sets the image list associated with the control and takes owner‐
131 ship of it (i.e.
132
133 the control will, unlike when using setImageList/3, delete the
134 list when destroyed). which is one of wxIMAGE_LIST_NORMAL, wxIM‐
135 AGE_LIST_SMALL, wxIMAGE_LIST_STATE (the last is unimplemented).
136
137 See: setImageList/3
138
139 clearAll(This) -> ok
140
141 Types:
142
143 This = wxListCtrl()
144
145 Deletes all items and all columns.
146
147 Note: This sends an event of type wxEVT_LIST_DELETE_ALL_ITEMS
148 under all platforms.
149
150 create(This, Parent, Options :: [Option]) -> boolean()
151
152 Types:
153
154 This = Parent = wxWindow:wxWindow()
155 Option =
156 {winid, integer()} |
157 {pos, {X :: integer(), Y :: integer()}} |
158 {size, {W :: integer(), H :: integer()}} |
159 {style, integer()} |
160 {validator, wx:wx_object()} |
161 {onGetItemText, function()} |
162 {onGetItemAttr, function()} |
163 {onGetItemColumnImage, function()}
164
165 Creates the list control.
166
167 See new/2 for further details.
168
169 deleteAllItems(This) -> boolean()
170
171 Types:
172
173 This = wxListCtrl()
174
175 Deletes all items in the list control.
176
177 This function does not send the wxEVT_LIST_DELETE_ITEM event be‐
178 cause deleting many items from the control would be too slow
179 then (unlike deleteItem/2) but it does send the special wx‐
180 EVT_LIST_DELETE_ALL_ITEMS event if the control was not empty. If
181 it was already empty, nothing is done and no event is sent.
182
183 Return: true if the items were successfully deleted or if the
184 control was already empty, false if an error occurred while
185 deleting the items.
186
187 deleteColumn(This, Col) -> boolean()
188
189 Types:
190
191 This = wxListCtrl()
192 Col = integer()
193
194 Deletes a column.
195
196 deleteItem(This, Item) -> boolean()
197
198 Types:
199
200 This = wxListCtrl()
201 Item = integer()
202
203 Deletes the specified item.
204
205 This function sends the wxEVT_LIST_DELETE_ITEM event for the
206 item being deleted.
207
208 See: deleteAllItems/1
209
210 editLabel(This, Item) -> wxTextCtrl:wxTextCtrl()
211
212 Types:
213
214 This = wxListCtrl()
215 Item = integer()
216
217 Starts editing the label of the given item.
218
219 This function generates a EVT_LIST_BEGIN_LABEL_EDIT event which
220 can be vetoed so that no text control will appear for in-place
221 editing.
222
223 If the user changed the label (i.e. s/he does not press ESC or
224 leave the text control without changes, a EVT_LIST_END_LA‐
225 BEL_EDIT event will be sent which can be vetoed as well.
226
227 ensureVisible(This, Item) -> boolean()
228
229 Types:
230
231 This = wxListCtrl()
232 Item = integer()
233
234 Ensures this item is visible.
235
236 findItem(This, Start, Str) -> integer()
237
238 Types:
239
240 This = wxListCtrl()
241 Start = integer()
242 Str = unicode:chardata()
243
244 findItem(This, Start, Str, Options :: [Option]) -> integer()
245
246 findItem(This, Start, Pt, Direction) -> integer()
247
248 Types:
249
250 This = wxListCtrl()
251 Start = integer()
252 Pt = {X :: integer(), Y :: integer()}
253 Direction = integer()
254
255 Find an item nearest this position in the specified direction,
256 starting from start or the beginning if start is -1.
257
258 Return: The next matching item if any or -1 (wxNOT_FOUND) other‐
259 wise.
260
261 getColumn(This, Col, Item) -> boolean()
262
263 Types:
264
265 This = wxListCtrl()
266 Col = integer()
267 Item = wxListItem:wxListItem()
268
269 Gets information about this column.
270
271 See setItem/5 for more information.
272
273 getColumnCount(This) -> integer()
274
275 Types:
276
277 This = wxListCtrl()
278
279 Returns the number of columns.
280
281 getColumnWidth(This, Col) -> integer()
282
283 Types:
284
285 This = wxListCtrl()
286 Col = integer()
287
288 Gets the column width (report view only).
289
290 getCountPerPage(This) -> integer()
291
292 Types:
293
294 This = wxListCtrl()
295
296 Gets the number of items that can fit vertically in the visible
297 area of the list control (list or report view) or the total num‐
298 ber of items in the list control (icon or small icon view).
299
300 getEditControl(This) -> wxTextCtrl:wxTextCtrl()
301
302 Types:
303
304 This = wxListCtrl()
305
306 Returns the edit control being currently used to edit a label.
307
308 Returns NULL if no label is being edited.
309
310 Note: It is currently only implemented for wxMSW and the generic
311 version, not for the native macOS version.
312
313 getImageList(This, Which) -> wxImageList:wxImageList()
314
315 Types:
316
317 This = wxListCtrl()
318 Which = integer()
319
320 Returns the specified image list.
321
322 which may be one of:
323
324 getItem(This, Info) -> boolean()
325
326 Types:
327
328 This = wxListCtrl()
329 Info = wxListItem:wxListItem()
330
331 Gets information about the item.
332
333 See setItem/5 for more information.
334
335 You must call info.SetId() to set the ID of item you're inter‐
336 ested in before calling this method, and info.SetMask() with the
337 flags indicating what fields you need to retrieve from info.
338
339 getItemBackgroundColour(This, Item) -> wx:wx_colour4()
340
341 Types:
342
343 This = wxListCtrl()
344 Item = integer()
345
346 Returns the colour for this item.
347
348 If the item has no specific colour, returns an invalid colour
349 (and not the default background control of the control itself).
350
351 See: getItemTextColour/2
352
353 getItemCount(This) -> integer()
354
355 Types:
356
357 This = wxListCtrl()
358
359 Returns the number of items in the list control.
360
361 getItemData(This, Item) -> integer()
362
363 Types:
364
365 This = wxListCtrl()
366 Item = integer()
367
368 Gets the application-defined data associated with this item.
369
370 getItemFont(This, Item) -> wxFont:wxFont()
371
372 Types:
373
374 This = wxListCtrl()
375 Item = integer()
376
377 Returns the item's font.
378
379 getItemPosition(This, Item) -> Result
380
381 Types:
382
383 Result =
384 {Res :: boolean(), Pos :: {X :: integer(), Y :: inte‐
385 ger()}}
386 This = wxListCtrl()
387 Item = integer()
388
389 Returns the position of the item, in icon or small icon view.
390
391 getItemRect(This, Item) -> Result
392
393 Types:
394
395 Result =
396 {Res :: boolean(),
397 Rect ::
398 {X :: integer(),
399 Y :: integer(),
400 W :: integer(),
401 H :: integer()}}
402 This = wxListCtrl()
403 Item = integer()
404
405 getItemRect(This, Item, Options :: [Option]) -> Result
406
407 Types:
408
409 Result =
410 {Res :: boolean(),
411 Rect ::
412 {X :: integer(),
413 Y :: integer(),
414 W :: integer(),
415 H :: integer()}}
416 This = wxListCtrl()
417 Item = integer()
418 Option = {code, integer()}
419
420 Returns the rectangle representing the item's size and position,
421 in physical coordinates.
422
423 code is one of wxLIST_RECT_BOUNDS, wxLIST_RECT_ICON,
424 wxLIST_RECT_LABEL.
425
426 getItemSpacing(This) -> {W :: integer(), H :: integer()}
427
428 Types:
429
430 This = wxListCtrl()
431
432 Retrieves the spacing between icons in pixels: horizontal spac‐
433 ing is returned as x component of the {Width,Height} object and
434 the vertical spacing as its y component.
435
436 getItemState(This, Item, StateMask) -> integer()
437
438 Types:
439
440 This = wxListCtrl()
441 Item = StateMask = integer()
442
443 Gets the item state.
444
445 For a list of state flags, see setItem/5. The stateMask indi‐
446 cates which state flags are of interest.
447
448 getItemText(This, Item) -> unicode:charlist()
449
450 Types:
451
452 This = wxListCtrl()
453 Item = integer()
454
455 getItemText(This, Item, Options :: [Option]) -> unicode:charlist()
456
457 Types:
458
459 This = wxListCtrl()
460 Item = integer()
461 Option = {col, integer()}
462
463 Gets the item text for this item.
464
465 getItemTextColour(This, Item) -> wx:wx_colour4()
466
467 Types:
468
469 This = wxListCtrl()
470 Item = integer()
471
472 Returns the colour for this item.
473
474 If the item has no specific colour, returns an invalid colour
475 (and not the default foreground control of the control itself as
476 this wouldn't allow distinguishing between items having the same
477 colour as the current control foreground and items with default
478 colour which, hence, have always the same colour as the con‐
479 trol).
480
481 getNextItem(This, Item) -> integer()
482
483 Types:
484
485 This = wxListCtrl()
486 Item = integer()
487
488 getNextItem(This, Item, Options :: [Option]) -> integer()
489
490 Types:
491
492 This = wxListCtrl()
493 Item = integer()
494 Option = {geometry, integer()} | {state, integer()}
495
496 Searches for an item with the given geometry or state, starting
497 from item but excluding the item itself.
498
499 If item is -1, the first item that matches the specified flags
500 will be returned. Returns the first item with given state fol‐
501 lowing item or -1 if no such item found. This function may be
502 used to find all selected items in the control like this:
503
504 geometry can be one of:
505
506 Note: this parameter is only supported by wxMSW currently and
507 ignored on other platforms.
508
509 state can be a bitlist of the following:
510
511 getSelectedItemCount(This) -> integer()
512
513 Types:
514
515 This = wxListCtrl()
516
517 Returns the number of selected items in the list control.
518
519 getTextColour(This) -> wx:wx_colour4()
520
521 Types:
522
523 This = wxListCtrl()
524
525 Gets the text colour of the list control.
526
527 getTopItem(This) -> integer()
528
529 Types:
530
531 This = wxListCtrl()
532
533 Gets the index of the topmost visible item when in list or re‐
534 port view.
535
536 getViewRect(This) ->
537 {X :: integer(),
538 Y :: integer(),
539 W :: integer(),
540 H :: integer()}
541
542 Types:
543
544 This = wxListCtrl()
545
546 Returns the rectangle taken by all items in the control.
547
548 In other words, if the controls client size were equal to the
549 size of this rectangle, no scrollbars would be needed and no
550 free space would be left.
551
552 Note that this function only works in the icon and small icon
553 views, not in list or report views (this is a limitation of the
554 native Win32 control).
555
556 hitTest(This, Point) -> Result
557
558 Types:
559
560 Result =
561 {Res :: integer(),
562 Flags :: integer(),
563 PtrSubItem :: integer()}
564 This = wxListCtrl()
565 Point = {X :: integer(), Y :: integer()}
566
567 Determines which item (if any) is at the specified point, giving
568 details in flags.
569
570 Returns index of the item or wxNOT_FOUND if no item is at the
571 specified point.
572
573 flags will be a combination of the following flags:
574
575 If ptrSubItem is not NULL and the wxListCtrl is in the report
576 mode the subitem (or column) number will also be provided. This
577 feature is only available in version 2.7.0 or higher and is cur‐
578 rently only implemented under wxMSW and requires at least com‐
579 ctl32.dll of version 4.70 on the host system or the value stored
580 in ptrSubItem will be always -1. To compile this feature into
581 wxWidgets library you need to have access to commctrl.h of ver‐
582 sion 4.70 that is provided by Microsoft.
583
584 insertColumn(This, Col, Heading) -> integer()
585
586 insertColumn(This, Col, Info) -> integer()
587
588 Types:
589
590 This = wxListCtrl()
591 Col = integer()
592 Info = wxListItem:wxListItem()
593
594 For report view mode (only), inserts a column.
595
596 For more details, see setItem/5. Also see insertColumn/4 over‐
597 load for a usually more convenient alternative to this method
598 and the description of how the item width is interpreted by this
599 method.
600
601 insertColumn(This, Col, Heading, Options :: [Option]) -> integer()
602
603 Types:
604
605 This = wxListCtrl()
606 Col = integer()
607 Heading = unicode:chardata()
608 Option = {format, integer()} | {width, integer()}
609
610 For report view mode (only), inserts a column.
611
612 Insert a new column in the list control in report view mode at
613 the given position specifying its most common attributes.
614
615 Notice that to set the image for the column you need to use in‐
616 sertColumn/4 overload and specify ?wxLIST_MASK_IMAGE in the item
617 mask.
618
619 Return: The index of the inserted column or -1 if adding it
620 failed.
621
622 insertItem(This, Info) -> integer()
623
624 Types:
625
626 This = wxListCtrl()
627 Info = wxListItem:wxListItem()
628
629 Inserts an item, returning the index of the new item if success‐
630 ful, -1 otherwise.
631
632 insertItem(This, Index, ImageIndex) -> integer()
633
634 insertItem(This, Index, Label) -> integer()
635
636 Types:
637
638 This = wxListCtrl()
639 Index = integer()
640 Label = unicode:chardata()
641
642 Insert a string item.
643
644 insertItem(This, Index, Label, ImageIndex) -> integer()
645
646 Types:
647
648 This = wxListCtrl()
649 Index = integer()
650 Label = unicode:chardata()
651 ImageIndex = integer()
652
653 Insert an image/string item.
654
655 refreshItem(This, Item) -> ok
656
657 Types:
658
659 This = wxListCtrl()
660 Item = integer()
661
662 Redraws the given item.
663
664 This is only useful for the virtual list controls as without
665 calling this function the displayed value of the item doesn't
666 change even when the underlying data does change.
667
668 See: refreshItems/3
669
670 refreshItems(This, ItemFrom, ItemTo) -> ok
671
672 Types:
673
674 This = wxListCtrl()
675 ItemFrom = ItemTo = integer()
676
677 Redraws the items between itemFrom and itemTo.
678
679 The starting item must be less than or equal to the ending one.
680
681 Just as refreshItem/2 this is only useful for virtual list con‐
682 trols.
683
684 scrollList(This, Dx, Dy) -> boolean()
685
686 Types:
687
688 This = wxListCtrl()
689 Dx = Dy = integer()
690
691 Scrolls the list control.
692
693 If in icon, small icon or report view mode, dx specifies the
694 number of pixels to scroll. If in list view mode, dx specifies
695 the number of columns to scroll. dy always specifies the number
696 of pixels to scroll vertically.
697
698 Note: This method is currently only implemented in the Windows
699 version.
700
701 setBackgroundColour(This, Col) -> boolean()
702
703 Types:
704
705 This = wxListCtrl()
706 Col = wx:wx_colour()
707
708 Sets the background colour.
709
710 Note that the wxWindow:getBackgroundColour/1 function of wxWin‐
711 dow base class can be used to retrieve the current background
712 colour.
713
714 setColumn(This, Col, Item) -> boolean()
715
716 Types:
717
718 This = wxListCtrl()
719 Col = integer()
720 Item = wxListItem:wxListItem()
721
722 Sets information about this column.
723
724 See setItem/5 for more information.
725
726 setColumnWidth(This, Col, Width) -> boolean()
727
728 Types:
729
730 This = wxListCtrl()
731 Col = Width = integer()
732
733 Sets the column width.
734
735 width can be a width in pixels or wxLIST_AUTOSIZE (-1) or
736 wxLIST_AUTOSIZE_USEHEADER (-2).
737
738 wxLIST_AUTOSIZE will resize the column to the length of its
739 longest item.
740
741 wxLIST_AUTOSIZE_USEHEADER will resize the column to the length
742 of the header (Win32) or 80 pixels (other platforms).
743
744 In small or normal icon view, col must be -1, and the column
745 width is set for all columns.
746
747 setImageList(This, ImageList, Which) -> ok
748
749 Types:
750
751 This = wxListCtrl()
752 ImageList = wxImageList:wxImageList()
753 Which = integer()
754
755 Sets the image list associated with the control.
756
757 which is one of wxIMAGE_LIST_NORMAL, wxIMAGE_LIST_SMALL, wxIM‐
758 AGE_LIST_STATE (the last is unimplemented).
759
760 This method does not take ownership of the image list, you have
761 to delete it yourself.
762
763 See: assignImageList/3
764
765 setItem(This, Info) -> boolean()
766
767 Types:
768
769 This = wxListCtrl()
770 Info = wxListItem:wxListItem()
771
772 Sets the data of an item.
773
774 Using the wxListItem's mask and state mask, you can change only
775 selected attributes of a wxListCtrl item.
776
777 Return: true if the item was successfully updated or false if
778 the update failed for some reason (e.g. an invalid item index).
779
780 setItem(This, Index, Column, Label) -> boolean()
781
782 Types:
783
784 This = wxListCtrl()
785 Index = Column = integer()
786 Label = unicode:chardata()
787
788 setItem(This, Index, Column, Label, Options :: [Option]) ->
789 boolean()
790
791 Types:
792
793 This = wxListCtrl()
794 Index = Column = integer()
795 Label = unicode:chardata()
796 Option = {imageId, integer()}
797
798 Sets an item string field at a particular column.
799
800 Return: true if the item was successfully updated or false if
801 the update failed for some reason (e.g. an invalid item index).
802
803 setItemBackgroundColour(This, Item, Col) -> ok
804
805 Types:
806
807 This = wxListCtrl()
808 Item = integer()
809 Col = wx:wx_colour()
810
811 Sets the background colour for this item.
812
813 This function only works in report view mode. The colour can be
814 retrieved using getItemBackgroundColour/2.
815
816 setItemCount(This, Count) -> ok
817
818 Types:
819
820 This = wxListCtrl()
821 Count = integer()
822
823 This method can only be used with virtual list controls.
824
825 It is used to indicate to the control the number of items it
826 contains. After calling it, the main program should be ready to
827 handle calls to various item callbacks (such as wxListC‐
828 trl::OnGetItemText (not implemented in wx)) for all items in the
829 range from 0 to count.
830
831 Notice that the control is not necessarily redrawn after this
832 call as it may be undesirable if an item which is not visible on
833 the screen anyhow was added to or removed from a control dis‐
834 playing many items, if you do need to refresh the display you
835 can just call wxWindow:refresh/2 manually.
836
837 setItemData(This, Item, Data) -> boolean()
838
839 Types:
840
841 This = wxListCtrl()
842 Item = Data = integer()
843
844 Associates application-defined data with this item.
845
846 Notice that this function cannot be used to associate pointers
847 with the control items, use SetItemPtrData() (not implemented in
848 wx) instead.
849
850 setItemFont(This, Item, Font) -> ok
851
852 Types:
853
854 This = wxListCtrl()
855 Item = integer()
856 Font = wxFont:wxFont()
857
858 Sets the item's font.
859
860 setItemImage(This, Item, Image) -> boolean()
861
862 Types:
863
864 This = wxListCtrl()
865 Item = Image = integer()
866
867 setItemImage(This, Item, Image, Options :: [Option]) -> boolean()
868
869 Types:
870
871 This = wxListCtrl()
872 Item = Image = integer()
873 Option = {selImage, integer()}
874
875 Sets the unselected and selected images associated with the
876 item.
877
878 The images are indices into the image list associated with the
879 list control.
880
881 setItemColumnImage(This, Item, Column, Image) -> boolean()
882
883 Types:
884
885 This = wxListCtrl()
886 Item = Column = Image = integer()
887
888 Sets the image associated with the item.
889
890 In report view, you can specify the column. The image is an in‐
891 dex into the image list associated with the list control.
892
893 setItemPosition(This, Item, Pos) -> boolean()
894
895 Types:
896
897 This = wxListCtrl()
898 Item = integer()
899 Pos = {X :: integer(), Y :: integer()}
900
901 Sets the position of the item, in icon or small icon view.
902
903 Windows only.
904
905 setItemState(This, Item, State, StateMask) -> boolean()
906
907 Types:
908
909 This = wxListCtrl()
910 Item = State = StateMask = integer()
911
912 Sets the item state.
913
914 The stateMask is a combination of wxLIST_STATE_XXX constants de‐
915 scribed in wxListItem documentation. For each of the bits speci‐
916 fied in stateMask, the corresponding state is set or cleared de‐
917 pending on whether state argument contains the same bit or not.
918
919 So to select an item you can use while to deselect it you should
920 use
921
922 Consider using wxListView if possible to avoid dealing with this
923 error-prone and confusing method.
924
925 Also notice that contrary to the usual rule that only user ac‐
926 tions generate events, this method does generate wx‐
927 EVT_LIST_ITEM_SELECTED event when it is used to select an item.
928
929 setItemText(This, Item, Text) -> ok
930
931 Types:
932
933 This = wxListCtrl()
934 Item = integer()
935 Text = unicode:chardata()
936
937 Sets the item text for this item.
938
939 setItemTextColour(This, Item, Col) -> ok
940
941 Types:
942
943 This = wxListCtrl()
944 Item = integer()
945 Col = wx:wx_colour()
946
947 Sets the colour for this item.
948
949 This function only works in report view. The colour can be re‐
950 trieved using getItemTextColour/2.
951
952 setSingleStyle(This, Style) -> ok
953
954 Types:
955
956 This = wxListCtrl()
957 Style = integer()
958
959 setSingleStyle(This, Style, Options :: [Option]) -> ok
960
961 Types:
962
963 This = wxListCtrl()
964 Style = integer()
965 Option = {add, boolean()}
966
967 Adds or removes a single window style.
968
969 setTextColour(This, Col) -> ok
970
971 Types:
972
973 This = wxListCtrl()
974 Col = wx:wx_colour()
975
976 Sets the text colour of the list control.
977
978 setWindowStyleFlag(This, Style) -> ok
979
980 Types:
981
982 This = wxListCtrl()
983 Style = integer()
984
985 Sets the whole window style, deleting all items.
986
987 sortItems(This :: wxListCtrl(), SortCallBack) -> boolean()
988
989 Types:
990
991 SortCallBack = fun((integer(), integer()) -> integer())
992
993 Sort the items in the list control.
994
995 Sorts the items with supplied SortCallBack fun.
996
997 SortCallBack receives the client data associated with two items
998 to compare (NOT the the index), and should return 0 if the items
999 are equal, a negative value if the first item is less than the
1000 second one and a positive value if the first item is greater
1001 than the second one.
1002
1003 Remark: Notice that the control may only be sorted on client
1004 data associated with the items, so you must use SetItemData if
1005 you want to be able to sort the items in the control.
1006
1007 The callback may not call other (wx) processes.
1008
1009
1010
1011wxWidgets team. wx 2.2.2 wxListCtrl(3)