]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/controls2.i
added wcslen prototype declaration for Darwin/FreeBSD, wcslen is in wxchar.cpp
[wxWidgets.git] / wxPython / src / controls2.i
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: controls2.i
3 // Purpose: More control (widget) classes for wxPython
4 //
5 // Author: Robin Dunn
6 //
7 // Created: 6/10/98
8 // RCS-ID: $Id$
9 // Copyright: (c) 1998 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
12
13 %module controls2
14
15 %{
16 #include "helpers.h"
17 #ifdef __WXMSW__
18 #include <windows.h>
19 #endif
20 #include <wx/listctrl.h>
21 #include <wx/treectrl.h>
22 #include <wx/imaglist.h>
23 %}
24
25 //----------------------------------------------------------------------
26
27 %include typemaps.i
28 %include my_typemaps.i
29
30 // Import some definitions of other classes, etc.
31 %import _defs.i
32 %import misc.i
33 %import windows.i
34 %import gdi.i
35 %import events.i
36 %import controls.i
37
38 %pragma(python) code = "import wx"
39
40
41 //----------------------------------------------------------------------
42 //----------------------------------------------------------------------
43
44 enum {
45 /* List control event types */
46 wxEVT_COMMAND_LIST_BEGIN_DRAG,
47 wxEVT_COMMAND_LIST_BEGIN_RDRAG,
48 wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT,
49 wxEVT_COMMAND_LIST_END_LABEL_EDIT,
50 wxEVT_COMMAND_LIST_DELETE_ITEM,
51 wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS,
52 wxEVT_COMMAND_LIST_GET_INFO,
53 wxEVT_COMMAND_LIST_SET_INFO,
54 wxEVT_COMMAND_LIST_ITEM_SELECTED,
55 wxEVT_COMMAND_LIST_ITEM_DESELECTED,
56 wxEVT_COMMAND_LIST_KEY_DOWN,
57 wxEVT_COMMAND_LIST_INSERT_ITEM,
58 wxEVT_COMMAND_LIST_COL_CLICK,
59 wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK,
60 wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK,
61 wxEVT_COMMAND_LIST_ITEM_ACTIVATED,
62 wxEVT_COMMAND_LIST_CACHE_HINT,
63 wxEVT_COMMAND_LIST_COL_RIGHT_CLICK,
64 wxEVT_COMMAND_LIST_COL_BEGIN_DRAG,
65 wxEVT_COMMAND_LIST_COL_DRAGGING,
66 wxEVT_COMMAND_LIST_COL_END_DRAG,
67
68 };
69
70
71 %pragma(python) code = "
72 def EVT_LIST_BEGIN_DRAG(win, id, func):
73 win.Connect(id, -1, wxEVT_COMMAND_LIST_BEGIN_DRAG, func)
74
75 def EVT_LIST_BEGIN_RDRAG(win, id, func):
76 win.Connect(id, -1, wxEVT_COMMAND_LIST_BEGIN_RDRAG, func)
77
78 def EVT_LIST_BEGIN_LABEL_EDIT(win, id, func):
79 win.Connect(id, -1, wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT, func)
80
81 def EVT_LIST_END_LABEL_EDIT(win, id, func):
82 win.Connect(id, -1, wxEVT_COMMAND_LIST_END_LABEL_EDIT, func)
83
84 def EVT_LIST_DELETE_ITEM(win, id, func):
85 win.Connect(id, -1, wxEVT_COMMAND_LIST_DELETE_ITEM, func)
86
87 def EVT_LIST_DELETE_ALL_ITEMS(win, id, func):
88 win.Connect(id, -1, wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS, func)
89
90 def EVT_LIST_GET_INFO(win, id, func):
91 win.Connect(id, -1, wxEVT_COMMAND_LIST_GET_INFO, func)
92
93 def EVT_LIST_SET_INFO(win, id, func):
94 win.Connect(id, -1, wxEVT_COMMAND_LIST_SET_INFO, func)
95
96 def EVT_LIST_ITEM_SELECTED(win, id, func):
97 win.Connect(id, -1, wxEVT_COMMAND_LIST_ITEM_SELECTED, func)
98
99 def EVT_LIST_ITEM_DESELECTED(win, id, func):
100 win.Connect(id, -1, wxEVT_COMMAND_LIST_ITEM_DESELECTED, func)
101
102 def EVT_LIST_KEY_DOWN(win, id, func):
103 win.Connect(id, -1, wxEVT_COMMAND_LIST_KEY_DOWN, func)
104
105 def EVT_LIST_INSERT_ITEM(win, id, func):
106 win.Connect(id, -1, wxEVT_COMMAND_LIST_INSERT_ITEM, func)
107
108 def EVT_LIST_COL_CLICK(win, id, func):
109 win.Connect(id, -1, wxEVT_COMMAND_LIST_COL_CLICK, func)
110
111 def EVT_LIST_COL_RIGHT_CLICK(win, id, func):
112 win.Connect(id, -1, wxEVT_COMMAND_LIST_COL_RIGHT_CLICK, func)
113
114 def EVT_LIST_COL_BEGIN_DRAG(win, id, func):
115 win.Connect(id, -1, wxEVT_COMMAND_LIST_COL_BEGIN_DRAG, func)
116
117 def EVT_LIST_COL_DRAGGING(win, id, func):
118 win.Connect(id, -1, wxEVT_COMMAND_LIST_COL_DRAGGING, func)
119
120 def EVT_LIST_COL_END_DRAG(win, id, func):
121 win.Connect(id, -1, wxEVT_COMMAND_LIST_COL_END_DRAG, func)
122
123 def EVT_LIST_ITEM_RIGHT_CLICK(win, id, func):
124 win.Connect(id, -1, wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, func)
125
126 def EVT_LIST_ITEM_MIDDLE_CLICK(win, id, func):
127 win.Connect(id, -1, wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK, func)
128
129 def EVT_LIST_ITEM_ACTIVATED(win, id, func):
130 win.Connect(id, -1, wxEVT_COMMAND_LIST_ITEM_ACTIVATED, func)
131
132 def EVT_LIST_CACHE_HINT(win, id, func):
133 win.Connect(id, -1, wxEVT_COMMAND_LIST_CACHE_HINT, func)
134 "
135
136
137 enum {
138 /* Style flags */
139 wxLC_VRULES,
140 wxLC_HRULES,
141
142 wxLC_ICON,
143 wxLC_SMALL_ICON,
144 wxLC_LIST,
145 wxLC_REPORT,
146
147 wxLC_ALIGN_TOP,
148 wxLC_ALIGN_LEFT,
149 wxLC_AUTOARRANGE,
150 wxLC_VIRTUAL,
151 wxLC_EDIT_LABELS,
152 wxLC_NO_HEADER,
153 wxLC_NO_SORT_HEADER,
154 wxLC_SINGLE_SEL,
155 wxLC_SORT_ASCENDING,
156 wxLC_SORT_DESCENDING,
157
158 wxLC_MASK_TYPE,
159 wxLC_MASK_ALIGN,
160 wxLC_MASK_SORT,
161
162 wxLC_USER_TEXT,
163 };
164
165
166 enum {
167 // Mask flags
168 wxLIST_MASK_STATE,
169 wxLIST_MASK_TEXT,
170 wxLIST_MASK_IMAGE,
171 wxLIST_MASK_DATA,
172 wxLIST_SET_ITEM,
173 wxLIST_MASK_WIDTH,
174 wxLIST_MASK_FORMAT,
175
176 // State flags
177 wxLIST_STATE_DONTCARE,
178 wxLIST_STATE_DROPHILITED,
179 wxLIST_STATE_FOCUSED,
180 wxLIST_STATE_SELECTED,
181 wxLIST_STATE_CUT,
182
183 // Hit test flags
184 wxLIST_HITTEST_ABOVE,
185 wxLIST_HITTEST_BELOW,
186 wxLIST_HITTEST_NOWHERE,
187 wxLIST_HITTEST_ONITEMICON,
188 wxLIST_HITTEST_ONITEMLABEL,
189 wxLIST_HITTEST_ONITEMRIGHT,
190 wxLIST_HITTEST_ONITEMSTATEICON,
191 wxLIST_HITTEST_TOLEFT,
192 wxLIST_HITTEST_TORIGHT,
193 wxLIST_HITTEST_ONITEM,
194
195 // Flags for GetNextItem
196 wxLIST_NEXT_ABOVE,
197 wxLIST_NEXT_ALL,
198 wxLIST_NEXT_BELOW,
199 wxLIST_NEXT_LEFT,
200 wxLIST_NEXT_RIGHT,
201
202 // Alignment flags
203 wxLIST_ALIGN_DEFAULT,
204 wxLIST_ALIGN_LEFT,
205 wxLIST_ALIGN_TOP,
206 wxLIST_ALIGN_SNAP_TO_GRID,
207
208 // Autosize values for SetColumnWidth
209 wxLIST_AUTOSIZE = -1,
210 wxLIST_AUTOSIZE_USEHEADER = -2,
211
212 // Flag values for GetItemRect
213 wxLIST_RECT_BOUNDS,
214 wxLIST_RECT_ICON,
215 wxLIST_RECT_LABEL,
216
217 // Flag values for FindItem (MSW only)
218 wxLIST_FIND_UP,
219 wxLIST_FIND_DOWN,
220 wxLIST_FIND_LEFT,
221 wxLIST_FIND_RIGHT,
222
223
224 };
225
226
227
228 enum wxListColumnFormat
229 {
230 wxLIST_FORMAT_LEFT,
231 wxLIST_FORMAT_RIGHT,
232 wxLIST_FORMAT_CENTRE,
233 wxLIST_FORMAT_CENTER = wxLIST_FORMAT_CENTRE
234 };
235
236
237
238
239 class wxListItemAttr
240 {
241 public:
242 // ctors
243 //wxListItemAttr();
244 wxListItemAttr(const wxColour& colText = wxNullColour,
245 const wxColour& colBack = wxNullColour,
246 const wxFont& font = wxNullFont);
247
248
249 // setters
250 void SetTextColour(const wxColour& colText);
251 void SetBackgroundColour(const wxColour& colBack);
252 void SetFont(const wxFont& font);
253
254 // accessors
255 bool HasTextColour();
256 bool HasBackgroundColour();
257 bool HasFont();
258
259 const wxColour& GetTextColour();
260 const wxColour& GetBackgroundColour();
261 const wxFont& GetFont();
262 };
263
264
265 class wxListItem : public wxObject {
266 public:
267 wxListItem();
268 ~wxListItem();
269
270 // resetting
271 void Clear();
272 void ClearAttributes();
273
274 // setters
275 void SetMask(long mask);
276 void SetId(long id);
277 void SetColumn(int col);
278 void SetState(long state);
279 void SetStateMask(long stateMask);
280 void SetText(const wxString& text);
281 void SetImage(int image);
282 void SetData(long data);
283
284 void SetWidth(int width);
285 void SetAlign(wxListColumnFormat align);
286
287 void SetTextColour(const wxColour& colText);
288 void SetBackgroundColour(const wxColour& colBack);
289 void SetFont(const wxFont& font);
290
291 // accessors
292 long GetMask();
293 long GetId();
294 int GetColumn();
295 long GetState();
296 const wxString& GetText();
297 int GetImage();
298 long GetData();
299
300 int GetWidth();
301 wxListColumnFormat GetAlign();
302
303 wxListItemAttr *GetAttributes();
304 bool HasAttributes();
305
306 wxColour GetTextColour() const;
307 wxColour GetBackgroundColour() const;
308 wxFont GetFont() const;
309
310 // these members are public for compatibility
311 long m_mask; // Indicates what fields are valid
312 long m_itemId; // The zero-based item position
313 int m_col; // Zero-based column, if in report mode
314 long m_state; // The state of the item
315 long m_stateMask;// Which flags of m_state are valid (uses same flags)
316 wxString m_text; // The label/header text
317 int m_image; // The zero-based index into an image list
318 long m_data; // App-defined data
319
320 // For columns only
321 int m_format; // left, right, centre
322 int m_width; // width of column
323
324 };
325
326
327 class wxListEvent: public wxNotifyEvent {
328 public:
329 wxListEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
330
331 int m_code;
332 long m_itemIndex;
333 int m_col;
334 bool m_cancelled;
335 wxPoint m_pointDrag;
336 wxListItem m_item;
337
338 int GetCode();
339 long GetIndex();
340 int GetColumn();
341 bool Cancelled();
342 wxPoint GetPoint();
343 const wxString& GetLabel();
344 const wxString& GetText();
345 int GetImage();
346 long GetData();
347 long GetMask();
348 const wxListItem& GetItem();
349
350 long GetCacheFrom();
351 long GetCacheTo();
352 };
353
354
355 %{ // C++ Version of a Python aware class
356 class wxPyListCtrl : public wxListCtrl {
357 DECLARE_ABSTRACT_CLASS(wxPyListCtrl);
358 public:
359 wxPyListCtrl() : wxListCtrl() {}
360 wxPyListCtrl(wxWindow* parent, wxWindowID id,
361 const wxPoint& pos,
362 const wxSize& size,
363 long style,
364 const wxValidator& validator,
365 char* name) :
366 wxListCtrl(parent, id, pos, size, style, validator, name) {}
367
368 bool Create(wxWindow* parent, wxWindowID id,
369 const wxPoint& pos,
370 const wxSize& size,
371 long style,
372 const wxValidator& validator,
373 char* name) {
374 return wxListCtrl::Create(parent, id, pos, size, style, validator, name);
375 }
376
377 DEC_PYCALLBACK_STRING_LONGLONG(OnGetItemText);
378 DEC_PYCALLBACK_INT_LONG(OnGetItemImage);
379 DEC_PYCALLBACK_LISTATTR_LONG(OnGetItemAttr);
380
381 PYPRIVATE;
382 };
383
384 IMPLEMENT_ABSTRACT_CLASS(wxPyListCtrl, wxListCtrl);
385
386 IMP_PYCALLBACK_STRING_LONGLONG(wxPyListCtrl, wxListCtrl, OnGetItemText);
387 IMP_PYCALLBACK_INT_LONG(wxPyListCtrl, wxListCtrl, OnGetItemImage);
388 IMP_PYCALLBACK_LISTATTR_LONG(wxPyListCtrl, wxListCtrl, OnGetItemAttr);
389 %}
390
391
392
393 %name(wxListCtrl)class wxPyListCtrl : public wxControl {
394 public:
395 wxPyListCtrl(wxWindow* parent, wxWindowID id = -1,
396 const wxPoint& pos = wxDefaultPosition,
397 const wxSize& size = wxDefaultSize,
398 long style = wxLC_ICON,
399 const wxValidator& validator = wxDefaultValidator,
400 char* name = "listCtrl");
401 %name(wxPreListCtrl)wxPyListCtrl();
402
403 bool Create(wxWindow* parent, wxWindowID id = -1,
404 const wxPoint& pos = wxDefaultPosition,
405 const wxSize& size = wxDefaultSize,
406 long style = wxLC_ICON,
407 const wxValidator& validator = wxDefaultValidator,
408 char* name = "listCtrl");
409
410 void _setCallbackInfo(PyObject* self, PyObject* _class);
411 %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxListCtrl)"
412
413 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
414 %pragma(python) addtomethod = "wxPreListCtrl:val._setOORInfo(val)"
415
416 // Set the control colours
417 bool SetForegroundColour(const wxColour& col);
418 bool SetBackgroundColour(const wxColour& col);
419
420 // Gets information about this column
421 bool GetColumn(int col, wxListItem& item) const;
422
423 // Sets information about this column
424 bool SetColumn(int col, wxListItem& item) ;
425
426 // Gets the column width
427 int GetColumnWidth(int col) const;
428
429 // Sets the column width
430 bool SetColumnWidth(int col, int width) ;
431
432 // Gets the number of items that can fit vertically in the
433 // visible area of the list control (list or report view)
434 // or the total number of items in the list control (icon
435 // or small icon view)
436 int GetCountPerPage() const;
437
438 #ifdef __WXMSW__
439 // Gets the edit control for editing labels.
440 wxTextCtrl* GetEditControl() const;
441 #endif
442
443 //bool GetItem(wxListItem& info) const ;
444 %addmethods {
445 // Gets information about the item
446 %new wxListItem* GetItem(long itemId, int col=0) {
447 wxListItem* info = new wxListItem;
448 info->m_itemId = itemId;
449 info->m_col = col;
450 info->m_mask = 0xFFFF;
451 self->GetItem(*info);
452 return info;
453 }
454 } // The OOR typemaps don't know what to do with the %new, so fix it up.
455 %pragma(python) addtoclass = "
456 def GetItem(self, *_args, **_kwargs):
457 val = apply(controls2c.wxListCtrl_GetItem,(self,) + _args, _kwargs)
458 val.thisown = 1
459 return val
460 "
461
462
463 // Sets information about the item
464 bool SetItem(wxListItem& info) ;
465
466 // Sets a string field at a particular column
467 %name(SetStringItem)long SetItem(long index, int col, const wxString& label, int imageId = -1);
468
469 // Gets the item state
470 int GetItemState(long item, long stateMask) const ;
471
472 // Sets the item state
473 bool SetItemState(long item, long state, long stateMask) ;
474
475 // Sets the item image
476 bool SetItemImage(long item, int image, int selImage) ;
477
478 // Gets the item text
479 wxString GetItemText(long item) const ;
480
481 // Sets the item text
482 void SetItemText(long item, const wxString& str) ;
483
484 // Gets the item data
485 long GetItemData(long item) const ;
486
487 // Sets the item data
488 bool SetItemData(long item, long data) ;
489
490
491 //bool GetItemRect(long item, wxRect& rect, int code = wxLIST_RECT_BOUNDS) const ;
492 //bool GetItemPosition(long item, wxPoint& pos) const ;
493
494 // Gets the item position
495 %addmethods {
496 %new wxPoint* GetItemPosition(long item) {
497 wxPoint* pos = new wxPoint;
498 self->GetItemPosition(item, *pos);
499 return pos;
500 }
501 // Gets the item rectangle
502 %new wxRect* GetItemRect(long item, int code = wxLIST_RECT_BOUNDS) {
503 wxRect* rect= new wxRect;
504 self->GetItemRect(item, *rect, code);
505 return rect;
506 }
507 }
508
509
510 // Sets the item position
511 bool SetItemPosition(long item, const wxPoint& pos) ;
512
513 // Gets the number of items in the list control
514 int GetItemCount() const;
515
516 // Gets the number of columns in the list control
517 int GetColumnCount() const;
518
519 // Retrieves the spacing between icons in pixels.
520 // If small is TRUE, gets the spacing for the small icon
521 // view, otherwise the large icon view.
522 int GetItemSpacing(bool isSmall) const;
523
524 // Gets the number of selected items in the list control
525 int GetSelectedItemCount() const;
526
527 // Gets the text colour of the listview
528 wxColour GetTextColour() const;
529
530 // Sets the text colour of the listview
531 void SetTextColour(const wxColour& col);
532
533 // Gets the index of the topmost visible item when in
534 // list or report view
535 long GetTopItem() const ;
536
537 // Add or remove a single window style
538 void SetSingleStyle(long style, bool add = TRUE) ;
539
540 // Set the whole window style
541 void SetWindowStyleFlag(long style) ;
542
543 // Searches for an item, starting from 'item'.
544 // item can be -1 to find the first item that matches the
545 // specified flags.
546 // Returns the item or -1 if unsuccessful.
547 long GetNextItem(long item, int geometry = wxLIST_NEXT_ALL, int state = wxLIST_STATE_DONTCARE) const ;
548
549 // Gets one of the three image lists
550 wxImageList *GetImageList(int which) const ;
551
552 // Sets the image list
553 void SetImageList(wxImageList *imageList, int which) ;
554 void AssignImageList(wxImageList *imageList, int which) ;
555 %pragma(python) addtomethod = "AssignImageList:_args[0].thisown = 0"
556
557 // returns true if it is a virtual list control
558 bool IsVirtual() const;
559
560 // refresh items selectively (only useful for virtual list controls)
561 void RefreshItem(long item);
562 void RefreshItems(long itemFrom, long itemTo);
563
564 // Arranges the items
565 bool Arrange(int flag = wxLIST_ALIGN_DEFAULT);
566
567 // Deletes an item
568 bool DeleteItem(long item);
569
570 // Deletes all items
571 bool DeleteAllItems() ;
572
573 // Deletes a column
574 bool DeleteColumn(int col);
575
576 // Deletes all columns
577 bool DeleteAllColumns();
578
579 // Clears items, and columns if there are any.
580 void ClearAll();
581
582 #ifdef __WXMSW__
583 // Edit the label
584 wxTextCtrl* EditLabel(long item /*, wxClassInfo* textControlClass = CLASSINFO(wxTextCtrl)*/);
585
586 // End label editing, optionally cancelling the edit
587 bool EndEditLabel(bool cancel);
588 #endif
589
590 // Ensures this item is visible
591 bool EnsureVisible(long item) ;
592
593 // Find an item whose label matches this string, starting from the item after 'start'
594 // or the beginning if 'start' is -1.
595 long FindItem(long start, const wxString& str, bool partial = FALSE);
596
597 // Find an item whose data matches this data, starting from the item after 'start'
598 // or the beginning if 'start' is -1.
599 %name(FindItemData)long FindItem(long start, long data);
600
601 // Find an item nearest this position in the specified direction, starting from
602 // the item after 'start' or the beginning if 'start' is -1.
603 %name(FindItemAtPos)long FindItem(long start, const wxPoint& pt, int direction);
604
605 // Determines which item (if any) is at the specified point,
606 // giving details in the second return value (see wxLIST_HITTEST_... flags above)
607 long HitTest(const wxPoint& point, int& OUTPUT);
608
609 // Inserts an item, returning the index of the new item if successful,
610 // -1 otherwise.
611 long InsertItem(wxListItem& info);
612
613 // Insert a string item
614 %name(InsertStringItem)long InsertItem(long index, const wxString& label);
615
616 // Insert an image item
617 %name(InsertImageItem)long InsertItem(long index, int imageIndex);
618
619 // Insert an image/string item
620 %name(InsertImageStringItem)long InsertItem(long index, const wxString& label, int imageIndex);
621
622 // For list view mode (only), inserts a column.
623 %name(InsertColumnInfo)long InsertColumn(long col, wxListItem& info);
624
625 long InsertColumn(long col,
626 const wxString& heading,
627 int format = wxLIST_FORMAT_LEFT,
628 int width = -1);
629
630 // set the number of items in a virtual list control
631 void SetItemCount(long count);
632
633 // Scrolls the list control. If in icon, small icon or report view mode,
634 // x specifies the number of pixels to scroll. If in list view mode, x
635 // specifies the number of columns to scroll.
636 // If in icon, small icon or list view mode, y specifies the number of pixels
637 // to scroll. If in report view mode, y specifies the number of lines to scroll.
638 bool ScrollList(int dx, int dy);
639
640 // bool SortItems(wxListCtrlCompare fn, long data);
641 %addmethods {
642 // Sort items.
643 // func is a function which takes 2 long arguments: item1, item2.
644 // item1 is the long data associated with a first item (NOT the index).
645 // item2 is the long data associated with a second item (NOT the index).
646 // The return value is a negative number if the first item should precede the second
647 // item, a positive number of the second item should precede the first,
648 // or zero if the two items are equivalent.
649 bool SortItems(PyObject* func) {
650 if (!PyCallable_Check(func))
651 return FALSE;
652 return self->SortItems(wxPyListCtrl_SortItems, (long)func);
653 }
654 }
655
656 %pragma(python) addtoclass = "
657 # Some helpers...
658
659 def Select(self, idx, on=1):
660 '''[de]select an item'''
661 if on: state = wxLIST_STATE_SELECTED
662 else: state = 0
663 self.SetItemState(idx, state, wxLIST_STATE_SELECTED)
664
665 def Focus(self, idx):
666 '''Focus and show the given item'''
667 self.SetItemState(idx, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED)
668 self.EnsureVisible(idx)
669
670 def GetFocusedItem(self):
671 '''get the currently focused item or -1 if none'''
672 return self.GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_FOCUSED)
673
674 def IsSelected(self, idx):
675 '''return TRUE if the item is selected'''
676 return self.GetItemState(idx, wxLIST_STATE_SELECTED) != 0
677
678 def SetColumnImage(self, col, image):
679 item = wxListItem()
680 item.SetMask(wxLIST_MASK_IMAGE)
681 item.SetImage(image)
682 self.SetColumn(col, item)
683
684 def ClearColumnImage(self, col):
685 self.SetColumnImage(col, -1)
686 "
687 };
688
689
690
691 %{ // Python aware sorting function for wxPyListCtrl
692 int wxCALLBACK wxPyListCtrl_SortItems(long item1, long item2, long funcPtr) {
693 int retval = 0;
694 PyObject* func = (PyObject*)funcPtr;
695 wxPyTState* state = wxPyBeginBlockThreads();
696
697 PyObject* args = Py_BuildValue("(ii)", item1, item2);
698 PyObject* result = PyEval_CallObject(func, args);
699 Py_DECREF(args);
700 if (result) {
701 retval = PyInt_AsLong(result);
702 Py_DECREF(result);
703 }
704
705 wxPyEndBlockThreads(state);
706 return retval;
707 }
708
709 %}
710
711 //----------------------------------------------------------------------
712
713 class wxListView : public wxPyListCtrl
714 {
715 public:
716 wxListView( wxWindow *parent,
717 wxWindowID id = -1,
718 const wxPoint& pos = wxDefaultPosition,
719 const wxSize& size = wxDefaultSize,
720 long style = wxLC_REPORT,
721 const wxValidator& validator = wxDefaultValidator,
722 const wxString &name = "listctrl" );
723 %name(wxPreListView)wxListView();
724
725 bool Create( wxWindow *parent,
726 wxWindowID id = -1,
727 const wxPoint& pos = wxDefaultPosition,
728 const wxSize& size = wxDefaultSize,
729 long style = wxLC_REPORT,
730 const wxValidator& validator = wxDefaultValidator,
731 const wxString &name = "listctrl" );
732
733 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
734 %pragma(python) addtomethod = "wxPreListView:val._setOORInfo(val)"
735
736 // [de]select an item
737 void Select(long n, bool on = TRUE);
738
739 // focus and show the given item
740 void Focus(long index);
741
742 // get the currently focused item or -1 if none
743 long GetFocusedItem() const;
744
745 // get first and subsequent selected items, return -1 when no more
746 long GetNextSelected(long item) const;
747 long GetFirstSelected() const;
748
749 // return TRUE if the item is selected
750 bool IsSelected(long index);
751
752 void SetColumnImage(int col, int image);
753 void ClearColumnImage(int col);
754 };
755
756
757 //----------------------------------------------------------------------
758
759 // wxTreeCtrl flags
760 enum {
761 wxTR_NO_BUTTONS,
762 wxTR_HAS_BUTTONS,
763 wxTR_TWIST_BUTTONS,
764 wxTR_NO_LINES,
765 wxTR_MAC_BUTTONS,
766
767 wxTR_SINGLE,
768 wxTR_MULTIPLE,
769 wxTR_EXTENDED,
770
771 wxTR_EDIT_LABELS,
772 wxTR_LINES_AT_ROOT,
773 wxTR_HIDE_ROOT,
774 wxTR_ROW_LINES,
775 wxTR_HAS_VARIABLE_ROW_HEIGHT,
776
777 wxTR_DEFAULT_STYLE,
778 };
779
780 enum wxTreeItemIcon
781 {
782 wxTreeItemIcon_Normal, // not selected, not expanded
783 wxTreeItemIcon_Selected, // selected, not expanded
784 wxTreeItemIcon_Expanded, // not selected, expanded
785 wxTreeItemIcon_SelectedExpanded, // selected, expanded
786 wxTreeItemIcon_Max
787 };
788
789
790 // constants for HitTest
791 enum {
792 wxTREE_HITTEST_ABOVE,
793 wxTREE_HITTEST_BELOW,
794 wxTREE_HITTEST_NOWHERE,
795 wxTREE_HITTEST_ONITEMBUTTON,
796 wxTREE_HITTEST_ONITEMICON,
797 wxTREE_HITTEST_ONITEMINDENT,
798 wxTREE_HITTEST_ONITEMLABEL,
799 wxTREE_HITTEST_ONITEMRIGHT,
800 wxTREE_HITTEST_ONITEMSTATEICON,
801 wxTREE_HITTEST_TOLEFT,
802 wxTREE_HITTEST_TORIGHT,
803 wxTREE_HITTEST_ONITEMUPPERPART,
804 wxTREE_HITTEST_ONITEMLOWERPART,
805 wxTREE_HITTEST_ONITEM
806 };
807
808
809 enum {
810 /* Tree control event types */
811 wxEVT_COMMAND_TREE_BEGIN_DRAG,
812 wxEVT_COMMAND_TREE_BEGIN_RDRAG,
813 wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT,
814 wxEVT_COMMAND_TREE_END_LABEL_EDIT,
815 wxEVT_COMMAND_TREE_DELETE_ITEM,
816 wxEVT_COMMAND_TREE_GET_INFO,
817 wxEVT_COMMAND_TREE_SET_INFO,
818 wxEVT_COMMAND_TREE_ITEM_EXPANDED,
819 wxEVT_COMMAND_TREE_ITEM_EXPANDING,
820 wxEVT_COMMAND_TREE_ITEM_COLLAPSED,
821 wxEVT_COMMAND_TREE_ITEM_COLLAPSING,
822 wxEVT_COMMAND_TREE_SEL_CHANGED,
823 wxEVT_COMMAND_TREE_SEL_CHANGING,
824 wxEVT_COMMAND_TREE_KEY_DOWN,
825 wxEVT_COMMAND_TREE_ITEM_ACTIVATED,
826 wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK,
827 wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK,
828 wxEVT_COMMAND_TREE_END_DRAG,
829 };
830
831
832 %pragma(python) code = "
833 # wxTreeCtrl events
834 def EVT_TREE_BEGIN_DRAG(win, id, func):
835 win.Connect(id, -1, wxEVT_COMMAND_TREE_BEGIN_DRAG, func)
836
837 def EVT_TREE_BEGIN_RDRAG(win, id, func):
838 win.Connect(id, -1, wxEVT_COMMAND_TREE_BEGIN_RDRAG, func)
839
840 def EVT_TREE_END_DRAG(win, id, func):
841 win.Connect(id, -1, wxEVT_COMMAND_TREE_END_DRAG, func)
842
843 def EVT_TREE_BEGIN_LABEL_EDIT(win, id, func):
844 win.Connect(id, -1, wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT, func)
845
846 def EVT_TREE_END_LABEL_EDIT(win, id, func):
847 win.Connect(id, -1, wxEVT_COMMAND_TREE_END_LABEL_EDIT, func)
848
849 def EVT_TREE_GET_INFO(win, id, func):
850 win.Connect(id, -1, wxEVT_COMMAND_TREE_GET_INFO, func)
851
852 def EVT_TREE_SET_INFO(win, id, func):
853 win.Connect(id, -1, wxEVT_COMMAND_TREE_SET_INFO, func)
854
855 def EVT_TREE_ITEM_EXPANDED(win, id, func):
856 win.Connect(id, -1, wxEVT_COMMAND_TREE_ITEM_EXPANDED, func)
857
858 def EVT_TREE_ITEM_EXPANDING(win, id, func):
859 win.Connect(id, -1, wxEVT_COMMAND_TREE_ITEM_EXPANDING, func)
860
861 def EVT_TREE_ITEM_COLLAPSED(win, id, func):
862 win.Connect(id, -1, wxEVT_COMMAND_TREE_ITEM_COLLAPSED, func)
863
864 def EVT_TREE_ITEM_COLLAPSING(win, id, func):
865 win.Connect(id, -1, wxEVT_COMMAND_TREE_ITEM_COLLAPSING, func)
866
867 def EVT_TREE_SEL_CHANGED(win, id, func):
868 win.Connect(id, -1, wxEVT_COMMAND_TREE_SEL_CHANGED, func)
869
870 def EVT_TREE_SEL_CHANGING(win, id, func):
871 win.Connect(id, -1, wxEVT_COMMAND_TREE_SEL_CHANGING, func)
872
873 def EVT_TREE_KEY_DOWN(win, id, func):
874 win.Connect(id, -1, wxEVT_COMMAND_TREE_KEY_DOWN, func)
875
876 def EVT_TREE_DELETE_ITEM(win, id, func):
877 win.Connect(id, -1, wxEVT_COMMAND_TREE_DELETE_ITEM, func)
878
879 def EVT_TREE_ITEM_ACTIVATED(win, id, func):
880 win.Connect(id, -1, wxEVT_COMMAND_TREE_ITEM_ACTIVATED, func)
881
882 def EVT_TREE_ITEM_RIGHT_CLICK(win, id, func):
883 win.Connect(id, -1, wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK, func)
884
885 def EVT_TREE_ITEM_MIDDLE_CLICK(win, id, func):
886 win.Connect(id, -1, wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK, func)
887 "
888
889
890 class wxTreeItemAttr
891 {
892 public:
893 // ctors
894 //wxTreeItemAttr() { }
895 wxTreeItemAttr(const wxColour& colText = wxNullColour,
896 const wxColour& colBack = wxNullColour,
897 const wxFont& font = wxNullFont);
898
899 // setters
900 void SetTextColour(const wxColour& colText);
901 void SetBackgroundColour(const wxColour& colBack);
902 void SetFont(const wxFont& font);
903
904 // accessors
905 bool HasTextColour();
906 bool HasBackgroundColour();
907 bool HasFont();
908
909 const wxColour& GetTextColour();
910 const wxColour& GetBackgroundColour();
911 const wxFont& GetFont();
912 };
913
914
915 class wxTreeItemId {
916 public:
917 wxTreeItemId();
918 ~wxTreeItemId();
919 bool IsOk();
920
921 %addmethods {
922 int __cmp__(wxTreeItemId* other) {
923 if (! other) return -1;
924 return *self != *other;
925 }
926 }
927 };
928
929
930
931 %{
932 class wxPyTreeItemData : public wxTreeItemData {
933 public:
934 wxPyTreeItemData(PyObject* obj = NULL) {
935 if (obj == NULL)
936 obj = Py_None;
937 Py_INCREF(obj);
938 m_obj = obj;
939 }
940
941 ~wxPyTreeItemData() {
942 wxPyTState* state = wxPyBeginBlockThreads();
943 Py_DECREF(m_obj);
944 wxPyEndBlockThreads(state);
945 }
946
947 PyObject* GetData() {
948 Py_INCREF(m_obj);
949 return m_obj;
950 }
951
952 void SetData(PyObject* obj) {
953 wxPyTState* state = wxPyBeginBlockThreads();
954 Py_DECREF(m_obj);
955 wxPyEndBlockThreads(state);
956 m_obj = obj;
957 Py_INCREF(obj);
958 }
959
960 PyObject* m_obj;
961 };
962 %}
963
964
965
966 %name(wxTreeItemData) class wxPyTreeItemData : public wxObject {
967 public:
968 wxPyTreeItemData(PyObject* obj = NULL);
969
970 PyObject* GetData();
971 void SetData(PyObject* obj);
972
973 const wxTreeItemId& GetId();
974 void SetId(const wxTreeItemId& id);
975 };
976
977
978
979 class wxTreeEvent : public wxNotifyEvent {
980 public:
981 wxTreeEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
982
983 wxTreeItemId GetItem();
984 wxTreeItemId GetOldItem();
985 wxPoint GetPoint();
986 const wxKeyEvent& GetKeyEvent();
987 int GetCode();
988 const wxString& GetLabel();
989 };
990
991
992
993 %{ // C++ version of Python aware wxTreeCtrl
994 class wxPyTreeCtrl : public wxTreeCtrl {
995 DECLARE_ABSTRACT_CLASS(wxPyTreeCtrl);
996 public:
997 wxPyTreeCtrl() : wxTreeCtrl() {}
998 wxPyTreeCtrl(wxWindow *parent, wxWindowID id,
999 const wxPoint& pos,
1000 const wxSize& size,
1001 long style,
1002 const wxValidator& validator,
1003 char* name) :
1004 wxTreeCtrl(parent, id, pos, size, style, validator, name) {}
1005
1006 bool Create(wxWindow *parent, wxWindowID id,
1007 const wxPoint& pos,
1008 const wxSize& size,
1009 long style,
1010 const wxValidator& validator,
1011 char* name) {
1012 return wxTreeCtrl::Create(parent, id, pos, size, style, validator, name);
1013 }
1014
1015
1016 int OnCompareItems(const wxTreeItemId& item1,
1017 const wxTreeItemId& item2) {
1018 int rval = 0;
1019 bool found;
1020 wxPyTState* state = wxPyBeginBlockThreads();
1021 if ((found = m_myInst.findCallback("OnCompareItems")))
1022 rval = m_myInst.callCallback(Py_BuildValue(
1023 "(OO)",
1024 wxPyConstructObject((void*)&item1, "wxTreeItemId"),
1025 wxPyConstructObject((void*)&item2, "wxTreeItemId")));
1026 wxPyEndBlockThreads(state);
1027 if (! found)
1028 rval = wxTreeCtrl::OnCompareItems(item1, item2);
1029 return rval;
1030 }
1031 PYPRIVATE;
1032 };
1033
1034 IMPLEMENT_ABSTRACT_CLASS(wxPyTreeCtrl, wxTreeCtrl);
1035
1036 %}
1037
1038 // These are for the GetFirstChild/GetNextChild methods below
1039 %typemap(python, in) long& INOUT = long* INOUT;
1040 %typemap(python, argout) long& INOUT = long* INOUT;
1041
1042
1043 %name(wxTreeCtrl)class wxPyTreeCtrl : public wxControl {
1044 public:
1045 wxPyTreeCtrl(wxWindow *parent, wxWindowID id = -1,
1046 const wxPoint& pos = wxDefaultPosition,
1047 const wxSize& size = wxDefaultSize,
1048 long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT,
1049 const wxValidator& validator = wxDefaultValidator,
1050 char* name = "wxTreeCtrl");
1051 %name(wxPreTreeCtrl)wxPyTreeCtrl();
1052
1053 bool Create(wxWindow *parent, wxWindowID id = -1,
1054 const wxPoint& pos = wxDefaultPosition,
1055 const wxSize& size = wxDefaultSize,
1056 long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT,
1057 const wxValidator& validator = wxDefaultValidator,
1058 char* name = "wxTreeCtrl");
1059
1060 void _setCallbackInfo(PyObject* self, PyObject* _class);
1061 %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxTreeCtrl)"
1062
1063 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
1064 %pragma(python) addtomethod = "wxPreTreeCtrl:val._setOORInfo(val)"
1065
1066 size_t GetCount();
1067 unsigned int GetIndent();
1068 void SetIndent(unsigned int indent);
1069 wxImageList *GetImageList();
1070 wxImageList *GetStateImageList();
1071 void SetImageList(wxImageList *imageList);
1072 void SetStateImageList(wxImageList *imageList);
1073 void AssignImageList(wxImageList* imageList);
1074 %pragma(python) addtomethod = "AssignImageList:_args[0].thisown = 0"
1075 void AssignStateImageList(wxImageList* imageList);
1076 %pragma(python) addtomethod = "AssignStateImageList:_args[0].thisown = 0"
1077
1078 unsigned int GetSpacing();
1079 void SetSpacing(unsigned int spacing);
1080
1081 wxString GetItemText(const wxTreeItemId& item);
1082 int GetItemImage(const wxTreeItemId& item,
1083 wxTreeItemIcon which = wxTreeItemIcon_Normal);
1084 int GetItemSelectedImage(const wxTreeItemId& item);
1085
1086 void SetItemText(const wxTreeItemId& item, const wxString& text);
1087 void SetItemImage(const wxTreeItemId& item, int image,
1088 wxTreeItemIcon which = wxTreeItemIcon_Normal);
1089 void SetItemSelectedImage(const wxTreeItemId& item, int image);
1090 void SetItemHasChildren(const wxTreeItemId& item, bool hasChildren = TRUE);
1091
1092 %addmethods {
1093 // [Get|Set]ItemData substitutes. Automatically create wxPyTreeItemData
1094 // if needed.
1095 wxPyTreeItemData* GetItemData(const wxTreeItemId& item) {
1096 wxPyTreeItemData* data = (wxPyTreeItemData*)self->GetItemData(item);
1097 if (data == NULL) {
1098 data = new wxPyTreeItemData();
1099 data->SetId(item); // set the id
1100 self->SetItemData(item, data);
1101 }
1102 return data;
1103 }
1104
1105 void SetItemData(const wxTreeItemId& item, wxPyTreeItemData* data) {
1106 data->SetId(item); // set the id
1107 self->SetItemData(item, data);
1108 }
1109
1110 // [Get|Set]PyData are short-cuts. Also made somewhat crash-proof by
1111 // automatically creating data classes.
1112 PyObject* GetPyData(const wxTreeItemId& item) {
1113 wxPyTreeItemData* data = (wxPyTreeItemData*)self->GetItemData(item);
1114 if (data == NULL) {
1115 data = new wxPyTreeItemData();
1116 data->SetId(item); // set the id
1117 self->SetItemData(item, data);
1118 }
1119 return data->GetData();
1120 }
1121
1122 void SetPyData(const wxTreeItemId& item, PyObject* obj) {
1123 wxPyTreeItemData* data = (wxPyTreeItemData*)self->GetItemData(item);
1124 if (data == NULL) {
1125 data = new wxPyTreeItemData(obj);
1126 data->SetId(item); // set the id
1127 self->SetItemData(item, data);
1128 } else
1129 data->SetData(obj);
1130 }
1131 }
1132
1133
1134 bool IsVisible(const wxTreeItemId& item);
1135 bool ItemHasChildren(const wxTreeItemId& item);
1136 bool IsExpanded(const wxTreeItemId& item);
1137 bool IsSelected(const wxTreeItemId& item);
1138
1139 wxTreeItemId GetRootItem();
1140 wxTreeItemId GetSelection();
1141 %name(GetItemParent) wxTreeItemId GetParent(const wxTreeItemId& item);
1142 //size_t GetSelections(wxArrayTreeItemIds& selection);
1143 %addmethods {
1144 PyObject* GetSelections() {
1145 wxPyTState* state = wxPyBeginBlockThreads();
1146 PyObject* rval = PyList_New(0);
1147 wxArrayTreeItemIds array;
1148 size_t num, x;
1149 num = self->GetSelections(array);
1150 for (x=0; x < num; x++) {
1151 wxTreeItemId *tii = new wxTreeItemId(array.Item(x));
1152 PyObject* item = wxPyConstructObject((void*)tii, "wxTreeItemId", TRUE);
1153 PyList_Append(rval, item);
1154 }
1155 wxPyEndBlockThreads(state);
1156 return rval;
1157 }
1158 }
1159
1160
1161
1162 size_t GetChildrenCount(const wxTreeItemId& item, bool recursively = TRUE);
1163
1164 wxTreeItemId GetFirstChild(const wxTreeItemId& item, long& INOUT);
1165 wxTreeItemId GetNextChild(const wxTreeItemId& item, long& INOUT);
1166 wxTreeItemId GetNextSibling(const wxTreeItemId& item);
1167 wxTreeItemId GetPrevSibling(const wxTreeItemId& item);
1168 wxTreeItemId GetFirstVisibleItem();
1169 wxTreeItemId GetNextVisible(const wxTreeItemId& item);
1170 wxTreeItemId GetPrevVisible(const wxTreeItemId& item);
1171 wxTreeItemId GetLastChild(const wxTreeItemId& item);
1172
1173
1174
1175 wxTreeItemId AddRoot(const wxString& text,
1176 int image = -1, int selectedImage = -1,
1177 wxPyTreeItemData *data = NULL);
1178 wxTreeItemId PrependItem(const wxTreeItemId& parent,
1179 const wxString& text,
1180 int image = -1, int selectedImage = -1,
1181 wxPyTreeItemData *data = NULL);
1182 wxTreeItemId InsertItem(const wxTreeItemId& parent,
1183 const wxTreeItemId& idPrevious,
1184 const wxString& text,
1185 int image = -1, int selectedImage = -1,
1186 wxPyTreeItemData *data = NULL);
1187 %name(InsertItemBefore)
1188 wxTreeItemId InsertItem(const wxTreeItemId& parent,
1189 size_t before,
1190 const wxString& text,
1191 int image = -1, int selectedImage = -1,
1192 wxTreeItemData *data = NULL);
1193 wxTreeItemId AppendItem(const wxTreeItemId& parent,
1194 const wxString& text,
1195 int image = -1, int selectedImage = -1,
1196 wxPyTreeItemData *data = NULL);
1197
1198 void Delete(const wxTreeItemId& item);
1199 void DeleteChildren(const wxTreeItemId& item);
1200 void DeleteAllItems();
1201
1202 void Expand(const wxTreeItemId& item);
1203 void Collapse(const wxTreeItemId& item);
1204 void CollapseAndReset(const wxTreeItemId& item);
1205 void Toggle(const wxTreeItemId& item);
1206
1207 void Unselect();
1208 void UnselectAll();
1209 void SelectItem(const wxTreeItemId& item);
1210 void EnsureVisible(const wxTreeItemId& item);
1211 void ScrollTo(const wxTreeItemId& item);
1212 #ifdef __WXMSW__
1213 wxTextCtrl* EditLabel(const wxTreeItemId& item);
1214 wxTextCtrl* GetEditControl();
1215 void EndEditLabel(const wxTreeItemId& item, int discardChanges = FALSE);
1216 #else
1217 void EditLabel(const wxTreeItemId& item);
1218 #endif
1219
1220 void SortChildren(const wxTreeItemId& item);
1221
1222 void SetItemBold(const wxTreeItemId& item, int bold = TRUE);
1223 bool IsBold(const wxTreeItemId& item) const;
1224 wxTreeItemId HitTest(const wxPoint& point, int& OUTPUT);
1225
1226
1227
1228 void SetItemTextColour(const wxTreeItemId& item, const wxColour& col);
1229 void SetItemBackgroundColour(const wxTreeItemId& item, const wxColour& col);
1230 void SetItemFont(const wxTreeItemId& item, const wxFont& font);
1231
1232 #ifdef __WXMSW__
1233 void SetItemDropHighlight(const wxTreeItemId& item, int highlight = TRUE);
1234
1235 //bool GetBoundingRect(const wxTreeItemId& item, wxRect& rect, int textOnly = FALSE)
1236 %addmethods {
1237 PyObject* GetBoundingRect(const wxTreeItemId& item, int textOnly = FALSE) {
1238 wxRect rect;
1239 if (self->GetBoundingRect(item, rect, textOnly)) {
1240 wxPyTState* state = wxPyBeginBlockThreads();
1241 wxRect* r = new wxRect(rect);
1242 PyObject* val = wxPyConstructObject((void*)r, "wxRect");
1243 wxPyEndBlockThreads(state);
1244 return val;
1245 }
1246 else {
1247 Py_INCREF(Py_None);
1248 return Py_None;
1249 }
1250 }
1251 }
1252 #endif
1253
1254 %pragma(python) addtoclass = "
1255 # Redefine some methods that SWIG gets a bit confused on...
1256 def GetFirstChild(self, *_args, **_kwargs):
1257 val1,val2 = apply(controls2c.wxTreeCtrl_GetFirstChild,(self,) + _args, _kwargs)
1258 val1 = wxTreeItemIdPtr(val1)
1259 val1.thisown = 1
1260 return (val1,val2)
1261 def GetNextChild(self, *_args, **_kwargs):
1262 val1,val2 = apply(controls2c.wxTreeCtrl_GetNextChild,(self,) + _args, _kwargs)
1263 val1 = wxTreeItemIdPtr(val1)
1264 val1.thisown = 1
1265 return (val1,val2)
1266 def HitTest(self, *_args, **_kwargs):
1267 val1, val2 = apply(controls2c.wxTreeCtrl_HitTest,(self,) + _args, _kwargs)
1268 val1 = wxTreeItemIdPtr(val1)
1269 val1.thisown = 1
1270 return (val1,val2)
1271 "
1272 };
1273
1274
1275 //----------------------------------------------------------------------
1276
1277 %init %{
1278 // Map renamed classes back to their common name for OOR
1279 wxPyPtrTypeMap_Add("wxTreeItemData", "wxPyTreeItemData");
1280 wxPyPtrTypeMap_Add("wxTreeCtrl", "wxPyTreeCtrl");
1281 wxPyPtrTypeMap_Add("wxListCtrl", "wxPyListCtrl");
1282 %}
1283
1284 //----------------------------------------------------------------------
1285
1286