Editors, Renderers and Attrs need to have a destructor so SWIG won't
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
This commit is contained in:
@@ -104,6 +104,8 @@ typedef unsigned long wxUIntPtr;
|
|||||||
#define %disownarg(typespec) %typemap(in) typespec = SWIGTYPE* DISOWN
|
#define %disownarg(typespec) %typemap(in) typespec = SWIGTYPE* DISOWN
|
||||||
#define %cleardisown(typespec) %typemap(in) typespec
|
#define %cleardisown(typespec) %typemap(in) typespec
|
||||||
|
|
||||||
|
#define %ref %feature("ref")
|
||||||
|
#define %unref %feature("unref")
|
||||||
|
|
||||||
|
|
||||||
#ifndef %pythoncode
|
#ifndef %pythoncode
|
||||||
|
@@ -24,6 +24,7 @@
|
|||||||
%rename(GRID_MIN_ROW_HEIGHT) wxGRID_MIN_ROW_HEIGHT;
|
%rename(GRID_MIN_ROW_HEIGHT) wxGRID_MIN_ROW_HEIGHT;
|
||||||
%rename(GRID_MIN_COL_WIDTH) wxGRID_MIN_COL_WIDTH;
|
%rename(GRID_MIN_COL_WIDTH) wxGRID_MIN_COL_WIDTH;
|
||||||
%rename(GRID_DEFAULT_SCROLLBAR_WIDTH) wxGRID_DEFAULT_SCROLLBAR_WIDTH;
|
%rename(GRID_DEFAULT_SCROLLBAR_WIDTH) wxGRID_DEFAULT_SCROLLBAR_WIDTH;
|
||||||
|
%rename(GridCellWorker) wxGridCellWorker;
|
||||||
%rename(GridCellRenderer) wxGridCellRenderer;
|
%rename(GridCellRenderer) wxGridCellRenderer;
|
||||||
%rename(PyGridCellRenderer) wxPyGridCellRenderer;
|
%rename(PyGridCellRenderer) wxPyGridCellRenderer;
|
||||||
%rename(GridCellStringRenderer) wxGridCellStringRenderer;
|
%rename(GridCellStringRenderer) wxGridCellStringRenderer;
|
||||||
|
@@ -491,11 +491,14 @@ enum {
|
|||||||
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
// 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
|
class wxGridCellWorker
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
%extend {
|
%extend {
|
||||||
@@ -503,12 +506,25 @@ public:
|
|||||||
if (!self->GetClientObject())
|
if (!self->GetClientObject())
|
||||||
self->SetClientObject(new wxPyOORClientData(_self));
|
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 SetParameters(const wxString& params);
|
||||||
void IncRef();
|
void IncRef();
|
||||||
void DecRef();
|
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,
|
virtual void Draw(wxGrid& grid,
|
||||||
wxGridCellAttr& attr,
|
wxGridCellAttr& attr,
|
||||||
wxDC& dc,
|
wxDC& dc,
|
||||||
@@ -523,6 +539,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// The C++ version of wxPyGridCellRenderer
|
// The C++ version of wxPyGridCellRenderer
|
||||||
%{
|
%{
|
||||||
class wxPyGridCellRenderer : public wxGridCellRenderer
|
class wxPyGridCellRenderer : public wxGridCellRenderer
|
||||||
@@ -703,16 +720,9 @@ public:
|
|||||||
// wxGridCellEditor is an ABC, and several derived classes are available.
|
// wxGridCellEditor is an ABC, and several derived classes are available.
|
||||||
// Classes implemented in Python should be derived from wxPyGridCellEditor.
|
// Classes implemented in Python should be derived from wxPyGridCellEditor.
|
||||||
|
|
||||||
class wxGridCellEditor
|
class wxGridCellEditor : public wxGridCellWorker
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
%extend {
|
|
||||||
void _setOORInfo(PyObject* _self) {
|
|
||||||
if (!self->GetClientObject())
|
|
||||||
self->SetClientObject(new wxPyOORClientData(_self));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool IsCreated();
|
bool IsCreated();
|
||||||
wxControl* GetControl();
|
wxControl* GetControl();
|
||||||
void SetControl(wxControl* control);
|
void SetControl(wxControl* control);
|
||||||
@@ -720,10 +730,6 @@ public:
|
|||||||
wxGridCellAttr* GetCellAttr();
|
wxGridCellAttr* GetCellAttr();
|
||||||
void SetCellAttr(wxGridCellAttr* attr);
|
void SetCellAttr(wxGridCellAttr* attr);
|
||||||
|
|
||||||
void SetParameters(const wxString& params);
|
|
||||||
void IncRef();
|
|
||||||
void DecRef();
|
|
||||||
|
|
||||||
virtual void Create(wxWindow* parent,
|
virtual void Create(wxWindow* parent,
|
||||||
wxWindowID id,
|
wxWindowID id,
|
||||||
wxEvtHandler* evtHandler);
|
wxEvtHandler* evtHandler);
|
||||||
@@ -992,10 +998,19 @@ public:
|
|||||||
|
|
||||||
wxGridCellAttr(wxGridCellAttr *attrDefault = NULL);
|
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;
|
wxGridCellAttr *Clone() const;
|
||||||
void MergeWith(wxGridCellAttr *mergefrom);
|
void MergeWith(wxGridCellAttr *mergefrom);
|
||||||
|
|
||||||
void IncRef();
|
void IncRef();
|
||||||
void DecRef();
|
void DecRef();
|
||||||
|
|
||||||
void SetTextColour(const wxColour& colText);
|
void SetTextColour(const wxColour& colText);
|
||||||
void SetBackgroundColour(const wxColour& colBack);
|
void SetBackgroundColour(const wxColour& colBack);
|
||||||
void SetFont(const wxFont& font);
|
void SetFont(const wxFont& font);
|
||||||
|
@@ -40,6 +40,8 @@ wxGRID_LABEL_EDGE_ZONE = wx.grid.GRID_LABEL_EDGE_ZONE
|
|||||||
wxGRID_MIN_ROW_HEIGHT = wx.grid.GRID_MIN_ROW_HEIGHT
|
wxGRID_MIN_ROW_HEIGHT = wx.grid.GRID_MIN_ROW_HEIGHT
|
||||||
wxGRID_MIN_COL_WIDTH = wx.grid.GRID_MIN_COL_WIDTH
|
wxGRID_MIN_COL_WIDTH = wx.grid.GRID_MIN_COL_WIDTH
|
||||||
wxGRID_DEFAULT_SCROLLBAR_WIDTH = wx.grid.GRID_DEFAULT_SCROLLBAR_WIDTH
|
wxGRID_DEFAULT_SCROLLBAR_WIDTH = wx.grid.GRID_DEFAULT_SCROLLBAR_WIDTH
|
||||||
|
wxGridCellWorker = wx.grid.GridCellWorker
|
||||||
|
wxGridCellWorkerPtr = wx.grid.GridCellWorkerPtr
|
||||||
wxGridCellRenderer = wx.grid.GridCellRenderer
|
wxGridCellRenderer = wx.grid.GridCellRenderer
|
||||||
wxGridCellRendererPtr = wx.grid.GridCellRendererPtr
|
wxGridCellRendererPtr = wx.grid.GridCellRendererPtr
|
||||||
wxPyGridCellRenderer = wx.grid.PyGridCellRenderer
|
wxPyGridCellRenderer = wx.grid.PyGridCellRenderer
|
||||||
|
Reference in New Issue
Block a user