complain about it, but since they are protected in C++ we need to give
them a dummy one. In the future these shoud be changed to use
%ref/%unref and let SWIG manage the refcount for us.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38226
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
#define %disownarg(typespec) %typemap(in) typespec = SWIGTYPE* DISOWN
#define %cleardisown(typespec) %typemap(in) typespec
#define %disownarg(typespec) %typemap(in) typespec = SWIGTYPE* DISOWN
#define %cleardisown(typespec) %typemap(in) typespec
+#define %ref %feature("ref")
+#define %unref %feature("unref")
%rename(GRID_MIN_ROW_HEIGHT) wxGRID_MIN_ROW_HEIGHT;
%rename(GRID_MIN_COL_WIDTH) wxGRID_MIN_COL_WIDTH;
%rename(GRID_DEFAULT_SCROLLBAR_WIDTH) wxGRID_DEFAULT_SCROLLBAR_WIDTH;
%rename(GRID_MIN_ROW_HEIGHT) wxGRID_MIN_ROW_HEIGHT;
%rename(GRID_MIN_COL_WIDTH) wxGRID_MIN_COL_WIDTH;
%rename(GRID_DEFAULT_SCROLLBAR_WIDTH) wxGRID_DEFAULT_SCROLLBAR_WIDTH;
+%rename(GridCellWorker) wxGridCellWorker;
%rename(GridCellRenderer) wxGridCellRenderer;
%rename(PyGridCellRenderer) wxPyGridCellRenderer;
%rename(GridCellStringRenderer) wxGridCellStringRenderer;
%rename(GridCellRenderer) wxGridCellRenderer;
%rename(PyGridCellRenderer) wxPyGridCellRenderer;
%rename(GridCellStringRenderer) wxGridCellStringRenderer;
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
-// wxGridCellRenderer is an ABC, and several derived classes are available.
-// Classes implemented in Python should be derived from wxPyGridCellRenderer.
+// TODO: Use these to have SWIG automatically handle the IncRef/DecRef calls:
+//
+// %ref wxGridCellWorker "$this->IncRef();";
+// %unref wxGridCellWorker "$this->DecRef();";
+//
-class wxGridCellRenderer
if (!self->GetClientObject())
self->SetClientObject(new wxPyOORClientData(_self));
}
if (!self->GetClientObject())
self->SetClientObject(new wxPyOORClientData(_self));
}
+
+ // A dummy dtor to shut up SWIG. (The real one is protected and can
+ // only be called by DecRef)
+ ~wxGridCellWorker() {
+ }
}
void SetParameters(const wxString& params);
void IncRef();
void DecRef();
}
void SetParameters(const wxString& params);
void IncRef();
void DecRef();
+// wxGridCellRenderer is an ABC, and several derived classes are available.
+// Classes implemented in Python should be derived from wxPyGridCellRenderer.
+
+class wxGridCellRenderer : public wxGridCellWorker
+{
virtual void Draw(wxGrid& grid,
wxGridCellAttr& attr,
wxDC& dc,
virtual void Draw(wxGrid& grid,
wxGridCellAttr& attr,
wxDC& dc,
// The C++ version of wxPyGridCellRenderer
%{
class wxPyGridCellRenderer : public wxGridCellRenderer
// The C++ version of wxPyGridCellRenderer
%{
class wxPyGridCellRenderer : public wxGridCellRenderer
// wxGridCellEditor is an ABC, and several derived classes are available.
// Classes implemented in Python should be derived from wxPyGridCellEditor.
// wxGridCellEditor is an ABC, and several derived classes are available.
// Classes implemented in Python should be derived from wxPyGridCellEditor.
+class wxGridCellEditor : public wxGridCellWorker
- %extend {
- void _setOORInfo(PyObject* _self) {
- if (!self->GetClientObject())
- self->SetClientObject(new wxPyOORClientData(_self));
- }
- }
-
bool IsCreated();
wxControl* GetControl();
void SetControl(wxControl* control);
bool IsCreated();
wxControl* GetControl();
void SetControl(wxControl* control);
wxGridCellAttr* GetCellAttr();
void SetCellAttr(wxGridCellAttr* attr);
wxGridCellAttr* GetCellAttr();
void SetCellAttr(wxGridCellAttr* attr);
- void SetParameters(const wxString& params);
- void IncRef();
- void DecRef();
-
virtual void Create(wxWindow* parent,
wxWindowID id,
wxEvtHandler* evtHandler);
virtual void Create(wxWindow* parent,
wxWindowID id,
wxEvtHandler* evtHandler);
%pythonAppend wxGridCellAttr "self._setOORInfo(self)"
wxGridCellAttr(wxGridCellAttr *attrDefault = NULL);
%pythonAppend wxGridCellAttr "self._setOORInfo(self)"
wxGridCellAttr(wxGridCellAttr *attrDefault = NULL);
+
+ %extend {
+ // A dummy dtor to shut up SWIG. (The real one is protected and can
+ // only be called by DecRef)
+ ~wxGridCellAttr() {
+ }
+ }
wxGridCellAttr *Clone() const;
void MergeWith(wxGridCellAttr *mergefrom);
wxGridCellAttr *Clone() const;
void MergeWith(wxGridCellAttr *mergefrom);
void IncRef();
void DecRef();
void IncRef();
void DecRef();
void SetTextColour(const wxColour& colText);
void SetBackgroundColour(const wxColour& colBack);
void SetFont(const wxFont& font);
void SetTextColour(const wxColour& colText);
void SetBackgroundColour(const wxColour& colBack);
void SetFont(const wxFont& font);
void _setCallbackInfo(PyObject* self, PyObject* _class);
wxGridCellAttr *GetAttr(int row, int col,
void _setCallbackInfo(PyObject* self, PyObject* _class);
wxGridCellAttr *GetAttr(int row, int col,
- wxGridCellAttr::wxAttrKind kind);
+ wxGridCellAttr::wxAttrKind kind);
void SetAttr(wxGridCellAttr *attr, int row, int col);
void SetRowAttr(wxGridCellAttr *attr, int row);
void SetColAttr(wxGridCellAttr *attr, int col);
void SetAttr(wxGridCellAttr *attr, int row, int col);
void SetRowAttr(wxGridCellAttr *attr, int row);
void SetColAttr(wxGridCellAttr *attr, int col);
wxGRID_MIN_ROW_HEIGHT = wx.grid.GRID_MIN_ROW_HEIGHT
wxGRID_MIN_COL_WIDTH = wx.grid.GRID_MIN_COL_WIDTH
wxGRID_DEFAULT_SCROLLBAR_WIDTH = wx.grid.GRID_DEFAULT_SCROLLBAR_WIDTH
wxGRID_MIN_ROW_HEIGHT = wx.grid.GRID_MIN_ROW_HEIGHT
wxGRID_MIN_COL_WIDTH = wx.grid.GRID_MIN_COL_WIDTH
wxGRID_DEFAULT_SCROLLBAR_WIDTH = wx.grid.GRID_DEFAULT_SCROLLBAR_WIDTH
+wxGridCellWorker = wx.grid.GridCellWorker
+wxGridCellWorkerPtr = wx.grid.GridCellWorkerPtr
wxGridCellRenderer = wx.grid.GridCellRenderer
wxGridCellRendererPtr = wx.grid.GridCellRendererPtr
wxPyGridCellRenderer = wx.grid.PyGridCellRenderer
wxGridCellRenderer = wx.grid.GridCellRenderer
wxGridCellRendererPtr = wx.grid.GridCellRendererPtr
wxPyGridCellRenderer = wx.grid.PyGridCellRenderer