From: Robin Dunn Date: Fri, 14 Sep 2001 16:14:56 +0000 (+0000) Subject: A better way to handle the OOR wxPyListCtrl --> wxLIstCtrl thing X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/a3fbed81b2165fddbbf2ee7eddd6089b62db3692 A better way to handle the OOR wxPyListCtrl --> wxLIstCtrl thing git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11601 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/wxPython/src/_extras.py b/wxPython/src/_extras.py index 48bdc72a0d..01c385eeb5 100644 --- a/wxPython/src/_extras.py +++ b/wxPython/src/_extras.py @@ -580,11 +580,6 @@ NULL = None # For backwards compatibility only. You should really be wxColor = wxColour wxNamedColor = wxNamedColour -wxPyListCtrlPtr = wxListCtrlPtr -wxPyTreeCtrlPtr = wxTreeCtrlPtr -wxGenericDragImagePtr = wxDragImagePtr -wxPyProcessPtr = wxProcessPtr - # backwards compatibility wxNoRefBitmap = wxBitmap @@ -592,6 +587,7 @@ wxPyDefaultPosition = wxDefaultPosition wxPyDefaultSize = wxDefaultSize +#---------------------------------------------------------------------- # wxGTK sets the locale when initialized. Doing this at the Python # level should set it up to match what GTK is doing at the C level. try: @@ -601,6 +597,19 @@ except: pass + +#---------------------------------------------------------------------- +# wxWindows version numbers. wxPython version is in __version__. + +wxMAJOR_VERSION = wxc.wxMAJOR_VERSION +wxMINOR_VERSION = wxc.wxMINOR_VERSION +wxRELEASE_NUMBER = wxc.wxRELEASE_NUMBER +wxVERSION_STRING = wxc.wxVERSION_STRING +wxVERSION_NUMBER = wxc.wxVERSION_NUMBER + +wxVERSION = (wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER) + + #---------------------------------------------------------------------- # This helper function will take a wxPython object and convert it to # another wxPython object type. This will not be able to create objects diff --git a/wxPython/src/_htmlextras.py b/wxPython/src/_htmlextras.py index 0428033548..88f8b12ba6 100644 --- a/wxPython/src/_htmlextras.py +++ b/wxPython/src/_htmlextras.py @@ -12,6 +12,3 @@ wx.wxHtmlWidgetCellPtr = wxHtmlWidgetCellPtr wx.wxHtmlWindowPtr = wxHtmlWindowPtr wx.wxHtmlLinkInfoPtr = wxHtmlLinkInfoPtr -wx.wxPyHtmlTagHandlerPtr = wxHtmlTagHandlerPtr -wx.wxPyHtmlWinTagHandlerPtr = wxHtmlWinTagHandlerPtr -wx.wxPyHtmlWindowPtr = wxHtmlWindowPtr diff --git a/wxPython/src/controls2.i b/wxPython/src/controls2.i index 5d4c15d07e..f13ab3524b 100644 --- a/wxPython/src/controls2.i +++ b/wxPython/src/controls2.i @@ -1272,8 +1272,10 @@ public: //---------------------------------------------------------------------- %init %{ + // Map renamed classes back to their common name for OOR wxPyPtrTypeMap_Add("wxTreeItemData", "wxPyTreeItemData"); wxPyPtrTypeMap_Add("wxTreeCtrl", "wxPyTreeCtrl"); + wxPyPtrTypeMap_Add("wxListCtrl", "wxPyListCtrl"); %} //---------------------------------------------------------------------- diff --git a/wxPython/src/msw/controls2.cpp b/wxPython/src/msw/controls2.cpp index d524e6a981..4ab402f7d9 100644 --- a/wxPython/src/msw/controls2.cpp +++ b/wxPython/src/msw/controls2.cpp @@ -10183,8 +10183,10 @@ SWIGEXPORT(void) initcontrols2c() { PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK", PyInt_FromLong((long) wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK)); PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_END_DRAG", PyInt_FromLong((long) wxEVT_COMMAND_TREE_END_DRAG)); + // Map renamed classes back to their common name for OOR wxPyPtrTypeMap_Add("wxTreeItemData", "wxPyTreeItemData"); wxPyPtrTypeMap_Add("wxTreeCtrl", "wxPyTreeCtrl"); + wxPyPtrTypeMap_Add("wxListCtrl", "wxPyListCtrl"); { int i; for (i = 0; _swig_mapping[i].n1; i++) diff --git a/wxPython/src/msw/html.py b/wxPython/src/msw/html.py index fef3a04ba2..9f06c597e8 100644 --- a/wxPython/src/msw/html.py +++ b/wxPython/src/msw/html.py @@ -757,6 +757,3 @@ wx.wxHtmlWidgetCellPtr = wxHtmlWidgetCellPtr wx.wxHtmlWindowPtr = wxHtmlWindowPtr wx.wxHtmlLinkInfoPtr = wxHtmlLinkInfoPtr -wx.wxPyHtmlTagHandlerPtr = wxHtmlTagHandlerPtr -wx.wxPyHtmlWinTagHandlerPtr = wxHtmlWinTagHandlerPtr -wx.wxPyHtmlWindowPtr = wxHtmlWindowPtr diff --git a/wxPython/src/msw/wx.cpp b/wxPython/src/msw/wx.cpp index 0ffb2560bd..2f83d89d75 100644 --- a/wxPython/src/msw/wx.cpp +++ b/wxPython/src/msw/wx.cpp @@ -2582,6 +2582,14 @@ SWIGEXPORT(void) initwxc() { initstreamsc(); initfilesysc(); + + PyDict_SetItemString(d,"wxMAJOR_VERSION", PyInt_FromLong((long)wxMAJOR_VERSION )); + PyDict_SetItemString(d,"wxMINOR_VERSION", PyInt_FromLong((long)wxMINOR_VERSION )); + PyDict_SetItemString(d,"wxRELEASE_NUMBER", PyInt_FromLong((long)wxRELEASE_NUMBER )); + PyDict_SetItemString(d,"wxVERSION_NUMBER", PyInt_FromLong((long)wxVERSION_NUMBER )); + PyDict_SetItemString(d,"wxVERSION_STRING", PyString_FromString(wxVERSION_STRING)); + + { int i; for (i = 0; _swig_mapping[i].n1; i++) diff --git a/wxPython/src/msw/wx.py b/wxPython/src/msw/wx.py index be6a63ccaa..39b9db97e5 100644 --- a/wxPython/src/msw/wx.py +++ b/wxPython/src/msw/wx.py @@ -1400,11 +1400,6 @@ NULL = None # For backwards compatibility only. You should really be wxColor = wxColour wxNamedColor = wxNamedColour -wxPyListCtrlPtr = wxListCtrlPtr -wxPyTreeCtrlPtr = wxTreeCtrlPtr -wxGenericDragImagePtr = wxDragImagePtr -wxPyProcessPtr = wxProcessPtr - # backwards compatibility wxNoRefBitmap = wxBitmap @@ -1412,6 +1407,7 @@ wxPyDefaultPosition = wxDefaultPosition wxPyDefaultSize = wxDefaultSize +#---------------------------------------------------------------------- # wxGTK sets the locale when initialized. Doing this at the Python # level should set it up to match what GTK is doing at the C level. try: @@ -1421,6 +1417,19 @@ except: pass + +#---------------------------------------------------------------------- +# wxWindows version numbers. wxPython version is in __version__. + +wxMAJOR_VERSION = wxc.wxMAJOR_VERSION +wxMINOR_VERSION = wxc.wxMINOR_VERSION +wxRELEASE_NUMBER = wxc.wxRELEASE_NUMBER +wxVERSION_STRING = wxc.wxVERSION_STRING +wxVERSION_NUMBER = wxc.wxVERSION_NUMBER + +wxVERSION = (wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER) + + #---------------------------------------------------------------------- # This helper function will take a wxPython object and convert it to # another wxPython object type. This will not be able to create objects diff --git a/wxPython/src/wx.i b/wxPython/src/wx.i index 30dcfe2d2b..da1553eb92 100644 --- a/wxPython/src/wx.i +++ b/wxPython/src/wx.i @@ -231,6 +231,14 @@ static wxPyCoreAPI API = { initstreamsc(); initfilesysc(); + + PyDict_SetItemString(d,"wxMAJOR_VERSION", PyInt_FromLong((long)wxMAJOR_VERSION )); + PyDict_SetItemString(d,"wxMINOR_VERSION", PyInt_FromLong((long)wxMINOR_VERSION )); + PyDict_SetItemString(d,"wxRELEASE_NUMBER", PyInt_FromLong((long)wxRELEASE_NUMBER )); + PyDict_SetItemString(d,"wxVERSION_NUMBER", PyInt_FromLong((long)wxVERSION_NUMBER )); + PyDict_SetItemString(d,"wxVERSION_STRING", PyString_FromString(wxVERSION_STRING)); + + %} //----------------------------------------------------------------------