%{
#include "helpers.h"
+#ifdef __WXMSW__
+#include <windows.h>
+#endif
#include <wx/listctrl.h>
#include <wx/treectrl.h>
%}
long GetItemData(long item);
%addmethods {
- %new wxListItem* GetItem(long itemId) {
+ %new wxListItem* GetItem(long itemId, int col=0) {
wxListItem* info = new wxListItem;
info->m_itemId = itemId;
+ info->m_col = col;
self->GetItem(*info);
return info;
}
void SetImageList(wxImageList *imageList);
void SetStateImageList(wxImageList *imageList);
+ unsigned int GetSpacing();
+ void SetSpacing(unsigned int spacing);
+
wxString GetItemText(const wxTreeItemId& item);
int GetItemImage(const wxTreeItemId& item);
int GetItemSelectedImage(const wxTreeItemId& item);
wxTreeItemId GetRootItem();
wxTreeItemId GetSelection();
wxTreeItemId GetParent(const wxTreeItemId& item);
+ //size_t GetSelections(wxArrayTreeItemIds& selection);
+ %addmethods {
+ PyObject* GetSelections() {
+ PyObject* rval = PyList_New(0);
+ wxArrayTreeItemIds array;
+ size_t num, x;
+ num = self->GetSelections(array);
+ for (x=0; x < num; x++) {
+ PyObject* item = wxPyConstructObject((void*)&array.Item(x),
+ "wxTreeItemId");
+ PyList_Append(rval, item);
+ }
+ return rval;
+ }
+ }
+
+
size_t GetChildrenCount(const wxTreeItemId& item, bool recursively = TRUE);
wxTreeItemId GetFirstVisibleItem();
wxTreeItemId GetNextVisible(const wxTreeItemId& item);
wxTreeItemId GetPrevVisible(const wxTreeItemId& item);
+ wxTreeItemId GetLastChild(const wxTreeItemId& item);
+
wxTreeItemId AddRoot(const wxString& text,
#ifdef __WXMSW__
wxTextCtrl* EditLabel(const wxTreeItemId& item);
wxTextCtrl* GetEditControl();
- void EndEditLabel(const wxTreeItemId& item, bool discardChanges = FALSE);
+ void EndEditLabel(const wxTreeItemId& item, int discardChanges = FALSE);
#else
void EditLabel(const wxTreeItemId& item);
#endif
-// void SortChildren(const wxTreeItemId& item);
- // **** And this too
- // wxTreeItemCmpFunc *cmpFunction = NULL);
+ void SortChildren(const wxTreeItemId& item);
- void SetItemBold(const wxTreeItemId& item, bool bold = TRUE);
+ void SetItemBold(const wxTreeItemId& item, int bold = TRUE);
bool IsBold(const wxTreeItemId& item) const;
wxTreeItemId HitTest(const wxPoint& point);
+#ifdef __WXMSW__
+ void SetItemDropHighlight(const wxTreeItemId& item, int highlight = TRUE);
+
+ //bool GetBoundingRect(const wxTreeItemId& item, wxRect& rect, int textOnly = FALSE)
+ %addmethods {
+ PyObject* GetBoundingRect(const wxTreeItemId& item, int textOnly = FALSE) {
+ wxRect rect;
+ if (self->GetBoundingRect(item, rect, textOnly))
+ return wxPyConstructObject((void*)&rect, "wxRect");
+ else {
+ Py_INCREF(Py_None);
+ return Py_None;
+ }
+ }
+ }
+#endif
+
%pragma(python) addtoclass = "
# Redefine a couple methods that SWIG gets a bit confused on...
def GetFirstChild(self,arg0,arg1):