1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: More control (widget) classes for wxPython
9 // Copyright: (c) 1998 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
20 #include <wx/listctrl.h>
21 #include <wx/treectrl.h>
22 #include <wx/imaglist.h>
23 #include <wx/dirctrl.h>
28 //----------------------------------------------------------------------
31 %include my_typemaps.i
33 // Import some definitions of other classes, etc.
41 %pragma(python) code = "import wx"
44 //----------------------------------------------------------------------
46 // Put some wx default wxChar* values into wxStrings.
47 const wxChar* wxListCtrlNameStr = _T("wxListCtrl");
48 DECLARE_DEF_STRING(ListCtrlNameStr);
50 const wxChar* wx_TreeCtrlNameStr = _T("wxTreeCtrl");
51 DECLARE_DEF_STRING(_TreeCtrlNameStr);
52 DECLARE_DEF_STRING(DirDialogDefaultFolderStr);
54 static const wxString wxPyEmptyString(wxT(""));
59 static const long longzero = 0;
62 //----------------------------------------------------------------------
65 /* List control event types */
66 wxEVT_COMMAND_LIST_BEGIN_DRAG,
67 wxEVT_COMMAND_LIST_BEGIN_RDRAG,
68 wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT,
69 wxEVT_COMMAND_LIST_END_LABEL_EDIT,
70 wxEVT_COMMAND_LIST_DELETE_ITEM,
71 wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS,
72 wxEVT_COMMAND_LIST_GET_INFO,
73 wxEVT_COMMAND_LIST_SET_INFO,
74 wxEVT_COMMAND_LIST_ITEM_SELECTED,
75 wxEVT_COMMAND_LIST_ITEM_DESELECTED,
76 wxEVT_COMMAND_LIST_KEY_DOWN,
77 wxEVT_COMMAND_LIST_INSERT_ITEM,
78 wxEVT_COMMAND_LIST_COL_CLICK,
79 wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK,
80 wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK,
81 wxEVT_COMMAND_LIST_ITEM_ACTIVATED,
82 wxEVT_COMMAND_LIST_CACHE_HINT,
83 wxEVT_COMMAND_LIST_COL_RIGHT_CLICK,
84 wxEVT_COMMAND_LIST_COL_BEGIN_DRAG,
85 wxEVT_COMMAND_LIST_COL_DRAGGING,
86 wxEVT_COMMAND_LIST_COL_END_DRAG,
87 wxEVT_COMMAND_LIST_ITEM_FOCUSED,
91 %pragma(python) code = "
92 def EVT_LIST_BEGIN_DRAG(win, id, func):
93 win.Connect(id, -1, wxEVT_COMMAND_LIST_BEGIN_DRAG, func)
95 def EVT_LIST_BEGIN_RDRAG(win, id, func):
96 win.Connect(id, -1, wxEVT_COMMAND_LIST_BEGIN_RDRAG, func)
98 def EVT_LIST_BEGIN_LABEL_EDIT(win, id, func):
99 win.Connect(id, -1, wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT, func)
101 def EVT_LIST_END_LABEL_EDIT(win, id, func):
102 win.Connect(id, -1, wxEVT_COMMAND_LIST_END_LABEL_EDIT, func)
104 def EVT_LIST_DELETE_ITEM(win, id, func):
105 win.Connect(id, -1, wxEVT_COMMAND_LIST_DELETE_ITEM, func)
107 def EVT_LIST_DELETE_ALL_ITEMS(win, id, func):
108 win.Connect(id, -1, wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS, func)
110 def EVT_LIST_GET_INFO(win, id, func):
111 win.Connect(id, -1, wxEVT_COMMAND_LIST_GET_INFO, func)
113 def EVT_LIST_SET_INFO(win, id, func):
114 win.Connect(id, -1, wxEVT_COMMAND_LIST_SET_INFO, func)
116 def EVT_LIST_ITEM_SELECTED(win, id, func):
117 win.Connect(id, -1, wxEVT_COMMAND_LIST_ITEM_SELECTED, func)
119 def EVT_LIST_ITEM_DESELECTED(win, id, func):
120 win.Connect(id, -1, wxEVT_COMMAND_LIST_ITEM_DESELECTED, func)
122 def EVT_LIST_KEY_DOWN(win, id, func):
123 win.Connect(id, -1, wxEVT_COMMAND_LIST_KEY_DOWN, func)
125 def EVT_LIST_INSERT_ITEM(win, id, func):
126 win.Connect(id, -1, wxEVT_COMMAND_LIST_INSERT_ITEM, func)
128 def EVT_LIST_COL_CLICK(win, id, func):
129 win.Connect(id, -1, wxEVT_COMMAND_LIST_COL_CLICK, func)
131 def EVT_LIST_COL_RIGHT_CLICK(win, id, func):
132 win.Connect(id, -1, wxEVT_COMMAND_LIST_COL_RIGHT_CLICK, func)
134 def EVT_LIST_COL_BEGIN_DRAG(win, id, func):
135 win.Connect(id, -1, wxEVT_COMMAND_LIST_COL_BEGIN_DRAG, func)
137 def EVT_LIST_COL_DRAGGING(win, id, func):
138 win.Connect(id, -1, wxEVT_COMMAND_LIST_COL_DRAGGING, func)
140 def EVT_LIST_COL_END_DRAG(win, id, func):
141 win.Connect(id, -1, wxEVT_COMMAND_LIST_COL_END_DRAG, func)
143 def EVT_LIST_ITEM_RIGHT_CLICK(win, id, func):
144 win.Connect(id, -1, wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, func)
146 def EVT_LIST_ITEM_MIDDLE_CLICK(win, id, func):
147 win.Connect(id, -1, wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK, func)
149 def EVT_LIST_ITEM_ACTIVATED(win, id, func):
150 win.Connect(id, -1, wxEVT_COMMAND_LIST_ITEM_ACTIVATED, func)
152 def EVT_LIST_CACHE_HINT(win, id, func):
153 win.Connect(id, -1, wxEVT_COMMAND_LIST_CACHE_HINT, func)
155 def EVT_LIST_ITEM_FOCUSED(win, id, func):
156 win.Connect(id, -1, wxEVT_COMMAND_LIST_ITEM_FOCUSED, func)
179 wxLC_SORT_DESCENDING,
200 wxLIST_STATE_DONTCARE,
201 wxLIST_STATE_DROPHILITED,
202 wxLIST_STATE_FOCUSED,
203 wxLIST_STATE_SELECTED,
207 wxLIST_HITTEST_ABOVE,
208 wxLIST_HITTEST_BELOW,
209 wxLIST_HITTEST_NOWHERE,
210 wxLIST_HITTEST_ONITEMICON,
211 wxLIST_HITTEST_ONITEMLABEL,
212 wxLIST_HITTEST_ONITEMRIGHT,
213 wxLIST_HITTEST_ONITEMSTATEICON,
214 wxLIST_HITTEST_TOLEFT,
215 wxLIST_HITTEST_TORIGHT,
216 wxLIST_HITTEST_ONITEM,
218 // Flags for GetNextItem
226 wxLIST_ALIGN_DEFAULT,
229 wxLIST_ALIGN_SNAP_TO_GRID,
231 // Autosize values for SetColumnWidth
232 wxLIST_AUTOSIZE = -1,
233 wxLIST_AUTOSIZE_USEHEADER = -2,
235 // Flag values for GetItemRect
240 // Flag values for FindItem (MSW only)
251 enum wxListColumnFormat
255 wxLIST_FORMAT_CENTRE,
256 wxLIST_FORMAT_CENTER = wxLIST_FORMAT_CENTRE
267 wxListItemAttr(const wxColour& colText = wxNullColour,
268 const wxColour& colBack = wxNullColour,
269 const wxFont& font = wxNullFont);
273 void SetTextColour(const wxColour& colText);
274 void SetBackgroundColour(const wxColour& colBack);
275 void SetFont(const wxFont& font);
278 bool HasTextColour();
279 bool HasBackgroundColour();
282 wxColour GetTextColour();
283 wxColour GetBackgroundColour();
288 class wxListItem : public wxObject {
295 void ClearAttributes();
298 void SetMask(long mask);
300 void SetColumn(int col);
301 void SetState(long state);
302 void SetStateMask(long stateMask);
303 void SetText(const wxString& text);
304 void SetImage(int image);
305 void SetData(long data);
307 void SetWidth(int width);
308 void SetAlign(wxListColumnFormat align);
310 void SetTextColour(const wxColour& colText);
311 void SetBackgroundColour(const wxColour& colBack);
312 void SetFont(const wxFont& font);
319 const wxString& GetText();
324 wxListColumnFormat GetAlign();
326 wxListItemAttr *GetAttributes();
327 bool HasAttributes();
329 wxColour GetTextColour() const;
330 wxColour GetBackgroundColour() const;
331 wxFont GetFont() const;
333 // these members are public for compatibility
334 long m_mask; // Indicates what fields are valid
335 long m_itemId; // The zero-based item position
336 int m_col; // Zero-based column, if in report mode
337 long m_state; // The state of the item
338 long m_stateMask;// Which flags of m_state are valid (uses same flags)
339 wxString m_text; // The label/header text
340 int m_image; // The zero-based index into an image list
341 long m_data; // App-defined data
344 int m_format; // left, right, centre
345 int m_width; // width of column
350 class wxListEvent: public wxNotifyEvent {
352 wxListEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
364 %pragma(python) addtoclass = "GetCode = GetKeyCode"
368 const wxString& GetLabel();
369 const wxString& GetText();
373 const wxListItem& GetItem();
378 // was label editing canceled? (for wxEVT_COMMAND_LIST_END_LABEL_EDIT only)
379 bool IsEditCancelled() const { return m_editCancelled; }
380 void SetEditCanceled(bool editCancelled) { m_editCancelled = editCancelled; }
384 %{ // C++ Version of a Python aware class
385 class wxPyListCtrl : public wxListCtrl {
386 DECLARE_ABSTRACT_CLASS(wxPyListCtrl);
388 wxPyListCtrl() : wxListCtrl() {}
389 wxPyListCtrl(wxWindow* parent, wxWindowID id,
393 const wxValidator& validator,
394 const wxString& name) :
395 wxListCtrl(parent, id, pos, size, style, validator, name) {}
397 bool Create(wxWindow* parent, wxWindowID id,
401 const wxValidator& validator,
402 const wxString& name) {
403 return wxListCtrl::Create(parent, id, pos, size, style, validator, name);
406 DEC_PYCALLBACK_STRING_LONGLONG(OnGetItemText);
407 DEC_PYCALLBACK_INT_LONG(OnGetItemImage);
408 DEC_PYCALLBACK_LISTATTR_LONG(OnGetItemAttr);
413 IMPLEMENT_ABSTRACT_CLASS(wxPyListCtrl, wxListCtrl);
415 IMP_PYCALLBACK_STRING_LONGLONG(wxPyListCtrl, wxListCtrl, OnGetItemText);
416 IMP_PYCALLBACK_INT_LONG(wxPyListCtrl, wxListCtrl, OnGetItemImage);
417 IMP_PYCALLBACK_LISTATTR_LONG(wxPyListCtrl, wxListCtrl, OnGetItemAttr);
422 %name(wxListCtrl)class wxPyListCtrl : public wxControl {
424 wxPyListCtrl(wxWindow* parent, wxWindowID id = -1,
425 const wxPoint& pos = wxDefaultPosition,
426 const wxSize& size = wxDefaultSize,
427 long style = wxLC_ICON,
428 const wxValidator& validator = wxDefaultValidator,
429 const wxString& name = wxPyListCtrlNameStr);
430 %name(wxPreListCtrl)wxPyListCtrl();
432 bool Create(wxWindow* parent, wxWindowID id = -1,
433 const wxPoint& pos = wxDefaultPosition,
434 const wxSize& size = wxDefaultSize,
435 long style = wxLC_ICON,
436 const wxValidator& validator = wxDefaultValidator,
437 const wxString& name = wxPyListCtrlNameStr);
439 void _setCallbackInfo(PyObject* self, PyObject* _class);
440 %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxListCtrl)"
442 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
443 %pragma(python) addtomethod = "wxPreListCtrl:val._setOORInfo(val)"
445 // Set the control colours
446 bool SetForegroundColour(const wxColour& col);
447 bool SetBackgroundColour(const wxColour& col);
449 // Gets information about this column
450 // bool GetColumn(int col, wxListItem& item) const;
452 %new wxListItem* GetColumn(int col) {
454 item.SetMask(0xFFFF);
455 if (self->GetColumn(col, item))
456 return new wxListItem(item);
460 } // The OOR typemaps don't know what to do with the %new, so fix it up.
461 %pragma(python) addtoclass = "
462 def GetColumn(self, *_args, **_kwargs):
463 val = controls2c.wxListCtrl_GetColumn(self, *_args, **_kwargs)
464 if val is not None: val.thisown = 1
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 //bool GetItem(wxListItem& info) const ;
493 // Gets information about the item
494 %new 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);
502 } // The OOR typemaps don't know what to do with the %new, so fix it up.
503 %pragma(python) addtoclass = "
504 def GetItem(self, *_args, **_kwargs):
505 val = controls2c.wxListCtrl_GetItem(self, *_args, **_kwargs)
506 if val is not None: val.thisown = 1
510 // Sets information about the item
511 bool SetItem(wxListItem& info) ;
513 // Sets a string field at a particular column
514 %name(SetStringItem)long SetItem(long index, int col, const wxString& label, int imageId = -1);
516 // Gets the item state
517 int GetItemState(long item, long stateMask) const ;
519 // Sets the item state
520 bool SetItemState(long item, long state, long stateMask) ;
522 // Sets the item image
523 bool SetItemImage(long item, int image, int selImage) ;
525 // Gets the item text
526 wxString GetItemText(long item) const ;
528 // Sets the item text
529 void SetItemText(long item, const wxString& str) ;
531 // Gets the item data
532 long GetItemData(long item) const ;
534 // Sets the item data
535 bool SetItemData(long item, long data) ;
538 //bool GetItemRect(long item, wxRect& rect, int code = wxLIST_RECT_BOUNDS) const ;
539 //bool GetItemPosition(long item, wxPoint& pos) const ;
541 // Gets the item position
543 %new wxPoint* GetItemPosition(long item) {
544 wxPoint* pos = new wxPoint;
545 self->GetItemPosition(item, *pos);
548 // Gets the item rectangle
549 %new wxRect* GetItemRect(long item, int code = wxLIST_RECT_BOUNDS) {
550 wxRect* rect= new wxRect;
551 self->GetItemRect(item, *rect, code);
557 // Sets the item position
558 bool SetItemPosition(long item, const wxPoint& pos) ;
560 // Gets the number of items in the list control
561 int GetItemCount() const;
563 // Gets the number of columns in the list control
564 int GetColumnCount() const;
566 // get the horizontal and vertical components of the item spacing
567 wxSize GetItemSpacing() const;
570 void SetItemSpacing( int spacing, bool isSmall = FALSE );
573 // Gets the number of selected items in the list control
574 int GetSelectedItemCount() const;
576 // Gets the text colour of the listview
577 wxColour GetTextColour() const;
579 // Sets the text colour of the listview
580 void SetTextColour(const wxColour& col);
582 // Gets the index of the topmost visible item when in
583 // list or report view
584 long GetTopItem() const ;
586 // Add or remove a single window style
587 void SetSingleStyle(long style, bool add = TRUE) ;
589 // Set the whole window style
590 void SetWindowStyleFlag(long style) ;
592 // Searches for an item, starting from 'item'.
593 // item can be -1 to find the first item that matches the
595 // Returns the item or -1 if unsuccessful.
596 long GetNextItem(long item, int geometry = wxLIST_NEXT_ALL, int state = wxLIST_STATE_DONTCARE) const ;
598 // Gets one of the three image lists
599 wxImageList *GetImageList(int which) const ;
601 // Sets the image list
602 void SetImageList(wxImageList *imageList, int which) ;
603 void AssignImageList(wxImageList *imageList, int which) ;
604 %pragma(python) addtomethod = "AssignImageList:_args[0].thisown = 0"
606 // returns true if it is a virtual list control
607 bool IsVirtual() const;
609 // refresh items selectively (only useful for virtual list controls)
610 void RefreshItem(long item);
611 void RefreshItems(long itemFrom, long itemTo);
613 // Arranges the items
614 bool Arrange(int flag = wxLIST_ALIGN_DEFAULT);
617 bool DeleteItem(long item);
620 bool DeleteAllItems() ;
623 bool DeleteColumn(int col);
625 // Deletes all columns
626 bool DeleteAllColumns();
628 // Clears items, and columns if there are any.
633 wxTextCtrl* EditLabel(long item /*, wxClassInfo* textControlClass = CLASSINFO(wxTextCtrl)*/);
635 // End label editing, optionally cancelling the edit
636 bool EndEditLabel(bool cancel);
638 void EditLabel(long item);
641 // Ensures this item is visible
642 bool EnsureVisible(long item) ;
644 // Find an item whose label matches this string, starting from the item after 'start'
645 // or the beginning if 'start' is -1.
646 long FindItem(long start, const wxString& str, bool partial = FALSE);
648 // Find an item whose data matches this data, starting from the item after 'start'
649 // or the beginning if 'start' is -1.
650 %name(FindItemData)long FindItem(long start, long data);
652 // Find an item nearest this position in the specified direction, starting from
653 // the item after 'start' or the beginning if 'start' is -1.
654 %name(FindItemAtPos)long FindItem(long start, const wxPoint& pt, int direction);
656 // Determines which item (if any) is at the specified point,
657 // giving details in the second return value (see wxLIST_HITTEST_... flags above)
658 long HitTest(const wxPoint& point, int& OUTPUT);
660 // Inserts an item, returning the index of the new item if successful,
662 long InsertItem(wxListItem& info);
664 // Insert a string item
665 %name(InsertStringItem)long InsertItem(long index, const wxString& label);
667 // Insert an image item
668 %name(InsertImageItem)long InsertItem(long index, int imageIndex);
670 // Insert an image/string item
671 %name(InsertImageStringItem)long InsertItem(long index, const wxString& label, int imageIndex);
673 // For list view mode (only), inserts a column.
674 %name(InsertColumnInfo)long InsertColumn(long col, wxListItem& info);
676 long InsertColumn(long col,
677 const wxString& heading,
678 int format = wxLIST_FORMAT_LEFT,
681 // set the number of items in a virtual list control
682 void SetItemCount(long count);
684 // Scrolls the list control. If in icon, small icon or report view mode,
685 // x specifies the number of pixels to scroll. If in list view mode, x
686 // specifies the number of columns to scroll.
687 // If in icon, small icon or list view mode, y specifies the number of pixels
688 // to scroll. If in report view mode, y specifies the number of lines to scroll.
689 bool ScrollList(int dx, int dy);
691 void SetItemTextColour( long item, const wxColour& col);
692 wxColour GetItemTextColour( long item ) const;
693 void SetItemBackgroundColour( long item, const wxColour &col);
694 wxColour GetItemBackgroundColour( long item ) const;
697 %pragma(python) addtoclass = "
700 def Select(self, idx, on=1):
701 '''[de]select an item'''
702 if on: state = wxLIST_STATE_SELECTED
704 self.SetItemState(idx, state, wxLIST_STATE_SELECTED)
706 def Focus(self, idx):
707 '''Focus and show the given item'''
708 self.SetItemState(idx, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED)
709 self.EnsureVisible(idx)
711 def GetFocusedItem(self):
712 '''get the currently focused item or -1 if none'''
713 return self.GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_FOCUSED)
715 def GetFirstSelected(self, *args):
716 '''return first selected item, or -1 when none'''
717 return self.GetNextSelected(-1)
719 def GetNextSelected(self, item):
720 '''return subsequent selected items, or -1 when no more'''
721 return self.GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED)
723 def IsSelected(self, idx):
724 '''return TRUE if the item is selected'''
725 return self.GetItemState(idx, wxLIST_STATE_SELECTED) != 0
727 def SetColumnImage(self, col, image):
729 item.SetMask(wxLIST_MASK_IMAGE)
731 self.SetColumn(col, item)
733 def ClearColumnImage(self, col):
734 self.SetColumnImage(col, -1)
736 def Append(self, entry):
737 '''Append an item to the list control. The entry parameter should be a
738 sequence with an item for each column'''
744 pos = self.GetItemCount()
745 self.InsertStringItem(pos, cvtfunc(entry[0]))
746 for i in range(1, len(entry)):
747 self.SetStringItem(pos, i, cvtfunc(entry[i]))
752 // bool SortItems(wxListCtrlCompare fn, long data);
755 // func is a function which takes 2 long arguments: item1, item2.
756 // item1 is the long data associated with a first item (NOT the index).
757 // item2 is the long data associated with a second item (NOT the index).
758 // The return value is a negative number if the first item should precede the second
759 // item, a positive number of the second item should precede the first,
760 // or zero if the two items are equivalent.
761 bool SortItems(PyObject* func) {
762 if (!PyCallable_Check(func))
764 return self->SortItems(wxPyListCtrl_SortItems, (long)func);
770 wxWindow* GetMainWindow() {
774 return (wxWindow*)self->m_mainWin;
782 %{ // Python aware sorting function for wxPyListCtrl
783 int wxCALLBACK wxPyListCtrl_SortItems(long item1, long item2, long funcPtr) {
785 PyObject* func = (PyObject*)funcPtr;
786 wxPyBeginBlockThreads();
788 PyObject* args = Py_BuildValue("(ii)", item1, item2);
789 PyObject* result = PyEval_CallObject(func, args);
792 retval = PyInt_AsLong(result);
796 wxPyEndBlockThreads();
802 //----------------------------------------------------------------------
804 class wxListView : public wxPyListCtrl
807 wxListView( wxWindow *parent,
809 const wxPoint& pos = wxDefaultPosition,
810 const wxSize& size = wxDefaultSize,
811 long style = wxLC_REPORT,
812 const wxValidator& validator = wxDefaultValidator,
813 const wxString& name = wxPyListCtrlNameStr);
814 %name(wxPreListView)wxListView();
816 bool Create( wxWindow *parent,
818 const wxPoint& pos = wxDefaultPosition,
819 const wxSize& size = wxDefaultSize,
820 long style = wxLC_REPORT,
821 const wxValidator& validator = wxDefaultValidator,
822 const wxString& name = wxPyListCtrlNameStr);
824 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
825 %pragma(python) addtomethod = "wxPreListView:val._setOORInfo(val)"
827 // [de]select an item
828 void Select(long n, bool on = TRUE);
830 // focus and show the given item
831 void Focus(long index);
833 // get the currently focused item or -1 if none
834 long GetFocusedItem() const;
836 // get first and subsequent selected items, return -1 when no more
837 long GetNextSelected(long item) const;
838 long GetFirstSelected() const;
840 // return TRUE if the item is selected
841 bool IsSelected(long index);
843 void SetColumnImage(int col, int image);
844 void ClearColumnImage(int col);
848 //--------------------------------------------------------------------------------
849 //--------------------------------------------------------------------------------
861 wxTR_HAS_VARIABLE_ROW_HEIGHT,
867 wxTR_FULL_ROW_HIGHLIGHT,
878 wxTreeItemIcon_Normal, // not selected, not expanded
879 wxTreeItemIcon_Selected, // selected, not expanded
880 wxTreeItemIcon_Expanded, // not selected, expanded
881 wxTreeItemIcon_SelectedExpanded, // selected, expanded
886 // constants for HitTest
888 wxTREE_HITTEST_ABOVE,
889 wxTREE_HITTEST_BELOW,
890 wxTREE_HITTEST_NOWHERE,
891 wxTREE_HITTEST_ONITEMBUTTON,
892 wxTREE_HITTEST_ONITEMICON,
893 wxTREE_HITTEST_ONITEMINDENT,
894 wxTREE_HITTEST_ONITEMLABEL,
895 wxTREE_HITTEST_ONITEMRIGHT,
896 wxTREE_HITTEST_ONITEMSTATEICON,
897 wxTREE_HITTEST_TOLEFT,
898 wxTREE_HITTEST_TORIGHT,
899 wxTREE_HITTEST_ONITEMUPPERPART,
900 wxTREE_HITTEST_ONITEMLOWERPART,
901 wxTREE_HITTEST_ONITEM
906 /* Tree control event types */
907 wxEVT_COMMAND_TREE_BEGIN_DRAG,
908 wxEVT_COMMAND_TREE_BEGIN_RDRAG,
909 wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT,
910 wxEVT_COMMAND_TREE_END_LABEL_EDIT,
911 wxEVT_COMMAND_TREE_DELETE_ITEM,
912 wxEVT_COMMAND_TREE_GET_INFO,
913 wxEVT_COMMAND_TREE_SET_INFO,
914 wxEVT_COMMAND_TREE_ITEM_EXPANDED,
915 wxEVT_COMMAND_TREE_ITEM_EXPANDING,
916 wxEVT_COMMAND_TREE_ITEM_COLLAPSED,
917 wxEVT_COMMAND_TREE_ITEM_COLLAPSING,
918 wxEVT_COMMAND_TREE_SEL_CHANGED,
919 wxEVT_COMMAND_TREE_SEL_CHANGING,
920 wxEVT_COMMAND_TREE_KEY_DOWN,
921 wxEVT_COMMAND_TREE_ITEM_ACTIVATED,
922 wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK,
923 wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK,
924 wxEVT_COMMAND_TREE_END_DRAG,
925 wxEVT_COMMAND_TREE_STATE_IMAGE_CLICK,
929 %pragma(python) code = "
931 def EVT_TREE_BEGIN_DRAG(win, id, func):
932 win.Connect(id, -1, wxEVT_COMMAND_TREE_BEGIN_DRAG, func)
934 def EVT_TREE_BEGIN_RDRAG(win, id, func):
935 win.Connect(id, -1, wxEVT_COMMAND_TREE_BEGIN_RDRAG, func)
937 def EVT_TREE_BEGIN_LABEL_EDIT(win, id, func):
938 win.Connect(id, -1, wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT, func)
940 def EVT_TREE_END_LABEL_EDIT(win, id, func):
941 win.Connect(id, -1, wxEVT_COMMAND_TREE_END_LABEL_EDIT, func)
943 def EVT_TREE_GET_INFO(win, id, func):
944 win.Connect(id, -1, wxEVT_COMMAND_TREE_GET_INFO, func)
946 def EVT_TREE_SET_INFO(win, id, func):
947 win.Connect(id, -1, wxEVT_COMMAND_TREE_SET_INFO, func)
949 def EVT_TREE_ITEM_EXPANDED(win, id, func):
950 win.Connect(id, -1, wxEVT_COMMAND_TREE_ITEM_EXPANDED, func)
952 def EVT_TREE_ITEM_EXPANDING(win, id, func):
953 win.Connect(id, -1, wxEVT_COMMAND_TREE_ITEM_EXPANDING, func)
955 def EVT_TREE_ITEM_COLLAPSED(win, id, func):
956 win.Connect(id, -1, wxEVT_COMMAND_TREE_ITEM_COLLAPSED, func)
958 def EVT_TREE_ITEM_COLLAPSING(win, id, func):
959 win.Connect(id, -1, wxEVT_COMMAND_TREE_ITEM_COLLAPSING, func)
961 def EVT_TREE_SEL_CHANGED(win, id, func):
962 win.Connect(id, -1, wxEVT_COMMAND_TREE_SEL_CHANGED, func)
964 def EVT_TREE_SEL_CHANGING(win, id, func):
965 win.Connect(id, -1, wxEVT_COMMAND_TREE_SEL_CHANGING, func)
967 def EVT_TREE_KEY_DOWN(win, id, func):
968 win.Connect(id, -1, wxEVT_COMMAND_TREE_KEY_DOWN, func)
970 def EVT_TREE_DELETE_ITEM(win, id, func):
971 win.Connect(id, -1, wxEVT_COMMAND_TREE_DELETE_ITEM, func)
973 def EVT_TREE_ITEM_ACTIVATED(win, id, func):
974 win.Connect(id, -1, wxEVT_COMMAND_TREE_ITEM_ACTIVATED, func)
976 def EVT_TREE_ITEM_RIGHT_CLICK(win, id, func):
977 win.Connect(id, -1, wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK, func)
979 def EVT_TREE_ITEM_MIDDLE_CLICK(win, id, func):
980 win.Connect(id, -1, wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK, func)
982 def EVT_TREE_END_DRAG(win, id, func):
983 win.Connect(id, -1, wxEVT_COMMAND_TREE_END_DRAG, func)
985 def EVT_TREE_STATE_IMAGE_CLICK(win, id, func):
986 win.Connect(id, -1, wxEVT_COMMAND_TREE_STATE_IMAGE_CLICK, func)
991 typedef void *wxTreeItemIdValue;
998 //wxTreeItemAttr() { }
999 wxTreeItemAttr(const wxColour& colText = wxNullColour,
1000 const wxColour& colBack = wxNullColour,
1001 const wxFont& font = wxNullFont);
1004 void SetTextColour(const wxColour& colText);
1005 void SetBackgroundColour(const wxColour& colBack);
1006 void SetFont(const wxFont& font);
1009 bool HasTextColour();
1010 bool HasBackgroundColour();
1013 wxColour GetTextColour();
1014 wxColour GetBackgroundColour();
1019 class wxTreeItemId {
1024 %pragma(python) addtoclass = "
1026 def __nonzero__(self):
1031 int __cmp__(wxTreeItemId* other) {
1032 if (! other) return -1;
1033 return *self != *other;
1041 %name(wxTreeItemData) class wxPyTreeItemData {
1043 wxPyTreeItemData(PyObject* obj = NULL);
1045 PyObject* GetData();
1046 void SetData(PyObject* obj);
1048 const wxTreeItemId& GetId();
1049 void SetId(const wxTreeItemId& id);
1054 class wxTreeEvent : public wxNotifyEvent {
1056 wxTreeEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
1058 // get the item on which the operation was performed or the newly
1059 // selected item for wxEVT_COMMAND_TREE_SEL_CHANGED/ING events
1060 wxTreeItemId GetItem() const;
1061 void SetItem(const wxTreeItemId& item);
1063 // for wxEVT_COMMAND_TREE_SEL_CHANGED/ING events, get the previously
1065 wxTreeItemId GetOldItem() const;
1066 void SetOldItem(const wxTreeItemId& item);
1068 // the point where the mouse was when the drag operation started (for
1069 // wxEVT_COMMAND_TREE_BEGIN_(R)DRAG events only) or click position
1070 wxPoint GetPoint() const;
1071 void SetPoint(const wxPoint& pt);
1073 // keyboard data (for wxEVT_COMMAND_TREE_KEY_DOWN only)
1074 const wxKeyEvent& GetKeyEvent() const;
1075 int GetKeyCode() const;
1076 void SetKeyEvent(const wxKeyEvent& evt);
1078 // label (for EVT_TREE_{BEGIN|END}_LABEL_EDIT only)
1079 const wxString& GetLabel() const;
1080 void SetLabel(const wxString& label);
1082 // edit cancel flag (for EVT_TREE_{BEGIN|END}_LABEL_EDIT only)
1083 bool IsEditCancelled() const;
1084 void SetEditCanceled(bool editCancelled);
1090 %{ // C++ version of Python aware wxTreeCtrl
1091 class wxPyTreeCtrl : public wxTreeCtrl {
1092 DECLARE_ABSTRACT_CLASS(wxPyTreeCtrl);
1094 wxPyTreeCtrl() : wxTreeCtrl() {}
1095 wxPyTreeCtrl(wxWindow *parent, wxWindowID id,
1099 const wxValidator& validator,
1100 const wxString& name) :
1101 wxTreeCtrl(parent, id, pos, size, style, validator, name) {}
1103 bool Create(wxWindow *parent, wxWindowID id,
1107 const wxValidator& validator,
1108 const wxString& name) {
1109 return wxTreeCtrl::Create(parent, id, pos, size, style, validator, name);
1113 int OnCompareItems(const wxTreeItemId& item1,
1114 const wxTreeItemId& item2) {
1117 wxPyBeginBlockThreads();
1118 if ((found = m_myInst.findCallback("OnCompareItems"))) {
1119 PyObject *o1 = wxPyConstructObject((void*)&item1, wxT("wxTreeItemId"));
1120 PyObject *o2 = wxPyConstructObject((void*)&item2, wxT("wxTreeItemId"));
1121 rval = m_myInst.callCallback(Py_BuildValue("(OO)",o1,o2));
1125 wxPyEndBlockThreads();
1127 rval = wxTreeCtrl::OnCompareItems(item1, item2);
1133 IMPLEMENT_ABSTRACT_CLASS(wxPyTreeCtrl, wxTreeCtrl);
1137 // These are for the GetFirstChild/GetNextChild methods below
1138 %typemap(python, in) long& INOUT = long* INOUT;
1139 %typemap(python, argout) long& INOUT = long* INOUT;
1142 %name(wxTreeCtrl)class wxPyTreeCtrl : public wxControl {
1144 wxPyTreeCtrl(wxWindow *parent, wxWindowID id = -1,
1145 const wxPoint& pos = wxDefaultPosition,
1146 const wxSize& size = wxDefaultSize,
1147 long style = wxTR_DEFAULT_STYLE,
1148 const wxValidator& validator = wxDefaultValidator,
1149 const wxString& name = wxPy_TreeCtrlNameStr);
1150 %name(wxPreTreeCtrl)wxPyTreeCtrl();
1152 bool Create(wxWindow *parent, wxWindowID id = -1,
1153 const wxPoint& pos = wxDefaultPosition,
1154 const wxSize& size = wxDefaultSize,
1155 long style = wxTR_DEFAULT_STYLE,
1156 const wxValidator& validator = wxDefaultValidator,
1157 const wxString& name = wxPy_TreeCtrlNameStr);
1159 void _setCallbackInfo(PyObject* self, PyObject* _class);
1160 %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxTreeCtrl)"
1162 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
1163 %pragma(python) addtomethod = "wxPreTreeCtrl:val._setOORInfo(val)"
1166 unsigned int GetIndent();
1167 void SetIndent(unsigned int indent);
1168 wxImageList *GetImageList();
1169 wxImageList *GetStateImageList();
1170 void SetImageList(wxImageList *imageList);
1171 void SetStateImageList(wxImageList *imageList);
1172 void AssignImageList(wxImageList* imageList);
1173 %pragma(python) addtomethod = "AssignImageList:_args[0].thisown = 0"
1174 void AssignStateImageList(wxImageList* imageList);
1175 %pragma(python) addtomethod = "AssignStateImageList:_args[0].thisown = 0"
1177 unsigned int GetSpacing();
1178 void SetSpacing(unsigned int spacing);
1180 wxString GetItemText(const wxTreeItemId& item);
1181 int GetItemImage(const wxTreeItemId& item,
1182 wxTreeItemIcon which = wxTreeItemIcon_Normal);
1183 int GetItemSelectedImage(const wxTreeItemId& item);
1185 void SetItemText(const wxTreeItemId& item, const wxString& text);
1186 void SetItemImage(const wxTreeItemId& item, int image,
1187 wxTreeItemIcon which = wxTreeItemIcon_Normal);
1188 void SetItemSelectedImage(const wxTreeItemId& item, int image);
1189 void SetItemHasChildren(const wxTreeItemId& item, bool hasChildren = TRUE);
1192 // [Get|Set]ItemData substitutes. Automatically create wxPyTreeItemData
1194 wxPyTreeItemData* GetItemData(const wxTreeItemId& item) {
1195 wxPyTreeItemData* data = (wxPyTreeItemData*)self->GetItemData(item);
1197 data = new wxPyTreeItemData();
1198 data->SetId(item); // set the id
1199 self->SetItemData(item, data);
1204 void SetItemData(const wxTreeItemId& item, wxPyTreeItemData* data) {
1205 data->SetId(item); // set the id
1206 self->SetItemData(item, data);
1209 // [Get|Set]PyData are short-cuts. Also made somewhat crash-proof by
1210 // automatically creating data classes.
1211 PyObject* GetPyData(const wxTreeItemId& item) {
1212 wxPyTreeItemData* data = (wxPyTreeItemData*)self->GetItemData(item);
1214 data = new wxPyTreeItemData();
1215 data->SetId(item); // set the id
1216 self->SetItemData(item, data);
1218 return data->GetData();
1221 void SetPyData(const wxTreeItemId& item, PyObject* obj) {
1222 wxPyTreeItemData* data = (wxPyTreeItemData*)self->GetItemData(item);
1224 data = new wxPyTreeItemData(obj);
1225 data->SetId(item); // set the id
1226 self->SetItemData(item, data);
1233 // get the item's text colour
1234 wxColour GetItemTextColour(const wxTreeItemId& item) const;
1236 // get the item's background colour
1237 wxColour GetItemBackgroundColour(const wxTreeItemId& item) const;
1239 // get the item's font
1240 wxFont GetItemFont(const wxTreeItemId& item) const;
1243 bool IsVisible(const wxTreeItemId& item);
1244 bool ItemHasChildren(const wxTreeItemId& item);
1245 bool IsExpanded(const wxTreeItemId& item);
1246 bool IsSelected(const wxTreeItemId& item);
1248 wxTreeItemId GetRootItem();
1249 wxTreeItemId GetSelection();
1250 wxTreeItemId GetItemParent(const wxTreeItemId& item);
1251 //size_t GetSelections(wxArrayTreeItemIds& selection);
1253 PyObject* GetSelections() {
1254 wxPyBeginBlockThreads();
1255 PyObject* rval = PyList_New(0);
1256 wxArrayTreeItemIds array;
1258 num = self->GetSelections(array);
1259 for (x=0; x < num; x++) {
1260 wxTreeItemId *tii = new wxTreeItemId(array.Item(x));
1261 PyObject* item = wxPyConstructObject((void*)tii, wxT("wxTreeItemId"), TRUE);
1262 PyList_Append(rval, item);
1264 wxPyEndBlockThreads();
1271 size_t GetChildrenCount(const wxTreeItemId& item, bool recursively = TRUE);
1273 wxTreeItemId GetFirstChild(const wxTreeItemId& item, long& INOUT = longzero);
1274 wxTreeItemId GetNextChild(const wxTreeItemId& item, long& INOUT);
1275 wxTreeItemId GetNextSibling(const wxTreeItemId& item);
1276 wxTreeItemId GetPrevSibling(const wxTreeItemId& item);
1277 wxTreeItemId GetFirstVisibleItem();
1278 wxTreeItemId GetNextVisible(const wxTreeItemId& item);
1279 wxTreeItemId GetPrevVisible(const wxTreeItemId& item);
1280 wxTreeItemId GetLastChild(const wxTreeItemId& item);
1284 wxTreeItemId AddRoot(const wxString& text,
1285 int image = -1, int selectedImage = -1,
1286 wxPyTreeItemData *data = NULL);
1287 wxTreeItemId PrependItem(const wxTreeItemId& parent,
1288 const wxString& text,
1289 int image = -1, int selectedImage = -1,
1290 wxPyTreeItemData *data = NULL);
1291 wxTreeItemId InsertItem(const wxTreeItemId& parent,
1292 const wxTreeItemId& idPrevious,
1293 const wxString& text,
1294 int image = -1, int selectedImage = -1,
1295 wxPyTreeItemData *data = NULL);
1296 %name(InsertItemBefore)
1297 wxTreeItemId InsertItem(const wxTreeItemId& parent,
1299 const wxString& text,
1300 int image = -1, int selectedImage = -1,
1301 wxPyTreeItemData *data = NULL);
1302 wxTreeItemId AppendItem(const wxTreeItemId& parent,
1303 const wxString& text,
1304 int image = -1, int selectedImage = -1,
1305 wxPyTreeItemData *data = NULL);
1307 void Delete(const wxTreeItemId& item);
1308 void DeleteChildren(const wxTreeItemId& item);
1309 void DeleteAllItems();
1311 void Expand(const wxTreeItemId& item);
1312 void Collapse(const wxTreeItemId& item);
1313 void CollapseAndReset(const wxTreeItemId& item);
1314 void Toggle(const wxTreeItemId& item);
1318 void SelectItem(const wxTreeItemId& item);
1319 void EnsureVisible(const wxTreeItemId& item);
1320 void ScrollTo(const wxTreeItemId& item);
1322 wxTextCtrl* GetEditControl();
1323 void EditLabel(const wxTreeItemId& item);
1325 void EndEditLabel(const wxTreeItemId& item, int discardChanges = FALSE);
1328 void SortChildren(const wxTreeItemId& item);
1330 void SetItemBold(const wxTreeItemId& item, int bold = TRUE);
1331 bool IsBold(const wxTreeItemId& item) const;
1332 wxTreeItemId HitTest(const wxPoint& point, int& OUTPUT);
1336 void SetItemTextColour(const wxTreeItemId& item, const wxColour& col);
1337 void SetItemBackgroundColour(const wxTreeItemId& item, const wxColour& col);
1338 void SetItemFont(const wxTreeItemId& item, const wxFont& font);
1341 void SetItemDropHighlight(const wxTreeItemId& item, int highlight = TRUE);
1344 //bool GetBoundingRect(const wxTreeItemId& item, wxRect& rect, int textOnly = FALSE)
1346 PyObject* GetBoundingRect(const wxTreeItemId& item, int textOnly = FALSE) {
1348 if (self->GetBoundingRect(item, rect, textOnly)) {
1349 wxPyBeginBlockThreads();
1350 wxRect* r = new wxRect(rect);
1351 PyObject* val = wxPyConstructObject((void*)r, wxT("wxRect"), 1);
1352 wxPyEndBlockThreads();
1363 %pragma(python) addtoclass = "
1364 # Redefine some methods that SWIG gets a bit confused on...
1365 def GetFirstChild(self, *_args, **_kwargs):
1366 val1,val2 = controls2c.wxTreeCtrl_GetFirstChild(self, *_args, **_kwargs)
1367 val1 = wxTreeItemIdPtr(val1)
1370 def GetNextChild(self, *_args, **_kwargs):
1371 val1,val2 = controls2c.wxTreeCtrl_GetNextChild(self, *_args, **_kwargs)
1372 val1 = wxTreeItemIdPtr(val1)
1375 def HitTest(self, *_args, **_kwargs):
1376 val1, val2 = controls2c.wxTreeCtrl_HitTest(self, *_args, **_kwargs)
1377 val1 = wxTreeItemIdPtr(val1)
1385 //----------------------------------------------------------------------
1390 wxDIRCTRL_SELECT_FIRST,
1391 wxDIRCTRL_SHOW_FILTERS,
1392 wxDIRCTRL_3D_INTERNAL,
1393 wxDIRCTRL_EDIT_LABELS,
1396 wxID_FILTERLISTCTRL,
1400 class wxDirItemData : public wxObject // wxTreeItemData
1403 wxDirItemData(const wxString& path, const wxString& name, bool isDir);
1404 // ~wxDirItemDataEx();
1405 void SetNewDirName( wxString path );
1406 wxString m_path, m_name;
1413 class wxGenericDirCtrl: public wxControl
1416 wxGenericDirCtrl(wxWindow *parent, const wxWindowID id = -1,
1417 const wxString& dir = wxPyDirDialogDefaultFolderStr,
1418 const wxPoint& pos = wxDefaultPosition,
1419 const wxSize& size = wxDefaultSize,
1420 long style = wxDIRCTRL_3D_INTERNAL|wxSUNKEN_BORDER,
1421 const wxString& filter = wxPyEmptyString,
1422 int defaultFilter = 0,
1423 const wxString& name = wxPy_TreeCtrlNameStr);
1424 %name(wxPreGenericDirCtrl)wxGenericDirCtrl();
1426 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
1427 %pragma(python) addtomethod = "wxPreGenericDirCtrl:val._setOORInfo(val)"
1429 bool Create(wxWindow *parent, const wxWindowID id = -1,
1430 const wxString& dir = wxPyDirDialogDefaultFolderStr,
1431 const wxPoint& pos = wxDefaultPosition,
1432 const wxSize& size = wxDefaultSize,
1433 long style = wxDIRCTRL_3D_INTERNAL|wxSUNKEN_BORDER,
1434 const wxString& filter = wxPyEmptyString,
1435 int defaultFilter = 0,
1436 const wxString& name = wxPy_TreeCtrlNameStr);
1439 // Try to expand as much of the given path as possible.
1440 bool ExpandPath(const wxString& path);
1444 inline wxString GetDefaultPath() const;
1445 void SetDefaultPath(const wxString& path);
1447 // Get dir or filename
1448 wxString GetPath() const ;
1450 // Get selected filename path only (else empty string).
1451 // I.e. don't count a directory as a selection
1452 wxString GetFilePath() const ;
1453 void SetPath(const wxString& path) ;
1455 void ShowHidden( bool show );
1456 bool GetShowHidden();
1458 wxString GetFilter() const;
1459 void SetFilter(const wxString& filter);
1461 int GetFilterIndex() const;
1462 void SetFilterIndex(int n) ;
1464 wxTreeItemId GetRootId();
1466 wxTreeCtrl* GetTreeCtrl() const;
1467 wxDirFilterListCtrl* GetFilterListCtrl() const;
1469 // Collapse & expand the tree, thus re-creating it from scratch:
1470 void ReCreateTree();
1473 // void SetupSections();
1474 // // Parse the filter into an array of filters and an array of descriptions
1475 // int ParseFilter(const wxString& filterStr, wxArrayString& filters, wxArrayString& descriptions);
1476 // // Find the child that matches the first part of 'path'.
1477 // // E.g. if a child path is "/usr" and 'path' is "/usr/include"
1478 // // then the child for /usr is returned.
1479 // // If the path string has been used (we're at the leaf), done is set to TRUE
1480 // wxTreeItemId FindChild(wxTreeItemId parentId, const wxString& path, bool& done);
1484 class wxDirFilterListCtrl: public wxChoice
1487 wxDirFilterListCtrl(wxGenericDirCtrl* parent, const wxWindowID id = -1,
1488 const wxPoint& pos = wxDefaultPosition,
1489 const wxSize& size = wxDefaultSize,
1491 %name(wxPreDirFilterListCtrl)wxDirFilterListCtrl();
1493 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
1494 %pragma(python) addtomethod = "wxPreDirFilterListCtrl:val._setOORInfo(val)"
1496 bool Create(wxGenericDirCtrl* parent, const wxWindowID id = -1,
1497 const wxPoint& pos = wxDefaultPosition,
1498 const wxSize& size = wxDefaultSize,
1502 void FillFilterList(const wxString& filter, int defaultFilter);
1506 class wxFileIconsTable
1510 ~wxFileIconsTable();
1525 int GetIconID(const wxString& extension, const wxString& mime = wxEmptyString);
1526 wxImageList *GetSmallImageList();
1530 //----------------------------------------------------------------------
1531 //----------------------------------------------------------------------
1534 // Map renamed classes back to their common name for OOR
1535 wxPyPtrTypeMap_Add("wxTreeItemData", "wxPyTreeItemData");
1536 wxPyPtrTypeMap_Add("wxTreeCtrl", "wxPyTreeCtrl");
1537 wxPyPtrTypeMap_Add("wxListCtrl", "wxPyListCtrl");
1540 //----------------------------------------------------------------------