From: Jaakko Salli Date: Sat, 30 May 2009 10:49:05 +0000 (+0000) Subject: Forward-ported wxPython-bindings related cleanup from 2.9.0 branch X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/b512ed93206f70d502c52df705cad47c3ba2cc7f?ds=inline Forward-ported wxPython-bindings related cleanup from 2.9.0 branch git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60816 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/propgrid/advprops.h b/include/wx/propgrid/advprops.h index 9326cc40b9..bc8bd3e49c 100644 --- a/include/wx/propgrid/advprops.h +++ b/include/wx/propgrid/advprops.h @@ -156,7 +156,7 @@ DECLARE_VARIANT_OBJECT_EXPORTED(wxColourPropertyValue, WXDLLIMPEXP_PROPGRID) // ----------------------------------------------------------------------- // Declare part of custom colour property macro pairs. -#if wxUSE_IMAGE || defined(SWIG) +#if wxUSE_IMAGE #include "wx/image.h" #endif @@ -356,7 +356,7 @@ protected: #endif -#if wxUSE_CHOICEDLG || defined(SWIG) +#if wxUSE_CHOICEDLG /** @class wxMultiChoiceProperty @ingroup classes diff --git a/include/wx/propgrid/editors.h b/include/wx/propgrid/editors.h index dcc66671e5..cf81fcee2b 100644 --- a/include/wx/propgrid/editors.h +++ b/include/wx/propgrid/editors.h @@ -75,9 +75,7 @@ public: */ class WXDLLIMPEXP_PROPGRID wxPGEditor : public wxObject { -#ifndef SWIG DECLARE_ABSTRACT_CLASS(wxPGEditor) -#endif public: /** Constructor. */ @@ -223,9 +221,7 @@ wxPGEditor* wxPGEditor_##EDITOR = NULL; class WXDLLIMPEXP_PROPGRID wxPGTextCtrlEditor : public wxPGEditor { -#ifndef SWIG DECLARE_DYNAMIC_CLASS(wxPGTextCtrlEditor) -#endif public: wxPGTextCtrlEditor() {} virtual ~wxPGTextCtrlEditor(); @@ -270,9 +266,7 @@ public: class WXDLLIMPEXP_PROPGRID wxPGChoiceEditor : public wxPGEditor { -#ifndef SWIG DECLARE_DYNAMIC_CLASS(wxPGChoiceEditor) -#endif public: wxPGChoiceEditor() {} virtual ~wxPGChoiceEditor(); @@ -319,9 +313,7 @@ public: class WXDLLIMPEXP_PROPGRID wxPGComboBoxEditor : public wxPGChoiceEditor { -#ifndef SWIG DECLARE_DYNAMIC_CLASS(wxPGComboBoxEditor) -#endif public: wxPGComboBoxEditor() {} virtual ~wxPGComboBoxEditor(); @@ -392,9 +384,7 @@ public: // class WXDLLIMPEXP_PROPGRID wxPGCheckBoxEditor : public wxPGEditor { -#ifndef SWIG DECLARE_DYNAMIC_CLASS(wxPGCheckBoxEditor) -#endif public: wxPGCheckBoxEditor() {} virtual ~wxPGCheckBoxEditor(); @@ -456,9 +446,7 @@ public: */ class WXDLLIMPEXP_PROPGRID wxPGEditorDialogAdapter : public wxObject { -#ifndef SWIG DECLARE_ABSTRACT_CLASS(wxPGEditorDialogAdapter) -#endif public: wxPGEditorDialogAdapter() : wxObject() diff --git a/include/wx/propgrid/property.h b/include/wx/propgrid/property.h index d8dcf5363f..e84a602e38 100644 --- a/include/wx/propgrid/property.h +++ b/include/wx/propgrid/property.h @@ -2156,34 +2156,6 @@ public: */ wxPGProperty* GetPropertyByName( const wxString& name ) const; -#ifdef SWIG - %extend { - DocStr(GetClientData, - "Returns the client data object for a property", ""); - PyObject* GetClientData() { - wxPyClientData* data = (wxPyClientData*)self->GetClientObject(); - if (data) { - Py_INCREF(data->m_obj); - return data->m_obj; - } else { - Py_INCREF(Py_None); - return Py_None; - } - } - - DocStr(SetClientData, - "Associate the given client data.", ""); - void SetClientData(PyObject* clientData) { - wxPyClientData* data = new wxPyClientData(clientData); - self->SetClientObject(data); - } - } - %pythoncode { - GetClientObject = GetClientData - SetClientObject = SetClientData - } -#endif - #ifndef SWIG // Returns various display-related information for given column diff --git a/include/wx/propgrid/propgrid.h b/include/wx/propgrid/propgrid.h index 6001261918..8c49a819e1 100644 --- a/include/wx/propgrid/propgrid.h +++ b/include/wx/propgrid/propgrid.h @@ -102,6 +102,10 @@ extern WXDLLIMPEXP_PROPGRID wxPGGlobalVarsClass* wxPGGlobalVars; #define wxPGVariant_Bool(A) (A?wxPGVariant_True:wxPGVariant_False) +// When wxPG is loaded dynamically after the application is already running +// then the built-in module system won't pick this one up. Add it manually. +WXDLLIMPEXP_PROPGRID void wxPGInitResourceModule(); + #endif // !SWIG // ----------------------------------------------------------------------- diff --git a/include/wx/propgrid/props.h b/include/wx/propgrid/props.h index 93f0ed542d..5a31c34bf6 100644 --- a/include/wx/propgrid/props.h +++ b/include/wx/propgrid/props.h @@ -696,9 +696,7 @@ protected: */ class WXDLLIMPEXP_PROPGRID wxDirProperty : public wxLongStringProperty { -#ifndef SWIG DECLARE_DYNAMIC_CLASS(wxDirProperty) -#endif public: wxDirProperty( const wxString& name = wxPG_LABEL, const wxString& label = wxPG_LABEL, @@ -954,10 +952,8 @@ protected: virtual void ArraySwap( size_t first, size_t second ) = 0; private: -#ifndef SWIG DECLARE_DYNAMIC_CLASS_NO_COPY(wxArrayEditorDialog) DECLARE_EVENT_TABLE() -#endif }; // ----------------------------------------------------------------------- @@ -1004,10 +1000,8 @@ protected: virtual void ArraySwap( size_t first, size_t second ); private: -#ifndef SWIG DECLARE_DYNAMIC_CLASS_NO_COPY(wxPGArrayStringEditorDialog) DECLARE_EVENT_TABLE() -#endif }; // ----------------------------------------------------------------------- diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index f33e2c7119..5a18f55513 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -152,6 +152,15 @@ public: IMPLEMENT_DYNAMIC_CLASS(wxPGGlobalVarsClassManager, wxModule) +// When wxPG is loaded dynamically after the application is already running +// then the built-in module system won't pick this one up. Add it manually. +void wxPGInitResourceModule() +{ + wxModule* module = new wxPGGlobalVarsClassManager; + module->Init(); + wxModule::RegisterModule(module); +} + wxPGGlobalVarsClass* wxPGGlobalVars = NULL;