static const wxString wxPyEmptyString(wxT(""));
%}
+
+%{
+ static const long longzero = 0;
+%}
+
//----------------------------------------------------------------------
enum {
public:
wxListEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
+%readonly
int m_code;
long m_oldItemIndex;
long m_itemIndex;
int m_col;
wxPoint m_pointDrag;
wxListItem m_item;
+%readwrite
- int GetCode();
+ int GetKeyCode();
+ %pragma(python) addtoclass = "GetCode = GetKeyCode"
long GetIndex();
int GetColumn();
wxPoint GetPoint();
%addmethods {
%new wxListItem* GetColumn(int col) {
wxListItem item;
+ item.SetMask(0xFFFF);
if (self->GetColumn(col, item))
return new wxListItem(item);
else
return NULL;
}
- } // The OOR typemaps don't know what to do with the %new, so fix it up.
+ } // The OOR typemaps don't know what to do with the %new, so fix it up.
%pragma(python) addtoclass = "
- def GetItem(self, *_args, **_kwargs):
+ def GetColumn(self, *_args, **_kwargs):
val = apply(controls2c.wxListCtrl_GetColumn,(self,) + _args, _kwargs)
if val is not None: val.thisown = 1
return val
%pragma(python) addtoclass = "
def GetItem(self, *_args, **_kwargs):
val = apply(controls2c.wxListCtrl_GetItem,(self,) + _args, _kwargs)
- val.thisown = 1
+ if val is not None: val.thisown = 1
return val
"
return self->SortItems(wxPyListCtrl_SortItems, (long)func);
}
}
+
+
+ %addmethods {
+ wxWindow* GetMainWindow() {
+ #ifdef __WXMSW__
+ return self;
+ #else
+ return (wxWindow*)self->m_mainWin;
+ #endif
+ }
+ }
};
wxTreeItemId GetOldItem();
wxPoint GetPoint();
const wxKeyEvent& GetKeyEvent();
- int GetCode();
+ int GetKeyCode();
+ %pragma(python) addtoclass = "GetCode = GetKeyCode"
const wxString& GetLabel();
};
int rval = 0;
bool found;
wxPyBeginBlockThreads();
- if ((found = m_myInst.findCallback("OnCompareItems")))
- rval = m_myInst.callCallback(Py_BuildValue(
- "(OO)",
- wxPyConstructObject((void*)&item1, "wxTreeItemId"),
- wxPyConstructObject((void*)&item2, "wxTreeItemId")));
+ if ((found = m_myInst.findCallback("OnCompareItems"))) {
+ PyObject *o1 = wxPyConstructObject((void*)&item1, "wxTreeItemId");
+ PyObject *o2 = wxPyConstructObject((void*)&item2, "wxTreeItemId");
+ rval = m_myInst.callCallback(Py_BuildValue("(OO)",o1,o2));
+ Py_DECREF(o1);
+ Py_DECREF(o2);
+ }
wxPyEndBlockThreads();
if (! found)
rval = wxTreeCtrl::OnCompareItems(item1, item2);
size_t GetChildrenCount(const wxTreeItemId& item, bool recursively = TRUE);
- wxTreeItemId GetFirstChild(const wxTreeItemId& item, long& INOUT);
+ wxTreeItemId GetFirstChild(const wxTreeItemId& item, long& INOUT = longzero);
wxTreeItemId GetNextChild(const wxTreeItemId& item, long& INOUT);
wxTreeItemId GetNextSibling(const wxTreeItemId& item);
wxTreeItemId GetPrevSibling(const wxTreeItemId& item);