%{
#include <wx/listctrl.h>
-
- const wxChar* wxListCtrlNameStr = _T("wxListCtrl");
- DECLARE_DEF_STRING(ListCtrlNameStr);
%}
+MAKE_CONST_WXSTRING2(ListCtrlNameStr, _T("wxListCtrl"));
+
//---------------------------------------------------------------------------
%newgroup
long GetIndex();
int GetColumn();
wxPoint GetPoint();
- %pythoncode { GetPostiion = GetPoint }
+ %pythoncode { GetPosition = GetPoint }
const wxString& GetLabel();
const wxString& GetText();
int GetImage();
static int wxCALLBACK wxPyListCtrl_SortItems(long item1, long item2, long funcPtr) {
int retval = 0;
PyObject* func = (PyObject*)funcPtr;
- wxPyBeginBlockThreads();
+ bool blocked = wxPyBeginBlockThreads();
PyObject* args = Py_BuildValue("(ii)", item1, item2);
PyObject* result = PyEval_CallObject(func, args);
Py_DECREF(result);
}
- wxPyEndBlockThreads();
+ wxPyEndBlockThreads(blocked);
return retval;
}
%}
+MustHaveApp(wxPyListCtrl);
+
%name(ListCtrl)class wxPyListCtrl : public wxControl {
public:
- %addtofunc wxPyListCtrl "self._setOORInfo(self);self._setCallbackInfo(self, ListCtrl)"
- %addtofunc wxPyListCtrl() ""
+ %pythonAppend wxPyListCtrl "self._setOORInfo(self);self._setCallbackInfo(self, ListCtrl)"
+ %pythonAppend wxPyListCtrl() ""
wxPyListCtrl(wxWindow* parent, wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
bool SetBackgroundColour(const wxColour& col);
// Gets information about this column
- %addtofunc GetColumn "if val is not None: val.thisown = 1"; // %newobject doesn't work with OOR typemap
+ %pythonAppend GetColumn "if val is not None: val.thisown = 1"; // %newobject doesn't work with OOR typemap
%extend {
wxListItem* GetColumn(int col) {
wxListItem item;
#endif
// Gets information about the item
- %addtofunc GetItem "if val is not None: val.thisown = 1"; // %newobject doesn't work with OOR typemap
+ %pythonAppend GetItem "if val is not None: val.thisown = 1"; // %newobject doesn't work with OOR typemap
%extend {
wxListItem* GetItem(long itemId, int col=0) {
wxListItem* info = new wxListItem;
// is there a way to tell SWIG to disown this???
- %addtofunc AssignImageList "args[1].thisown = 0";
+ %apply SWIGTYPE *DISOWN { wxImageList *imageList };
void AssignImageList(wxImageList *imageList, int which);
-
+ %clear wxImageList *imageList;
+
+ // are we in report mode?
+ bool InReportView() const;
+
// returns True if it is a virtual list control
bool IsVirtual() const;
DocDeclAStr(
long, HitTest(const wxPoint& point, int& OUTPUT),
"HitTest(Point point) -> (item, where)",
- "Determines which item (if any) is at the specified point,\n"
- "giving details in the second return value (see wxLIST_HITTEST_... flags.)");
+ "Determines which item (if any) is at the specified point, giving
+details in the second return value (see wxLIST_HITTEST_... flags.)", "");
// Inserts an item, returning the index of the new item if successful,
// -1 otherwise.
#endif
}
}
+
+ static wxVisualAttributes
+ GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
};
%newgroup
+MustHaveApp(wxListView);
+
// wxListView: a class which provides a little better API for list control
class wxListView : public wxPyListCtrl
{
public:
- %addtofunc wxListView "self._setOORInfo(self)"
- %addtofunc wxListView() ""
+ %pythonAppend wxListView "self._setOORInfo(self)"
+ %pythonAppend wxListView() ""
wxListView( wxWindow *parent,
wxWindowID id = -1,