From: Robin Dunn Date: Mon, 3 Dec 2001 18:17:43 +0000 (+0000) Subject: Removed m_clientData and related methods as it's now handled by the X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/1dc302a8ae2b0e74197723f08a76b883ea9c2c3b?ds=sidebyside Removed m_clientData and related methods as it's now handled by the wxClientDataContainer mixin. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12842 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/contrib/include/wx/ogl/basic.h b/contrib/include/wx/ogl/basic.h index 1127a23ef2..1288c3c057 100644 --- a/contrib/include/wx/ogl/basic.h +++ b/contrib/include/wx/ogl/basic.h @@ -299,8 +299,6 @@ class wxShape: public wxShapeEvtHandler void SetPen(wxPen *pen); void SetBrush(wxBrush *brush); - inline void SetClientData(wxObject *client_data) { m_clientData = client_data; }; - inline wxObject *GetClientData() const { return m_clientData; }; virtual void Show(bool show); virtual bool IsShown() const { return m_visible; } @@ -520,9 +518,6 @@ class wxShape: public wxShapeEvtHandler wxBrush GetBackgroundBrush(); - private: - wxObject* m_clientData; - protected: wxShapeEvtHandler* m_eventHandler; bool m_formatted; diff --git a/contrib/src/ogl/basic.cpp b/contrib/src/ogl/basic.cpp index 29e50b9c93..b7cce422e4 100644 --- a/contrib/src/ogl/basic.cpp +++ b/contrib/src/ogl/basic.cpp @@ -288,7 +288,6 @@ wxShape::wxShape(wxShapeCanvas *can) m_textColour = wxBLACK; m_textColourName = "BLACK"; m_visible = FALSE; - m_clientData = NULL; m_selected = FALSE; m_attachmentMode = ATTACHMENT_MODE_NONE; m_spaceAttachments = TRUE; @@ -338,11 +337,6 @@ wxShape::~wxShape() if (m_canvas) m_canvas->RemoveShape(this); - if (m_clientData) { - delete m_clientData; - m_clientData = NULL; - } - GetEventHandler()->OnDelete(); } diff --git a/wxPython/contrib/ogl/oglbasic.i b/wxPython/contrib/ogl/oglbasic.i index 7e982eeb31..c1f6c83014 100644 --- a/wxPython/contrib/ogl/oglbasic.i +++ b/wxPython/contrib/ogl/oglbasic.i @@ -240,25 +240,17 @@ public: // void SetClientData(wxObject *client_data); // wxObject *GetClientData(); - %addmethods { - void SetClientData(PyObject* userData) { - wxPyUserData* data = NULL; - if (userData) - data = new wxPyUserData(userData); - self->SetClientData(data); - } - PyObject* GetClientData() { - wxPyUserData* data = (wxPyUserData*)self->GetClientData(); - if (data) { - Py_INCREF(data->m_obj); - return data->m_obj; - } else { - Py_INCREF(Py_None); - return Py_None; - } - } - } + // The real client data methods are being used for OOR, so just fake it. + %pragma(python) addtoclass = " + def SetClientData(self, data): + self.clientData = data + def GetClientData(self): + if hasattr(self, 'clientData'): + return self.clientData + else: + return None +" void Show(bool show); bool IsShown();