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 void AssignFrom(const wxListItemAttr& source);
174 %pythonAppend Destroy "args[0].thisown = 0"
175 %extend { void Destroy() { delete self; } }
181 //---------------------------------------------------------------------------
185 // wxListItem: the item or column info, used to exchange data with wxListCtrl
186 class wxListItem : public wxObject {
193 void ClearAttributes();
196 void SetMask(long mask);
198 void SetColumn(int col);
199 void SetState(long state);
200 void SetStateMask(long stateMask);
201 void SetText(const wxString& text);
202 void SetImage(int image);
203 void SetData(long data);
205 void SetWidth(int width);
206 void SetAlign(wxListColumnFormat align);
208 void SetTextColour(const wxColour& colText);
209 void SetBackgroundColour(const wxColour& colBack);
210 void SetFont(const wxFont& font);
217 const wxString& GetText();
222 wxListColumnFormat GetAlign();
224 wxListItemAttr *GetAttributes();
225 bool HasAttributes();
227 wxColour GetTextColour() const;
228 wxColour GetBackgroundColour() const;
229 wxFont GetFont() const;
231 // these members are public for compatibility
232 long m_mask; // Indicates what fields are valid
233 long m_itemId; // The zero-based item position
234 int m_col; // Zero-based column, if in report mode
235 long m_state; // The state of the item
236 long m_stateMask;// Which flags of m_state are valid (uses same flags)
237 wxString m_text; // The label/header text
238 int m_image; // The zero-based index into an image list
239 long m_data; // App-defined data
242 int m_format; // left, right, centre
243 int m_width; // width of column
248 //---------------------------------------------------------------------------
252 // wxListEvent - the event class for the wxListCtrl notifications
253 class wxListEvent: public wxNotifyEvent {
255 wxListEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
267 %pythoncode { GetCode = GetKeyCode }
271 %pythoncode { GetPosition = GetPoint }
272 const wxString& GetLabel();
273 const wxString& GetText();
277 const wxListItem& GetItem();
282 // was label editing canceled? (for wxEVT_COMMAND_LIST_END_LABEL_EDIT only)
283 bool IsEditCancelled() const;
284 void SetEditCanceled(bool editCancelled);
287 /* List control event types */
288 %constant wxEventType wxEVT_COMMAND_LIST_BEGIN_DRAG;
289 %constant wxEventType wxEVT_COMMAND_LIST_BEGIN_RDRAG;
290 %constant wxEventType wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT;
291 %constant wxEventType wxEVT_COMMAND_LIST_END_LABEL_EDIT;
292 %constant wxEventType wxEVT_COMMAND_LIST_DELETE_ITEM;
293 %constant wxEventType wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS;
294 %constant wxEventType wxEVT_COMMAND_LIST_ITEM_SELECTED;
295 %constant wxEventType wxEVT_COMMAND_LIST_ITEM_DESELECTED;
296 %constant wxEventType wxEVT_COMMAND_LIST_KEY_DOWN;
297 %constant wxEventType wxEVT_COMMAND_LIST_INSERT_ITEM;
298 %constant wxEventType wxEVT_COMMAND_LIST_COL_CLICK;
299 %constant wxEventType wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK;
300 %constant wxEventType wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK;
301 %constant wxEventType wxEVT_COMMAND_LIST_ITEM_ACTIVATED;
302 %constant wxEventType wxEVT_COMMAND_LIST_CACHE_HINT;
303 %constant wxEventType wxEVT_COMMAND_LIST_COL_RIGHT_CLICK;
304 %constant wxEventType wxEVT_COMMAND_LIST_COL_BEGIN_DRAG;
305 %constant wxEventType wxEVT_COMMAND_LIST_COL_DRAGGING;
306 %constant wxEventType wxEVT_COMMAND_LIST_COL_END_DRAG;
307 %constant wxEventType wxEVT_COMMAND_LIST_ITEM_FOCUSED;
309 // WXWIN_COMPATIBILITY_2_4
311 %constant wxEventType wxEVT_COMMAND_LIST_GET_INFO;
312 %constant wxEventType wxEVT_COMMAND_LIST_SET_INFO;
317 EVT_LIST_BEGIN_DRAG = wx.PyEventBinder(wxEVT_COMMAND_LIST_BEGIN_DRAG , 1)
318 EVT_LIST_BEGIN_RDRAG = wx.PyEventBinder(wxEVT_COMMAND_LIST_BEGIN_RDRAG , 1)
319 EVT_LIST_BEGIN_LABEL_EDIT = wx.PyEventBinder(wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT , 1)
320 EVT_LIST_END_LABEL_EDIT = wx.PyEventBinder(wxEVT_COMMAND_LIST_END_LABEL_EDIT , 1)
321 EVT_LIST_DELETE_ITEM = wx.PyEventBinder(wxEVT_COMMAND_LIST_DELETE_ITEM , 1)
322 EVT_LIST_DELETE_ALL_ITEMS = wx.PyEventBinder(wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS , 1)
323 #WXWIN_COMPATIBILITY_2_4
324 #EVT_LIST_GET_INFO = wx.PyEventBinder(wxEVT_COMMAND_LIST_GET_INFO , 1)
325 #EVT_LIST_SET_INFO = wx.PyEventBinder(wxEVT_COMMAND_LIST_SET_INFO , 1)
326 #END WXWIN_COMPATIBILITY_2_4
327 EVT_LIST_ITEM_SELECTED = wx.PyEventBinder(wxEVT_COMMAND_LIST_ITEM_SELECTED , 1)
328 EVT_LIST_ITEM_DESELECTED = wx.PyEventBinder(wxEVT_COMMAND_LIST_ITEM_DESELECTED , 1)
329 EVT_LIST_KEY_DOWN = wx.PyEventBinder(wxEVT_COMMAND_LIST_KEY_DOWN , 1)
330 EVT_LIST_INSERT_ITEM = wx.PyEventBinder(wxEVT_COMMAND_LIST_INSERT_ITEM , 1)
331 EVT_LIST_COL_CLICK = wx.PyEventBinder(wxEVT_COMMAND_LIST_COL_CLICK , 1)
332 EVT_LIST_ITEM_RIGHT_CLICK = wx.PyEventBinder(wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK , 1)
333 EVT_LIST_ITEM_MIDDLE_CLICK = wx.PyEventBinder(wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK, 1)
334 EVT_LIST_ITEM_ACTIVATED = wx.PyEventBinder(wxEVT_COMMAND_LIST_ITEM_ACTIVATED , 1)
335 EVT_LIST_CACHE_HINT = wx.PyEventBinder(wxEVT_COMMAND_LIST_CACHE_HINT , 1)
336 EVT_LIST_COL_RIGHT_CLICK = wx.PyEventBinder(wxEVT_COMMAND_LIST_COL_RIGHT_CLICK , 1)
337 EVT_LIST_COL_BEGIN_DRAG = wx.PyEventBinder(wxEVT_COMMAND_LIST_COL_BEGIN_DRAG , 1)
338 EVT_LIST_COL_DRAGGING = wx.PyEventBinder(wxEVT_COMMAND_LIST_COL_DRAGGING , 1)
339 EVT_LIST_COL_END_DRAG = wx.PyEventBinder(wxEVT_COMMAND_LIST_COL_END_DRAG , 1)
340 EVT_LIST_ITEM_FOCUSED = wx.PyEventBinder(wxEVT_COMMAND_LIST_ITEM_FOCUSED , 1)
342 #WXWIN_COMPATIBILITY_2_4
343 #EVT_LIST_GET_INFO = wx._deprecated(EVT_LIST_GET_INFO)
344 #EVT_LIST_SET_INFO = wx._deprecated(EVT_LIST_SET_INFO)
347 //---------------------------------------------------------------------------
351 %{ // Python aware sorting function for wxPyListCtrl
352 static int wxCALLBACK wxPyListCtrl_SortItems(long item1, long item2, long funcPtr) {
354 PyObject* func = (PyObject*)funcPtr;
355 wxPyBlock_t blocked = wxPyBeginBlockThreads();
357 PyObject* args = Py_BuildValue("(ii)", item1, item2);
358 PyObject* result = PyEval_CallObject(func, args);
361 retval = PyInt_AsLong(result);
365 wxPyEndBlockThreads(blocked);
372 %{ // C++ Version of a Python aware class
373 class wxPyListCtrl : public wxListCtrl {
374 DECLARE_ABSTRACT_CLASS(wxPyListCtrl)
376 wxPyListCtrl() : wxListCtrl() {}
377 wxPyListCtrl(wxWindow* parent, wxWindowID id,
381 const wxValidator& validator,
382 const wxString& name) :
383 wxListCtrl(parent, id, pos, size, style, validator, name) {}
385 bool Create(wxWindow* parent, wxWindowID id,
389 const wxValidator& validator,
390 const wxString& name) {
391 return wxListCtrl::Create(parent, id, pos, size, style, validator, name);
394 DEC_PYCALLBACK_STRING_LONGLONG(OnGetItemText);
395 DEC_PYCALLBACK_LISTATTR_LONG(OnGetItemAttr);
397 // use the virtual version to avoid a confusing assert in the base class
398 DEC_PYCALLBACK_INT_LONG_virtual(OnGetItemImage);
399 DEC_PYCALLBACK_INT_LONGLONG(OnGetItemColumnImage);
404 IMPLEMENT_ABSTRACT_CLASS(wxPyListCtrl, wxListCtrl);
406 IMP_PYCALLBACK_STRING_LONGLONG(wxPyListCtrl, wxListCtrl, OnGetItemText);
407 IMP_PYCALLBACK_LISTATTR_LONG(wxPyListCtrl, wxListCtrl, OnGetItemAttr);
408 IMP_PYCALLBACK_INT_LONG_virtual(wxPyListCtrl, wxListCtrl, OnGetItemImage);
409 IMP_PYCALLBACK_INT_LONGLONG(wxPyListCtrl, wxListCtrl, OnGetItemColumnImage);
417 MustHaveApp(wxPyListCtrl);
419 %rename(ListCtrl) wxPyListCtrl;
420 class wxPyListCtrl : public wxControl {
423 %pythonAppend wxPyListCtrl "self._setOORInfo(self);self._setCallbackInfo(self, ListCtrl)"
424 %pythonAppend wxPyListCtrl() ""
426 wxPyListCtrl(wxWindow* parent, wxWindowID id = -1,
427 const wxPoint& pos = wxDefaultPosition,
428 const wxSize& size = wxDefaultSize,
429 long style = wxLC_ICON,
430 const wxValidator& validator = wxDefaultValidator,
431 const wxString& name = wxPyListCtrlNameStr);
432 %RenameCtor(PreListCtrl, wxPyListCtrl());
434 bool Create(wxWindow* parent, wxWindowID id = -1,
435 const wxPoint& pos = wxDefaultPosition,
436 const wxSize& size = wxDefaultSize,
437 long style = wxLC_ICON,
438 const wxValidator& validator = wxDefaultValidator,
439 const wxString& name = wxPyListCtrlNameStr);
441 void _setCallbackInfo(PyObject* self, PyObject* _class);
444 // Set the control colours
445 bool SetForegroundColour(const wxColour& col);
446 bool SetBackgroundColour(const wxColour& col);
448 // Gets information about this column
449 %pythonAppend GetColumn "if val is not None: val.thisown = 1"; // %newobject doesn't work with OOR typemap
451 wxListItem* GetColumn(int col) {
453 item.SetMask( wxLIST_MASK_STATE |
461 if (self->GetColumn(col, item))
462 return new wxListItem(item);
468 // Sets information about this column
469 bool SetColumn(int col, wxListItem& item) ;
471 // Gets the column width
472 int GetColumnWidth(int col) const;
474 // Sets the column width
475 bool SetColumnWidth(int col, int width) ;
477 // Gets the number of items that can fit vertically in the
478 // visible area of the list control (list or report view)
479 // or the total number of items in the list control (icon
480 // or small icon view)
481 int GetCountPerPage() const;
483 // return the total area occupied by all the items (icon/small icon only)
484 wxRect GetViewRect() const;
487 // Gets the edit control for editing labels.
488 wxTextCtrl* GetEditControl() const;
491 // Gets information about the item
492 %pythonAppend GetItem "if val is not None: val.thisown = 1"; // %newobject doesn't work with OOR typemap
494 wxListItem* GetItem(long itemId, int col=0) {
495 wxListItem* info = new wxListItem;
496 info->m_itemId = itemId;
498 info->m_mask = 0xFFFF;
499 self->GetItem(*info);
504 // Sets information about the item
505 bool SetItem(wxListItem& info) ;
507 // Sets a string field at a particular column
508 %Rename(SetStringItem, long, SetItem(long index, int col, const wxString& label, int imageId = -1));
510 // Gets the item state
511 int GetItemState(long item, long stateMask) const ;
513 // Sets the item state
514 bool SetItemState(long item, long state, long stateMask) ;
516 // Sets the item image
517 bool SetItemImage(long item, int image, int selImage=-1) ;
519 // Gets the item text
520 wxString GetItemText(long item) const ;
522 // Sets the item text
523 void SetItemText(long item, const wxString& str) ;
525 // Gets the item data
526 long GetItemData(long item) const ;
528 // Sets the item data
529 bool SetItemData(long item, long data) ;
532 //bool GetItemRect(long item, wxRect& rect, int code = wxLIST_RECT_BOUNDS) const ;
533 //bool GetItemPosition(long item, wxPoint& pos) const ;
535 // Gets the item position
537 wxPoint GetItemPosition(long item) {
539 self->GetItemPosition(item, pos);
542 // Gets the item rectangle
543 wxRect GetItemRect(long item, int code = wxLIST_RECT_BOUNDS) {
545 self->GetItemRect(item, rect, code);
551 // Sets the item position
552 bool SetItemPosition(long item, const wxPoint& pos) ;
554 // Gets the number of items in the list control
555 int GetItemCount() const;
557 // Gets the number of columns in the list control
558 int GetColumnCount() const;
560 // get the horizontal and vertical components of the item spacing
561 wxSize GetItemSpacing() const;
564 void SetItemSpacing( int spacing, bool isSmall = false );
567 // Gets the number of selected items in the list control
568 int GetSelectedItemCount() const;
570 // Gets the text colour of the listview
571 wxColour GetTextColour() const;
573 // Sets the text colour of the listview
574 void SetTextColour(const wxColour& col);
576 // Gets the index of the topmost visible item when in
577 // list or report view
578 long GetTopItem() const ;
580 // Add or remove a single window style
581 void SetSingleStyle(long style, bool add = true) ;
583 // Set the whole window style
584 void SetWindowStyleFlag(long style) ;
586 // Searches for an item, starting from 'item'.
587 // item can be -1 to find the first item that matches the
589 // Returns the item or -1 if unsuccessful.
590 long GetNextItem(long item, int geometry = wxLIST_NEXT_ALL, int state = wxLIST_STATE_DONTCARE) const ;
592 // Gets one of the three image lists
593 wxImageList *GetImageList(int which) const ;
595 // Sets the image list
596 void SetImageList(wxImageList *imageList, int which);
598 %disownarg( wxImageList *imageList );
599 void AssignImageList(wxImageList *imageList, int which);
600 %cleardisown( wxImageList *imageList );
602 // are we in report mode?
603 bool InReportView() const;
605 // returns True if it is a virtual list control
606 bool IsVirtual() const;
608 // refresh items selectively (only useful for virtual list controls)
609 void RefreshItem(long item);
610 void RefreshItems(long itemFrom, long itemTo);
612 // Arranges the items
613 bool Arrange(int flag = wxLIST_ALIGN_DEFAULT);
616 bool DeleteItem(long item);
619 bool DeleteAllItems() ;
622 bool DeleteColumn(int col);
624 // Deletes all columns
625 bool DeleteAllColumns();
627 // Clears items, and columns if there are any.
632 wxTextCtrl* EditLabel(long item /*, wxClassInfo* textControlClass = CLASSINFO(wxTextCtrl)*/);
634 // End label editing, optionally cancelling the edit
635 bool EndEditLabel(bool cancel);
637 void EditLabel(long item);
640 // Ensures this item is visible
641 bool EnsureVisible(long item) ;
643 // Find an item whose label matches this string, starting from the item after 'start'
644 // or the beginning if 'start' is -1.
645 long FindItem(long start, const wxString& str, bool partial = false);
647 // Find an item whose data matches this data, starting from the item after 'start'
648 // or the beginning if 'start' is -1.
649 %Rename(FindItemData, long, FindItem(long start, long data));
651 // Find an item nearest this position in the specified direction, starting from
652 // the item after 'start' or the beginning if 'start' is -1.
653 %Rename(FindItemAtPos, long, FindItem(long start, const wxPoint& pt, int direction));
657 long, HitTest(const wxPoint& point, int& OUTPUT),
658 "HitTest(Point point) -> (item, where)",
659 "Determines which item (if any) is at the specified point, giving
660 details in the second return value (see wx.LIST_HITTEST flags.)", "");
662 // Inserts an item, returning the index of the new item if successful,
664 long InsertItem(wxListItem& info);
666 // Insert a string item
667 %Rename(InsertStringItem,
668 long, InsertItem(long index, const wxString& label, int imageIndex=-1));
670 // Insert an image item
671 %Rename(InsertImageItem,
672 long, InsertItem(long index, int imageIndex));
674 // Insert an image/string item
675 %Rename(InsertImageStringItem,
676 long, InsertItem(long index, const wxString& label, int imageIndex));
678 // For list view mode (only), inserts a column.
679 %Rename(InsertColumnItem, long, InsertColumn(long col, wxListItem& info));
680 %pythoncode { InsertColumnInfo = InsertColumnItem }
682 long InsertColumn(long col,
683 const wxString& heading,
684 int format = wxLIST_FORMAT_LEFT,
687 // set the number of items in a virtual list control
688 void SetItemCount(long count);
690 // Scrolls the list control. If in icon, small icon or report view mode,
691 // x specifies the number of pixels to scroll. If in list view mode, x
692 // specifies the number of columns to scroll.
693 // If in icon, small icon or list view mode, y specifies the number of pixels
694 // to scroll. If in report view mode, y specifies the number of lines to scroll.
695 bool ScrollList(int dx, int dy);
697 void SetItemTextColour( long item, const wxColour& col);
698 wxColour GetItemTextColour( long item ) const;
699 void SetItemBackgroundColour( long item, const wxColour &col);
700 wxColour GetItemBackgroundColour( long item ) const;
703 void SetItemFont( long item, const wxFont &f);
704 wxFont GetItemFont( long item ) const;
709 def Select(self, idx, on=1):
710 '''[de]select an item'''
711 if on: state = wx.LIST_STATE_SELECTED
713 self.SetItemState(idx, state, wx.LIST_STATE_SELECTED)
715 def Focus(self, idx):
716 '''Focus and show the given item'''
717 self.SetItemState(idx, wx.LIST_STATE_FOCUSED, wx.LIST_STATE_FOCUSED)
718 self.EnsureVisible(idx)
720 def GetFocusedItem(self):
721 '''get the currently focused item or -1 if none'''
722 return self.GetNextItem(-1, wx.LIST_NEXT_ALL, wx.LIST_STATE_FOCUSED)
724 def GetFirstSelected(self, *args):
725 '''return first selected item, or -1 when none'''
726 return self.GetNextSelected(-1)
728 def GetNextSelected(self, item):
729 '''return subsequent selected items, or -1 when no more'''
730 return self.GetNextItem(item, wx.LIST_NEXT_ALL, wx.LIST_STATE_SELECTED)
732 def IsSelected(self, idx):
733 '''return True if the item is selected'''
734 return (self.GetItemState(idx, wx.LIST_STATE_SELECTED) & wx.LIST_STATE_SELECTED) != 0
736 def SetColumnImage(self, col, image):
737 item = self.GetColumn(col)
738 %# preserve all other attributes too
739 item.SetMask( wx.LIST_MASK_STATE |
745 wx.LIST_MASK_FORMAT )
747 self.SetColumn(col, item)
749 def ClearColumnImage(self, col):
750 self.SetColumnImage(col, -1)
752 def Append(self, entry):
753 '''Append an item to the list control. The entry parameter should be a
754 sequence with an item for each column'''
760 pos = self.GetItemCount()
761 self.InsertStringItem(pos, cvtfunc(entry[0]))
762 for i in range(1, len(entry)):
763 self.SetStringItem(pos, i, cvtfunc(entry[i]))
768 // bool SortItems(wxListCtrlCompare fn, long data);
771 // func is a function which takes 2 long arguments: item1, item2.
772 // item1 is the long data associated with a first item (NOT the index).
773 // item2 is the long data associated with a second item (NOT the index).
774 // The return value is a negative number if the first item should precede the second
775 // item, a positive number of the second item should precede the first,
776 // or zero if the two items are equivalent.
777 bool SortItems(PyObject* func) {
778 if (!PyCallable_Check(func))
780 return self->SortItems((wxListCtrlCompare)wxPyListCtrl_SortItems, (long)func);
786 wxWindow* GetMainWindow() {
790 return (wxWindow*)self->m_mainWin;
795 static wxVisualAttributes
796 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
801 //---------------------------------------------------------------------------
805 MustHaveApp(wxListView);
807 // wxListView: a class which provides a little better API for list control
808 class wxListView : public wxPyListCtrl
811 %pythonAppend wxListView "self._setOORInfo(self)"
812 %pythonAppend wxListView() ""
814 wxListView( wxWindow *parent,
816 const wxPoint& pos = wxDefaultPosition,
817 const wxSize& size = wxDefaultSize,
818 long style = wxLC_REPORT,
819 const wxValidator& validator = wxDefaultValidator,
820 const wxString& name = wxPyListCtrlNameStr);
821 %RenameCtor(PreListView, wxListView());
823 bool Create( wxWindow *parent,
825 const wxPoint& pos = wxDefaultPosition,
826 const wxSize& size = wxDefaultSize,
827 long style = wxLC_REPORT,
828 const wxValidator& validator = wxDefaultValidator,
829 const wxString& name = wxPyListCtrlNameStr);
831 // [de]select an item
832 void Select(long n, bool on = true);
834 // focus and show the given item
835 void Focus(long index);
837 // get the currently focused item or -1 if none
838 long GetFocusedItem() const;
840 // get first and subsequent selected items, return -1 when no more
841 long GetNextSelected(long item) const;
842 long GetFirstSelected() const;
844 // return True if the item is selected
845 bool IsSelected(long index);
847 void SetColumnImage(int col, int image);
848 void ClearColumnImage(int col);
853 //---------------------------------------------------------------------------
856 // Map renamed classes back to their common name for OOR
857 wxPyPtrTypeMap_Add("wxListCtrl", "wxPyListCtrl");
860 //---------------------------------------------------------------------------