1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG interface file for wxListCtrl and related classes
7 // Created: 10-June-1998
9 // Copyright: (c) 2002 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
16 //---------------------------------------------------------------------------
19 #include <wx/listctrl.h>
22 MAKE_CONST_WXSTRING(ListCtrlNameStr);
24 //---------------------------------------------------------------------------
55 // Mask flags to tell app/GUI what fields of wxListItem are valid
64 // State flags for indicating the state of an item
65 wxLIST_STATE_DONTCARE,
66 wxLIST_STATE_DROPHILITED,
68 wxLIST_STATE_SELECTED,
70 wxLIST_STATE_DISABLED,
71 wxLIST_STATE_FILTERED,
76 // Hit test flags, used in HitTest
79 wxLIST_HITTEST_NOWHERE,
80 wxLIST_HITTEST_ONITEMICON,
81 wxLIST_HITTEST_ONITEMLABEL,
82 wxLIST_HITTEST_ONITEMRIGHT,
83 wxLIST_HITTEST_ONITEMSTATEICON,
84 wxLIST_HITTEST_TOLEFT,
85 wxLIST_HITTEST_TORIGHT,
86 wxLIST_HITTEST_ONITEM,
90 // Flags for GetNextItem (MSW only except wxLIST_NEXT_ALL)
93 wxLIST_NEXT_ABOVE, // Searches for an item above the specified item
94 wxLIST_NEXT_ALL, // Searches for subsequent item by index
95 wxLIST_NEXT_BELOW, // Searches for an item below the specified item
96 wxLIST_NEXT_LEFT, // Searches for an item to the left of the specified item
97 wxLIST_NEXT_RIGHT // Searches for an item to the right of the specified item
100 // Alignment flags for Arrange (MSW only except wxLIST_ALIGN_LEFT)
103 wxLIST_ALIGN_DEFAULT,
106 wxLIST_ALIGN_SNAP_TO_GRID
109 // Column format (MSW only except wxLIST_FORMAT_LEFT)
110 enum wxListColumnFormat
114 wxLIST_FORMAT_CENTRE,
115 wxLIST_FORMAT_CENTER = wxLIST_FORMAT_CENTRE
118 // Autosize values for SetColumnWidth
121 wxLIST_AUTOSIZE = -1,
122 wxLIST_AUTOSIZE_USEHEADER = -2 // partly supported by generic version
125 // Flag values for GetItemRect
133 // Flag values for FindItem (MSW only)
144 //---------------------------------------------------------------------------
147 // wxListItemAttr: a structure containing the visual attributes of an item
153 wxListItemAttr(const wxColour& colText = wxNullColour,
154 const wxColour& colBack = wxNullColour,
155 const wxFont& font = wxNullFont);
159 void SetTextColour(const wxColour& colText);
160 void SetBackgroundColour(const wxColour& colBack);
161 void SetFont(const wxFont& font);
164 bool HasTextColour();
165 bool HasBackgroundColour();
168 wxColour GetTextColour();
169 wxColour GetBackgroundColour();
172 %extend { void Destroy() { delete self; } }
178 //---------------------------------------------------------------------------
182 // wxListItem: the item or column info, used to exchange data with wxListCtrl
183 class wxListItem : public wxObject {
190 void ClearAttributes();
193 void SetMask(long mask);
195 void SetColumn(int col);
196 void SetState(long state);
197 void SetStateMask(long stateMask);
198 void SetText(const wxString& text);
199 void SetImage(int image);
200 void SetData(long data);
202 void SetWidth(int width);
203 void SetAlign(wxListColumnFormat align);
205 void SetTextColour(const wxColour& colText);
206 void SetBackgroundColour(const wxColour& colBack);
207 void SetFont(const wxFont& font);
214 const wxString& GetText();
219 wxListColumnFormat GetAlign();
221 wxListItemAttr *GetAttributes();
222 bool HasAttributes();
224 wxColour GetTextColour() const;
225 wxColour GetBackgroundColour() const;
226 wxFont GetFont() const;
228 // these members are public for compatibility
229 long m_mask; // Indicates what fields are valid
230 long m_itemId; // The zero-based item position
231 int m_col; // Zero-based column, if in report mode
232 long m_state; // The state of the item
233 long m_stateMask;// Which flags of m_state are valid (uses same flags)
234 wxString m_text; // The label/header text
235 int m_image; // The zero-based index into an image list
236 long m_data; // App-defined data
239 int m_format; // left, right, centre
240 int m_width; // width of column
245 //---------------------------------------------------------------------------
249 // wxListEvent - the event class for the wxListCtrl notifications
250 class wxListEvent: public wxNotifyEvent {
252 wxListEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
264 %pythoncode { GetCode = GetKeyCode }
268 %pythoncode { GetPosition = GetPoint }
269 const wxString& GetLabel();
270 const wxString& GetText();
274 const wxListItem& GetItem();
279 // was label editing canceled? (for wxEVT_COMMAND_LIST_END_LABEL_EDIT only)
280 bool IsEditCancelled() const;
281 void SetEditCanceled(bool editCancelled);
284 /* List control event types */
285 %constant wxEventType wxEVT_COMMAND_LIST_BEGIN_DRAG;
286 %constant wxEventType wxEVT_COMMAND_LIST_BEGIN_RDRAG;
287 %constant wxEventType wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT;
288 %constant wxEventType wxEVT_COMMAND_LIST_END_LABEL_EDIT;
289 %constant wxEventType wxEVT_COMMAND_LIST_DELETE_ITEM;
290 %constant wxEventType wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS;
291 %constant wxEventType wxEVT_COMMAND_LIST_ITEM_SELECTED;
292 %constant wxEventType wxEVT_COMMAND_LIST_ITEM_DESELECTED;
293 %constant wxEventType wxEVT_COMMAND_LIST_KEY_DOWN;
294 %constant wxEventType wxEVT_COMMAND_LIST_INSERT_ITEM;
295 %constant wxEventType wxEVT_COMMAND_LIST_COL_CLICK;
296 %constant wxEventType wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK;
297 %constant wxEventType wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK;
298 %constant wxEventType wxEVT_COMMAND_LIST_ITEM_ACTIVATED;
299 %constant wxEventType wxEVT_COMMAND_LIST_CACHE_HINT;
300 %constant wxEventType wxEVT_COMMAND_LIST_COL_RIGHT_CLICK;
301 %constant wxEventType wxEVT_COMMAND_LIST_COL_BEGIN_DRAG;
302 %constant wxEventType wxEVT_COMMAND_LIST_COL_DRAGGING;
303 %constant wxEventType wxEVT_COMMAND_LIST_COL_END_DRAG;
304 %constant wxEventType wxEVT_COMMAND_LIST_ITEM_FOCUSED;
306 // WXWIN_COMPATIBILITY_2_4
308 %constant wxEventType wxEVT_COMMAND_LIST_GET_INFO;
309 %constant wxEventType wxEVT_COMMAND_LIST_SET_INFO;
314 EVT_LIST_BEGIN_DRAG = wx.PyEventBinder(wxEVT_COMMAND_LIST_BEGIN_DRAG , 1)
315 EVT_LIST_BEGIN_RDRAG = wx.PyEventBinder(wxEVT_COMMAND_LIST_BEGIN_RDRAG , 1)
316 EVT_LIST_BEGIN_LABEL_EDIT = wx.PyEventBinder(wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT , 1)
317 EVT_LIST_END_LABEL_EDIT = wx.PyEventBinder(wxEVT_COMMAND_LIST_END_LABEL_EDIT , 1)
318 EVT_LIST_DELETE_ITEM = wx.PyEventBinder(wxEVT_COMMAND_LIST_DELETE_ITEM , 1)
319 EVT_LIST_DELETE_ALL_ITEMS = wx.PyEventBinder(wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS , 1)
320 #WXWIN_COMPATIBILITY_2_4
321 #EVT_LIST_GET_INFO = wx.PyEventBinder(wxEVT_COMMAND_LIST_GET_INFO , 1)
322 #EVT_LIST_SET_INFO = wx.PyEventBinder(wxEVT_COMMAND_LIST_SET_INFO , 1)
323 #END WXWIN_COMPATIBILITY_2_4
324 EVT_LIST_ITEM_SELECTED = wx.PyEventBinder(wxEVT_COMMAND_LIST_ITEM_SELECTED , 1)
325 EVT_LIST_ITEM_DESELECTED = wx.PyEventBinder(wxEVT_COMMAND_LIST_ITEM_DESELECTED , 1)
326 EVT_LIST_KEY_DOWN = wx.PyEventBinder(wxEVT_COMMAND_LIST_KEY_DOWN , 1)
327 EVT_LIST_INSERT_ITEM = wx.PyEventBinder(wxEVT_COMMAND_LIST_INSERT_ITEM , 1)
328 EVT_LIST_COL_CLICK = wx.PyEventBinder(wxEVT_COMMAND_LIST_COL_CLICK , 1)
329 EVT_LIST_ITEM_RIGHT_CLICK = wx.PyEventBinder(wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK , 1)
330 EVT_LIST_ITEM_MIDDLE_CLICK = wx.PyEventBinder(wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK, 1)
331 EVT_LIST_ITEM_ACTIVATED = wx.PyEventBinder(wxEVT_COMMAND_LIST_ITEM_ACTIVATED , 1)
332 EVT_LIST_CACHE_HINT = wx.PyEventBinder(wxEVT_COMMAND_LIST_CACHE_HINT , 1)
333 EVT_LIST_COL_RIGHT_CLICK = wx.PyEventBinder(wxEVT_COMMAND_LIST_COL_RIGHT_CLICK , 1)
334 EVT_LIST_COL_BEGIN_DRAG = wx.PyEventBinder(wxEVT_COMMAND_LIST_COL_BEGIN_DRAG , 1)
335 EVT_LIST_COL_DRAGGING = wx.PyEventBinder(wxEVT_COMMAND_LIST_COL_DRAGGING , 1)
336 EVT_LIST_COL_END_DRAG = wx.PyEventBinder(wxEVT_COMMAND_LIST_COL_END_DRAG , 1)
337 EVT_LIST_ITEM_FOCUSED = wx.PyEventBinder(wxEVT_COMMAND_LIST_ITEM_FOCUSED , 1)
339 #WXWIN_COMPATIBILITY_2_4
340 #EVT_LIST_GET_INFO = wx._deprecated(EVT_LIST_GET_INFO)
341 #EVT_LIST_SET_INFO = wx._deprecated(EVT_LIST_SET_INFO)
344 //---------------------------------------------------------------------------
348 %{ // Python aware sorting function for wxPyListCtrl
349 static int wxCALLBACK wxPyListCtrl_SortItems(long item1, long item2, long funcPtr) {
351 PyObject* func = (PyObject*)funcPtr;
352 wxPyBlock_t blocked = wxPyBeginBlockThreads();
354 PyObject* args = Py_BuildValue("(ii)", item1, item2);
355 PyObject* result = PyEval_CallObject(func, args);
358 retval = PyInt_AsLong(result);
362 wxPyEndBlockThreads(blocked);
369 %{ // C++ Version of a Python aware class
370 class wxPyListCtrl : public wxListCtrl {
371 DECLARE_ABSTRACT_CLASS(wxPyListCtrl)
373 wxPyListCtrl() : wxListCtrl() {}
374 wxPyListCtrl(wxWindow* parent, wxWindowID id,
378 const wxValidator& validator,
379 const wxString& name) :
380 wxListCtrl(parent, id, pos, size, style, validator, name) {}
382 bool Create(wxWindow* parent, wxWindowID id,
386 const wxValidator& validator,
387 const wxString& name) {
388 return wxListCtrl::Create(parent, id, pos, size, style, validator, name);
391 DEC_PYCALLBACK_STRING_LONGLONG(OnGetItemText);
392 DEC_PYCALLBACK_LISTATTR_LONG(OnGetItemAttr);
394 // use the virtual version to avoid a confusing assert in the base class
395 DEC_PYCALLBACK_INT_LONG_virtual(OnGetItemImage);
396 DEC_PYCALLBACK_INT_LONGLONG(OnGetItemColumnImage);
401 IMPLEMENT_ABSTRACT_CLASS(wxPyListCtrl, wxListCtrl);
403 IMP_PYCALLBACK_STRING_LONGLONG(wxPyListCtrl, wxListCtrl, OnGetItemText);
404 IMP_PYCALLBACK_LISTATTR_LONG(wxPyListCtrl, wxListCtrl, OnGetItemAttr);
405 IMP_PYCALLBACK_INT_LONG_virtual(wxPyListCtrl, wxListCtrl, OnGetItemImage);
406 IMP_PYCALLBACK_INT_LONGLONG(wxPyListCtrl, wxListCtrl, OnGetItemColumnImage);
414 MustHaveApp(wxPyListCtrl);
416 %rename(ListCtrl) wxPyListCtrl;
417 class wxPyListCtrl : public wxControl {
420 %pythonAppend wxPyListCtrl "self._setOORInfo(self);self._setCallbackInfo(self, ListCtrl)"
421 %pythonAppend wxPyListCtrl() ""
423 wxPyListCtrl(wxWindow* parent, wxWindowID id = -1,
424 const wxPoint& pos = wxDefaultPosition,
425 const wxSize& size = wxDefaultSize,
426 long style = wxLC_ICON,
427 const wxValidator& validator = wxDefaultValidator,
428 const wxString& name = wxPyListCtrlNameStr);
429 %RenameCtor(PreListCtrl, wxPyListCtrl());
431 bool Create(wxWindow* parent, wxWindowID id = -1,
432 const wxPoint& pos = wxDefaultPosition,
433 const wxSize& size = wxDefaultSize,
434 long style = wxLC_ICON,
435 const wxValidator& validator = wxDefaultValidator,
436 const wxString& name = wxPyListCtrlNameStr);
438 void _setCallbackInfo(PyObject* self, PyObject* _class);
441 // Set the control colours
442 bool SetForegroundColour(const wxColour& col);
443 bool SetBackgroundColour(const wxColour& col);
445 // Gets information about this column
446 %pythonAppend GetColumn "if val is not None: val.thisown = 1"; // %newobject doesn't work with OOR typemap
448 wxListItem* GetColumn(int col) {
450 item.SetMask( wxLIST_MASK_STATE |
458 if (self->GetColumn(col, item))
459 return new wxListItem(item);
465 // Sets information about this column
466 bool SetColumn(int col, wxListItem& item) ;
468 // Gets the column width
469 int GetColumnWidth(int col) const;
471 // Sets the column width
472 bool SetColumnWidth(int col, int width) ;
474 // Gets the number of items that can fit vertically in the
475 // visible area of the list control (list or report view)
476 // or the total number of items in the list control (icon
477 // or small icon view)
478 int GetCountPerPage() const;
480 // return the total area occupied by all the items (icon/small icon only)
481 wxRect GetViewRect() const;
484 // Gets the edit control for editing labels.
485 wxTextCtrl* GetEditControl() const;
488 // Gets information about the item
489 %pythonAppend GetItem "if val is not None: val.thisown = 1"; // %newobject doesn't work with OOR typemap
491 wxListItem* GetItem(long itemId, int col=0) {
492 wxListItem* info = new wxListItem;
493 info->m_itemId = itemId;
495 info->m_mask = 0xFFFF;
496 self->GetItem(*info);
501 // Sets information about the item
502 bool SetItem(wxListItem& info) ;
504 // Sets a string field at a particular column
505 %Rename(SetStringItem, long, SetItem(long index, int col, const wxString& label, int imageId = -1));
507 // Gets the item state
508 int GetItemState(long item, long stateMask) const ;
510 // Sets the item state
511 bool SetItemState(long item, long state, long stateMask) ;
513 // Sets the item image
514 bool SetItemImage(long item, int image, int selImage=-1) ;
516 // Gets the item text
517 wxString GetItemText(long item) const ;
519 // Sets the item text
520 void SetItemText(long item, const wxString& str) ;
522 // Gets the item data
523 long GetItemData(long item) const ;
525 // Sets the item data
526 bool SetItemData(long item, long data) ;
529 //bool GetItemRect(long item, wxRect& rect, int code = wxLIST_RECT_BOUNDS) const ;
530 //bool GetItemPosition(long item, wxPoint& pos) const ;
532 // Gets the item position
534 wxPoint GetItemPosition(long item) {
536 self->GetItemPosition(item, pos);
539 // Gets the item rectangle
540 wxRect GetItemRect(long item, int code = wxLIST_RECT_BOUNDS) {
542 self->GetItemRect(item, rect, code);
548 // Sets the item position
549 bool SetItemPosition(long item, const wxPoint& pos) ;
551 // Gets the number of items in the list control
552 int GetItemCount() const;
554 // Gets the number of columns in the list control
555 int GetColumnCount() const;
557 // get the horizontal and vertical components of the item spacing
558 wxSize GetItemSpacing() const;
561 void SetItemSpacing( int spacing, bool isSmall = false );
564 // Gets the number of selected items in the list control
565 int GetSelectedItemCount() const;
567 // Gets the text colour of the listview
568 wxColour GetTextColour() const;
570 // Sets the text colour of the listview
571 void SetTextColour(const wxColour& col);
573 // Gets the index of the topmost visible item when in
574 // list or report view
575 long GetTopItem() const ;
577 // Add or remove a single window style
578 void SetSingleStyle(long style, bool add = true) ;
580 // Set the whole window style
581 void SetWindowStyleFlag(long style) ;
583 // Searches for an item, starting from 'item'.
584 // item can be -1 to find the first item that matches the
586 // Returns the item or -1 if unsuccessful.
587 long GetNextItem(long item, int geometry = wxLIST_NEXT_ALL, int state = wxLIST_STATE_DONTCARE) const ;
589 // Gets one of the three image lists
590 wxImageList *GetImageList(int which) const ;
592 // Sets the image list
593 void SetImageList(wxImageList *imageList, int which);
595 // is there a way to tell SWIG to disown this???
597 %apply SWIGTYPE *DISOWN { wxImageList *imageList };
598 void AssignImageList(wxImageList *imageList, int which);
599 %clear wxImageList *imageList;
601 // are we in report mode?
602 bool InReportView() const;
604 // returns True if it is a virtual list control
605 bool IsVirtual() const;
607 // refresh items selectively (only useful for virtual list controls)
608 void RefreshItem(long item);
609 void RefreshItems(long itemFrom, long itemTo);
611 // Arranges the items
612 bool Arrange(int flag = wxLIST_ALIGN_DEFAULT);
615 bool DeleteItem(long item);
618 bool DeleteAllItems() ;
621 bool DeleteColumn(int col);
623 // Deletes all columns
624 bool DeleteAllColumns();
626 // Clears items, and columns if there are any.
631 wxTextCtrl* EditLabel(long item /*, wxClassInfo* textControlClass = CLASSINFO(wxTextCtrl)*/);
633 // End label editing, optionally cancelling the edit
634 bool EndEditLabel(bool cancel);
636 void EditLabel(long item);
639 // Ensures this item is visible
640 bool EnsureVisible(long item) ;
642 // Find an item whose label matches this string, starting from the item after 'start'
643 // or the beginning if 'start' is -1.
644 long FindItem(long start, const wxString& str, bool partial = false);
646 // Find an item whose data matches this data, starting from the item after 'start'
647 // or the beginning if 'start' is -1.
648 %Rename(FindItemData, long, FindItem(long start, long data));
650 // Find an item nearest this position in the specified direction, starting from
651 // the item after 'start' or the beginning if 'start' is -1.
652 %Rename(FindItemAtPos, long, FindItem(long start, const wxPoint& pt, int direction));
656 long, HitTest(const wxPoint& point, int& OUTPUT),
657 "HitTest(Point point) -> (item, where)",
658 "Determines which item (if any) is at the specified point, giving
659 details in the second return value (see wx.LIST_HITTEST flags.)", "");
661 // Inserts an item, returning the index of the new item if successful,
663 long InsertItem(wxListItem& info);
665 // Insert a string item
666 %Rename(InsertStringItem,
667 long, InsertItem(long index, const wxString& label, int imageIndex=-1));
669 // Insert an image item
670 %Rename(InsertImageItem,
671 long, InsertItem(long index, int imageIndex));
673 // Insert an image/string item
674 %Rename(InsertImageStringItem,
675 long, InsertItem(long index, const wxString& label, int imageIndex));
677 // For list view mode (only), inserts a column.
678 %Rename(InsertColumnItem, long, InsertColumn(long col, wxListItem& info));
679 %pythoncode { InsertColumnInfo = InsertColumnItem }
681 long InsertColumn(long col,
682 const wxString& heading,
683 int format = wxLIST_FORMAT_LEFT,
686 // set the number of items in a virtual list control
687 void SetItemCount(long count);
689 // Scrolls the list control. If in icon, small icon or report view mode,
690 // x specifies the number of pixels to scroll. If in list view mode, x
691 // specifies the number of columns to scroll.
692 // If in icon, small icon or list view mode, y specifies the number of pixels
693 // to scroll. If in report view mode, y specifies the number of lines to scroll.
694 bool ScrollList(int dx, int dy);
696 void SetItemTextColour( long item, const wxColour& col);
697 wxColour GetItemTextColour( long item ) const;
698 void SetItemBackgroundColour( long item, const wxColour &col);
699 wxColour GetItemBackgroundColour( long item ) const;
702 void SetItemFont( long item, const wxFont &f);
703 wxFont GetItemFont( long item ) const;
708 def Select(self, idx, on=1):
709 '''[de]select an item'''
710 if on: state = wx.LIST_STATE_SELECTED
712 self.SetItemState(idx, state, wx.LIST_STATE_SELECTED)
714 def Focus(self, idx):
715 '''Focus and show the given item'''
716 self.SetItemState(idx, wx.LIST_STATE_FOCUSED, wx.LIST_STATE_FOCUSED)
717 self.EnsureVisible(idx)
719 def GetFocusedItem(self):
720 '''get the currently focused item or -1 if none'''
721 return self.GetNextItem(-1, wx.LIST_NEXT_ALL, wx.LIST_STATE_FOCUSED)
723 def GetFirstSelected(self, *args):
724 '''return first selected item, or -1 when none'''
725 return self.GetNextSelected(-1)
727 def GetNextSelected(self, item):
728 '''return subsequent selected items, or -1 when no more'''
729 return self.GetNextItem(item, wx.LIST_NEXT_ALL, wx.LIST_STATE_SELECTED)
731 def IsSelected(self, idx):
732 '''return True if the item is selected'''
733 return (self.GetItemState(idx, wx.LIST_STATE_SELECTED) & wx.LIST_STATE_SELECTED) != 0
735 def SetColumnImage(self, col, image):
736 item = self.GetColumn(col)
737 %# preserve all other attributes too
738 item.SetMask( wx.LIST_MASK_STATE |
744 wx.LIST_MASK_FORMAT )
746 self.SetColumn(col, item)
748 def ClearColumnImage(self, col):
749 self.SetColumnImage(col, -1)
751 def Append(self, entry):
752 '''Append an item to the list control. The entry parameter should be a
753 sequence with an item for each column'''
759 pos = self.GetItemCount()
760 self.InsertStringItem(pos, cvtfunc(entry[0]))
761 for i in range(1, len(entry)):
762 self.SetStringItem(pos, i, cvtfunc(entry[i]))
767 // bool SortItems(wxListCtrlCompare fn, long data);
770 // func is a function which takes 2 long arguments: item1, item2.
771 // item1 is the long data associated with a first item (NOT the index).
772 // item2 is the long data associated with a second item (NOT the index).
773 // The return value is a negative number if the first item should precede the second
774 // item, a positive number of the second item should precede the first,
775 // or zero if the two items are equivalent.
776 bool SortItems(PyObject* func) {
777 if (!PyCallable_Check(func))
779 return self->SortItems((wxListCtrlCompare)wxPyListCtrl_SortItems, (long)func);
785 wxWindow* GetMainWindow() {
789 return (wxWindow*)self->m_mainWin;
794 static wxVisualAttributes
795 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
800 //---------------------------------------------------------------------------
804 MustHaveApp(wxListView);
806 // wxListView: a class which provides a little better API for list control
807 class wxListView : public wxPyListCtrl
810 %pythonAppend wxListView "self._setOORInfo(self)"
811 %pythonAppend wxListView() ""
813 wxListView( wxWindow *parent,
815 const wxPoint& pos = wxDefaultPosition,
816 const wxSize& size = wxDefaultSize,
817 long style = wxLC_REPORT,
818 const wxValidator& validator = wxDefaultValidator,
819 const wxString& name = wxPyListCtrlNameStr);
820 %RenameCtor(PreListView, wxListView());
822 bool Create( wxWindow *parent,
824 const wxPoint& pos = wxDefaultPosition,
825 const wxSize& size = wxDefaultSize,
826 long style = wxLC_REPORT,
827 const wxValidator& validator = wxDefaultValidator,
828 const wxString& name = wxPyListCtrlNameStr);
830 // [de]select an item
831 void Select(long n, bool on = true);
833 // focus and show the given item
834 void Focus(long index);
836 // get the currently focused item or -1 if none
837 long GetFocusedItem() const;
839 // get first and subsequent selected items, return -1 when no more
840 long GetNextSelected(long item) const;
841 long GetFirstSelected() const;
843 // return True if the item is selected
844 bool IsSelected(long index);
846 void SetColumnImage(int col, int image);
847 void ClearColumnImage(int col);
852 //---------------------------------------------------------------------------
855 // Map renamed classes back to their common name for OOR
856 wxPyPtrTypeMap_Add("wxListCtrl", "wxPyListCtrl");
859 //---------------------------------------------------------------------------