]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/controls2.i
Fixed sashwin events
[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 %}
23
24 //----------------------------------------------------------------------
25
26 %include typemaps.i
27 %include my_typemaps.i
28
29 // Import some definitions of other classes, etc.
30 %import _defs.i
31 %import misc.i
32 %import windows.i
33 %import gdi.i
34 %import events.i
35 %import controls.i
36
37 %pragma(python) code = "import wx"
38
39 //----------------------------------------------------------------------
40
41
42 enum {
43 wxLIST_MASK_TEXT,
44 wxLIST_MASK_IMAGE,
45 wxLIST_MASK_DATA,
46 wxLIST_MASK_WIDTH,
47 wxLIST_MASK_FORMAT,
48 wxLIST_MASK_STATE,
49 wxLIST_STATE_DONTCARE,
50 wxLIST_STATE_DROPHILITED,
51 wxLIST_STATE_FOCUSED,
52 wxLIST_STATE_SELECTED,
53 wxLIST_STATE_CUT,
54 wxLIST_HITTEST_ABOVE,
55 wxLIST_HITTEST_BELOW,
56 wxLIST_HITTEST_NOWHERE,
57 wxLIST_HITTEST_ONITEMICON,
58 wxLIST_HITTEST_ONITEMLABEL,
59 wxLIST_HITTEST_ONITEMRIGHT,
60 wxLIST_HITTEST_ONITEMSTATEICON,
61 wxLIST_HITTEST_TOLEFT,
62 wxLIST_HITTEST_TORIGHT,
63 wxLIST_HITTEST_ONITEM,
64 wxLIST_NEXT_ABOVE,
65 wxLIST_NEXT_ALL,
66 wxLIST_NEXT_BELOW,
67 wxLIST_NEXT_LEFT,
68 wxLIST_NEXT_RIGHT,
69 wxLIST_ALIGN_DEFAULT,
70 wxLIST_ALIGN_LEFT,
71 wxLIST_ALIGN_TOP,
72 wxLIST_ALIGN_SNAP_TO_GRID,
73 wxLIST_AUTOSIZE,
74 wxLIST_AUTOSIZE_USEHEADER,
75 wxLIST_RECT_BOUNDS,
76 wxLIST_RECT_ICON,
77 wxLIST_RECT_LABEL,
78 wxLIST_FIND_UP,
79 wxLIST_FIND_DOWN,
80 wxLIST_FIND_LEFT,
81 wxLIST_FIND_RIGHT,
82 };
83
84
85 enum wxListColumnFormat
86 {
87 wxLIST_FORMAT_LEFT,
88 wxLIST_FORMAT_RIGHT,
89 wxLIST_FORMAT_CENTRE,
90 wxLIST_FORMAT_CENTER = wxLIST_FORMAT_CENTRE
91 };
92
93
94 class wxListItemAttr
95 {
96 public:
97 // ctors
98 wxListItemAttr();
99 //wxListItemAttr(const wxColour& colText,
100 // const wxColour& colBack,
101 // const wxFont& font)
102 // : m_colText(colText), m_colBack(colBack), m_font(font) { }
103
104 // setters
105 void SetTextColour(const wxColour& colText);
106 void SetBackgroundColour(const wxColour& colBack);
107 void SetFont(const wxFont& font);
108
109 // accessors
110 bool HasTextColour();
111 bool HasBackgroundColour();
112 bool HasFont();
113
114 const wxColour& GetTextColour();
115 const wxColour& GetBackgroundColour();
116 const wxFont& GetFont();
117 };
118
119
120 class wxListItem {
121 public:
122 wxListItem();
123 ~wxListItem();
124
125 // resetting
126 void Clear();
127 void ClearAttributes();
128
129 // setters
130 void SetMask(long mask);
131 void SetId(long id);
132 void SetColumn(int col);
133 void SetState(long state);
134 void SetStateMask(long stateMask);
135 void SetText(const wxString& text);
136 void SetImage(int image);
137 void SetData(long data);
138
139 void SetWidth(int width);
140 void SetAlign(wxListColumnFormat align);
141
142 void SetTextColour(const wxColour& colText);
143 void SetBackgroundColour(const wxColour& colBack);
144 void SetFont(const wxFont& font);
145
146 // accessors
147 long GetMask();
148 long GetId();
149 int GetColumn();
150 long GetState();
151 const wxString& GetText();
152 int GetImage();
153 long GetData();
154
155 int GetWidth();
156 wxListColumnFormat GetAlign();
157
158 wxListItemAttr *GetAttributes();
159 bool HasAttributes();
160
161 wxColour GetTextColour() const;
162 wxColour GetBackgroundColour() const;
163 wxFont GetFont() const;
164
165 // these members are public for compatibility
166 long m_mask; // Indicates what fields are valid
167 long m_itemId; // The zero-based item position
168 int m_col; // Zero-based column, if in report mode
169 long m_state; // The state of the item
170 long m_stateMask;// Which flags of m_state are valid (uses same flags)
171 wxString m_text; // The label/header text
172 int m_image; // The zero-based index into an image list
173 long m_data; // App-defined data
174
175 // For columns only
176 int m_format; // left, right, centre
177 int m_width; // width of column
178
179 };
180
181
182 class wxListEvent: public wxNotifyEvent {
183 public:
184 int m_code;
185 long m_itemIndex;
186 long m_oldItemIndex;
187 int m_col;
188 bool m_cancelled;
189 wxPoint m_pointDrag;
190 wxListItem m_item;
191
192 int GetCode();
193 long GetIndex();
194 long GetOldIndex();
195 long GetOldItem();
196 int GetColumn();
197 bool Cancelled();
198 wxPoint GetPoint();
199 const wxString& GetLabel();
200 const wxString& GetText();
201 int GetImage();
202 long GetData();
203 long GetMask();
204 const wxListItem& GetItem();
205 };
206
207
208
209 class wxListCtrl : public wxControl {
210 public:
211 wxListCtrl(wxWindow* parent, wxWindowID id,
212 const wxPoint& pos = wxDefaultPosition,
213 const wxSize& size = wxDefaultSize,
214 long style = wxLC_ICON,
215 const wxValidator& validator = wxDefaultValidator,
216 char* name = "listCtrl");
217
218 %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
219
220 bool Arrange(int flag = wxLIST_ALIGN_DEFAULT);
221 bool DeleteItem(long item);
222 bool DeleteAllItems();
223 bool DeleteColumn(int col);
224 bool DeleteAllColumns(void);
225 void ClearAll(void);
226 #ifdef __WXMSW__
227 wxTextCtrl* EditLabel(long item);
228 bool EndEditLabel(bool cancel);
229 wxTextCtrl* GetEditControl();
230 #else
231 void EditLabel(long item);
232 #endif
233 bool EnsureVisible(long item);
234 long FindItem(long start, const wxString& str, bool partial = FALSE);
235 %name(FindItemData)long FindItem(long start, long data);
236 %name(FindItemAtPos)long FindItem(long start, const wxPoint& pt,
237 int direction);
238 bool GetColumn(int col, wxListItem& item);
239 int GetColumnWidth(int col);
240 int GetCountPerPage();
241 wxImageList* GetImageList(int which);
242 long GetItemData(long item);
243
244 %addmethods {
245 %new wxListItem* GetItem(long itemId, int col=0) {
246 wxListItem* info = new wxListItem;
247 info->m_itemId = itemId;
248 info->m_col = col;
249 info->m_mask = 0xFFFF;
250 self->GetItem(*info);
251 return info;
252 }
253 %new wxPoint* GetItemPosition(long item) {
254 wxPoint* pos = new wxPoint;
255 self->GetItemPosition(item, *pos);
256 return pos;
257 }
258 %new wxRect* GetItemRect(long item, int code = wxLIST_RECT_BOUNDS) {
259 wxRect* rect= new wxRect;
260 self->GetItemRect(item, *rect, code);
261 return rect;
262 }
263 }
264
265 int GetItemState(long item, long stateMask);
266 int GetItemCount();
267 int GetItemSpacing(bool isSmall);
268 wxString GetItemText(long item);
269 long GetNextItem(long item,
270 int geometry = wxLIST_NEXT_ALL,
271 int state = wxLIST_STATE_DONTCARE);
272 int GetSelectedItemCount();
273 #ifdef __WXMSW__
274 wxColour GetTextColour();
275 void SetTextColour(const wxColour& col);
276 #endif
277 long GetTopItem();
278 long HitTest(const wxPoint& point, int& OUTPUT);
279 %name(InsertColumnInfo)long InsertColumn(long col, wxListItem& info);
280 long InsertColumn(long col, const wxString& heading,
281 int format = wxLIST_FORMAT_LEFT,
282 int width = -1);
283
284 long InsertItem(wxListItem& info);
285 %name(InsertStringItem) long InsertItem(long index, const wxString& label);
286 %name(InsertImageItem) long InsertItem(long index, int imageIndex);
287 %name(InsertImageStringItem)long InsertItem(long index, const wxString& label,
288 int imageIndex);
289
290 bool ScrollList(int dx, int dy);
291 void SetBackgroundColour(const wxColour& col);
292 bool SetColumn(int col, wxListItem& item);
293 bool SetColumnWidth(int col, int width);
294 void SetImageList(wxImageList* imageList, int which);
295
296 bool SetItem(wxListItem& info);
297 %name(SetStringItem)long SetItem(long index, int col, const wxString& label,
298 int imageId = -1);
299
300 bool SetItemData(long item, long data);
301 bool SetItemImage(long item, int image, int selImage);
302 bool SetItemPosition(long item, const wxPoint& pos);
303 bool SetItemState(long item, long state, long stateMask);
304 void SetItemText(long item, const wxString& text);
305 void SetSingleStyle(long style, bool add = TRUE);
306 void SetWindowStyleFlag(long style);
307
308 // bool SortItems(wxListCtrlCompare fn, long data);
309 %addmethods {
310 bool SortItems(PyObject* func) {
311 if (!PyCallable_Check(func))
312 return FALSE;
313
314 return self->SortItems(wxPyListCtrl_SortItems, (long)func);
315 }
316 }
317 };
318
319 %{
320 int wxCALLBACK wxPyListCtrl_SortItems(long item1, long item2, long funcPtr) {
321 int retval = 0;
322 PyObject* func = (PyObject*)funcPtr;
323 bool doSave = wxPyRestoreThread();
324
325 PyObject* args = Py_BuildValue("(ii)", item1, item2);
326 PyObject* result = PyEval_CallObject(func, args);
327 Py_DECREF(args);
328 if (result) {
329 retval = PyInt_AsLong(result);
330 Py_DECREF(result);
331 }
332
333 wxPySaveThread(doSave);
334 return retval;
335 }
336
337 %}
338
339 //----------------------------------------------------------------------
340
341 enum wxTreeItemIcon
342 {
343 wxTreeItemIcon_Normal, // not selected, not expanded
344 wxTreeItemIcon_Selected, // selected, not expanded
345 wxTreeItemIcon_Expanded, // not selected, expanded
346 wxTreeItemIcon_SelectedExpanded, // selected, expanded
347 wxTreeItemIcon_Max
348 };
349
350
351 // constants for HitTest
352 enum {
353 wxTREE_HITTEST_ABOVE,
354 wxTREE_HITTEST_BELOW,
355 wxTREE_HITTEST_NOWHERE,
356 wxTREE_HITTEST_ONITEMBUTTON,
357 wxTREE_HITTEST_ONITEMICON,
358 wxTREE_HITTEST_ONITEMINDENT,
359 wxTREE_HITTEST_ONITEMLABEL,
360 wxTREE_HITTEST_ONITEMRIGHT,
361 wxTREE_HITTEST_ONITEMSTATEICON,
362 wxTREE_HITTEST_TOLEFT,
363 wxTREE_HITTEST_TORIGHT,
364 wxTREE_HITTEST_ONITEMUPPERPART,
365 wxTREE_HITTEST_ONITEMLOWERPART,
366 wxTREE_HITTEST_ONITEM
367 };
368
369
370 class wxTreeItemId {
371 public:
372 wxTreeItemId();
373 ~wxTreeItemId();
374 bool IsOk();
375
376 %addmethods {
377 int __cmp__(wxTreeItemId* other) {
378 if (! other) return -1;
379 return *self != *other;
380 }
381 }
382 };
383
384
385
386 %{
387 class wxPyTreeItemData : public wxTreeItemData {
388 public:
389 wxPyTreeItemData(PyObject* obj = NULL) {
390 if (obj == NULL)
391 obj = Py_None;
392 Py_INCREF(obj);
393 m_obj = obj;
394 }
395
396 ~wxPyTreeItemData() {
397 bool doSave = wxPyRestoreThread();
398 Py_DECREF(m_obj);
399 wxPySaveThread(doSave);
400 }
401
402 PyObject* GetData() {
403 Py_INCREF(m_obj);
404 return m_obj;
405 }
406
407 void SetData(PyObject* obj) {
408 bool doSave = wxPyRestoreThread();
409 Py_DECREF(m_obj);
410 wxPySaveThread(doSave);
411 m_obj = obj;
412 Py_INCREF(obj);
413 }
414
415 PyObject* m_obj;
416 };
417 %}
418
419
420
421 %name(wxTreeItemData) class wxPyTreeItemData {
422 public:
423 wxPyTreeItemData(PyObject* obj = NULL);
424
425 PyObject* GetData();
426 void SetData(PyObject* obj);
427
428 const wxTreeItemId& GetId();
429 void SetId(const wxTreeItemId& id);
430 };
431
432
433
434 class wxTreeEvent : public wxNotifyEvent {
435 public:
436 wxTreeItemId GetItem();
437 wxTreeItemId GetOldItem();
438 wxPoint GetPoint();
439 int GetCode();
440 const wxString& GetLabel();
441 };
442
443
444
445 %{
446 class wxPyTreeCtrl : public wxTreeCtrl {
447 public:
448 wxPyTreeCtrl(wxWindow *parent, wxWindowID id,
449 const wxPoint& pos,
450 const wxSize& size,
451 long style,
452 const wxValidator& validator,
453 char* name) :
454 wxTreeCtrl(parent, id, pos, size, style, validator, name) {}
455
456
457 int OnCompareItems(const wxTreeItemId& item1,
458 const wxTreeItemId& item2) {
459 int rval = 0;
460 bool doSave = wxPyRestoreThread();
461 if (m_myInst.findCallback("OnCompareItems"))
462 rval = m_myInst.callCallback(Py_BuildValue(
463 "(OO)",
464 wxPyConstructObject((void*)&item1, "wxTreeItemId"),
465 wxPyConstructObject((void*)&item2, "wxTreeItemId")));
466 else
467 rval = wxTreeCtrl::OnCompareItems(item1, item2);
468 wxPySaveThread(doSave);
469 return rval;
470 }
471 PYPRIVATE;
472 };
473
474 %}
475
476 // These are for the GetFirstChild/GetNextChild methods below
477 %typemap(python, in) long& INOUT = long* INOUT;
478 %typemap(python, argout) long& INOUT = long* INOUT;
479
480
481 %name(wxTreeCtrl)class wxPyTreeCtrl : public wxControl {
482 public:
483 wxPyTreeCtrl(wxWindow *parent, wxWindowID id = -1,
484 const wxPoint& pos = wxDefaultPosition,
485 const wxSize& size = wxDefaultSize,
486 long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT,
487 const wxValidator& validator = wxDefaultValidator,
488 char* name = "wxTreeCtrl");
489
490 void _setSelf(PyObject* self, PyObject* _class);
491 %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
492 %pragma(python) addtomethod = "__init__:self._setSelf(self, wxTreeCtrl)"
493
494 size_t GetCount();
495 unsigned int GetIndent();
496 void SetIndent(unsigned int indent);
497 wxImageList *GetImageList();
498 wxImageList *GetStateImageList();
499 void SetImageList(wxImageList *imageList/*, int which = wxIMAGE_LIST_NORMAL*/);
500 void SetStateImageList(wxImageList *imageList);
501
502 unsigned int GetSpacing();
503 void SetSpacing(unsigned int spacing);
504
505 wxString GetItemText(const wxTreeItemId& item);
506 int GetItemImage(const wxTreeItemId& item,
507 wxTreeItemIcon which = wxTreeItemIcon_Normal);
508 int GetItemSelectedImage(const wxTreeItemId& item);
509
510 void SetItemText(const wxTreeItemId& item, const wxString& text);
511 void SetItemImage(const wxTreeItemId& item, int image,
512 wxTreeItemIcon which = wxTreeItemIcon_Normal);
513 void SetItemSelectedImage(const wxTreeItemId& item, int image);
514 void SetItemHasChildren(const wxTreeItemId& item, bool hasChildren = TRUE);
515
516 %addmethods {
517 // [Get|Set]ItemData substitutes. Automatically create wxPyTreeItemData
518 // if needed.
519 wxPyTreeItemData* GetItemData(const wxTreeItemId& item) {
520 wxPyTreeItemData* data = (wxPyTreeItemData*)self->GetItemData(item);
521 if (data == NULL) {
522 data = new wxPyTreeItemData();
523 data->SetId(item); // set the id
524 self->SetItemData(item, data);
525 }
526 return data;
527 }
528
529 void SetItemData(const wxTreeItemId& item, wxPyTreeItemData* data) {
530 data->SetId(item); // set the id
531 self->SetItemData(item, data);
532 }
533
534 // [Get|Set]PyData are short-cuts. Also made somewhat crash-proof by
535 // automatically creating data classes.
536 PyObject* GetPyData(const wxTreeItemId& item) {
537 wxPyTreeItemData* data = (wxPyTreeItemData*)self->GetItemData(item);
538 if (data == NULL) {
539 data = new wxPyTreeItemData();
540 data->SetId(item); // set the id
541 self->SetItemData(item, data);
542 }
543 return data->GetData();
544 }
545
546 void SetPyData(const wxTreeItemId& item, PyObject* obj) {
547 wxPyTreeItemData* data = (wxPyTreeItemData*)self->GetItemData(item);
548 if (data == NULL) {
549 data = new wxPyTreeItemData(obj);
550 data->SetId(item); // set the id
551 self->SetItemData(item, data);
552 } else
553 data->SetData(obj);
554 }
555 }
556
557
558 bool IsVisible(const wxTreeItemId& item);
559 bool ItemHasChildren(const wxTreeItemId& item);
560 bool IsExpanded(const wxTreeItemId& item);
561 bool IsSelected(const wxTreeItemId& item);
562
563 wxTreeItemId GetRootItem();
564 wxTreeItemId GetSelection();
565 %name(GetItemParent) wxTreeItemId GetParent(const wxTreeItemId& item);
566 //size_t GetSelections(wxArrayTreeItemIds& selection);
567 %addmethods {
568 PyObject* GetSelections() {
569 bool doSave = wxPyRestoreThread();
570 PyObject* rval = PyList_New(0);
571 wxArrayTreeItemIds array;
572 size_t num, x;
573 num = self->GetSelections(array);
574 for (x=0; x < num; x++) {
575 wxTreeItemId *tii = new wxTreeItemId(array.Item(x));
576 PyObject* item = wxPyConstructObject((void*)tii, "wxTreeItemId", TRUE);
577 PyList_Append(rval, item);
578 }
579 wxPySaveThread(doSave);
580 return rval;
581 }
582 }
583
584
585
586 size_t GetChildrenCount(const wxTreeItemId& item, bool recursively = TRUE);
587
588 wxTreeItemId GetFirstChild(const wxTreeItemId& item, long& INOUT);
589 wxTreeItemId GetNextChild(const wxTreeItemId& item, long& INOUT);
590 wxTreeItemId GetNextSibling(const wxTreeItemId& item);
591 wxTreeItemId GetPrevSibling(const wxTreeItemId& item);
592 wxTreeItemId GetFirstVisibleItem();
593 wxTreeItemId GetNextVisible(const wxTreeItemId& item);
594 wxTreeItemId GetPrevVisible(const wxTreeItemId& item);
595 wxTreeItemId GetLastChild(const wxTreeItemId& item);
596
597
598
599 wxTreeItemId AddRoot(const wxString& text,
600 int image = -1, int selectedImage = -1,
601 wxPyTreeItemData *data = NULL);
602 wxTreeItemId PrependItem(const wxTreeItemId& parent,
603 const wxString& text,
604 int image = -1, int selectedImage = -1,
605 wxPyTreeItemData *data = NULL);
606 wxTreeItemId InsertItem(const wxTreeItemId& parent,
607 const wxTreeItemId& idPrevious,
608 const wxString& text,
609 int image = -1, int selectedImage = -1,
610 wxPyTreeItemData *data = NULL);
611 %name(InsertItemBefore)
612 wxTreeItemId InsertItem(const wxTreeItemId& parent,
613 size_t before,
614 const wxString& text,
615 int image = -1, int selectedImage = -1,
616 wxTreeItemData *data = NULL);
617 wxTreeItemId AppendItem(const wxTreeItemId& parent,
618 const wxString& text,
619 int image = -1, int selectedImage = -1,
620 wxPyTreeItemData *data = NULL);
621
622 void Delete(const wxTreeItemId& item);
623 void DeleteChildren(const wxTreeItemId& item);
624 void DeleteAllItems();
625
626 void Expand(const wxTreeItemId& item);
627 void Collapse(const wxTreeItemId& item);
628 void CollapseAndReset(const wxTreeItemId& item);
629 void Toggle(const wxTreeItemId& item);
630
631 void Unselect();
632 void UnselectAll();
633 void SelectItem(const wxTreeItemId& item);
634 void EnsureVisible(const wxTreeItemId& item);
635 void ScrollTo(const wxTreeItemId& item);
636 #ifdef __WXMSW__
637 wxTextCtrl* EditLabel(const wxTreeItemId& item);
638 wxTextCtrl* GetEditControl();
639 void EndEditLabel(const wxTreeItemId& item, int discardChanges = FALSE);
640 #else
641 void EditLabel(const wxTreeItemId& item);
642 #endif
643
644 void SortChildren(const wxTreeItemId& item);
645
646 void SetItemBold(const wxTreeItemId& item, int bold = TRUE);
647 bool IsBold(const wxTreeItemId& item) const;
648 wxTreeItemId HitTest(const wxPoint& point, int& OUTPUT);
649
650
651
652 void SetItemTextColour(const wxTreeItemId& item, const wxColour& col);
653 void SetItemBackgroundColour(const wxTreeItemId& item, const wxColour& col);
654 void SetItemFont(const wxTreeItemId& item, const wxFont& font);
655
656 #ifdef __WXMSW__
657 void SetItemDropHighlight(const wxTreeItemId& item, int highlight = TRUE);
658
659 //bool GetBoundingRect(const wxTreeItemId& item, wxRect& rect, int textOnly = FALSE)
660 %addmethods {
661 PyObject* GetBoundingRect(const wxTreeItemId& item, int textOnly = FALSE) {
662 wxRect rect;
663 if (self->GetBoundingRect(item, rect, textOnly)) {
664 bool doSave = wxPyRestoreThread();
665 wxRect* r = new wxRect(rect);
666 PyObject* val = wxPyConstructObject((void*)r, "wxRect");
667 wxPySaveThread(doSave);
668 return val;
669 }
670 else {
671 Py_INCREF(Py_None);
672 return Py_None;
673 }
674 }
675 }
676 #endif
677
678 %pragma(python) addtoclass = "
679 # Redefine some methods that SWIG gets a bit confused on...
680 def GetFirstChild(self, *_args, **_kwargs):
681 val1,val2 = apply(controls2c.wxTreeCtrl_GetFirstChild,(self,) + _args, _kwargs)
682 val1 = wxTreeItemIdPtr(val1)
683 val1.thisown = 1
684 return (val1,val2)
685 def GetNextChild(self, *_args, **_kwargs):
686 val1,val2 = apply(controls2c.wxTreeCtrl_GetNextChild,(self,) + _args, _kwargs)
687 val1 = wxTreeItemIdPtr(val1)
688 val1.thisown = 1
689 return (val1,val2)
690 def HitTest(self, *_args, **_kwargs):
691 val1, val2 = apply(controls2c.wxTreeCtrl_HitTest,(self,) + _args, _kwargs)
692 val1 = wxTreeItemIdPtr(val1)
693 val1.thisown = 1
694 return (val1,val2)
695 "
696 };
697
698
699 //----------------------------------------------------------------------
700
701 #ifdef SKIPTHIS
702 #ifdef __WXMSW__
703 class wxTabEvent : public wxCommandEvent {
704 public:
705 };
706
707
708
709 class wxTabCtrl : public wxControl {
710 public:
711 wxTabCtrl(wxWindow* parent, wxWindowID id,
712 const wxPoint& pos = wxDefaultPosition,
713 const wxSize& size = wxDefaultSize,
714 long style = 0,
715 char* name = "tabCtrl");
716
717 %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
718
719 bool DeleteAllItems();
720 bool DeleteItem(int item);
721 wxImageList* GetImageList();
722 int GetItemCount();
723 // TODO: void* GetItemData();
724 int GetItemImage(int item);
725
726 %addmethods {
727 %new wxRect* GetItemRect(int item) {
728 wxRect* rect = new wxRect;
729 self->GetItemRect(item, *rect);
730 return rect;
731 }
732 }
733
734 wxString GetItemText(int item);
735 bool GetRowCount();
736 int GetSelection();
737 int HitTest(const wxPoint& pt, long& OUTPUT);
738 void InsertItem(int item, const wxString& text,
739 int imageId = -1, void* clientData = NULL);
740 // TODO: bool SetItemData(int item, void* data);
741 bool SetItemImage(int item, int image);
742 void SetImageList(wxImageList* imageList);
743 void SetItemSize(const wxSize& size);
744 bool SetItemText(int item, const wxString& text);
745 void SetPadding(const wxSize& padding);
746 int SetSelection(int item);
747
748 };
749
750 #endif
751 #endif
752
753 //----------------------------------------------------------------------
754
755