Since they're now raising DeprecationWarnings in 4.0.2 we can drop some method compatibility wrappers here.

This commit is contained in:
Robin Dunn
2018-02-20 00:20:56 -08:00
parent 4b5439db5b
commit 38624123f5
10 changed files with 15 additions and 20 deletions

View File

@@ -29,7 +29,11 @@ New and improved stuff in this release:
Other changes in this release:
*
* Many of the deprecated items in wxWidgets and wxPython are being or have
been removed. Be sure to test your code in 4.0.2 or a later 4.0.x release
with warnings enabled so you can see which class, method or function calls
you need to change.

View File

@@ -815,7 +815,7 @@
"DirProperty":"wx.propgrid.",
"DirSelector":"wx.",
"DirSelectorPromptStr":"wx.",
"Direction":"wx.",
"Direction":"wx.DataObject.",
"DisableAsserts":"wx.",
"Display":"wx.",
"DisplayChangedEvent":"wx.",

View File

@@ -49,8 +49,8 @@ def run():
c.find('GetBitmap').mustHaveApp()
c.find('GetIcon').mustHaveApp()
# deprecated and removed
c.find('Insert').ignore()
c.addPyCode("ArtProvider.Insert = wx.deprecated(ArtProvider.PushBack, 'Use ArtProvider.PushBack instead')")
# Change the types of the art constants from wxString to const char*
# since that is what they really are.

View File

@@ -60,11 +60,9 @@ def run():
c.find('SetSelection.from').name = 'frm'
# deprecated and removed
c.find('GetTextIndent').ignore()
c.find('SetTextIndent').ignore()
c.addPyCode("ComboCtrl.GetTextIndent = wx.deprecated(ComboCtrl.GetMargins, 'Use GetMargins instead.')")
c.addPyCode("ComboCtrl.SetTextIndent = wx.deprecated(ComboCtrl.SetMargins, 'Use SetMargins instead.')")
#-----------------------------------------------------------------
tools.doCommonTweaks(module)

View File

@@ -577,8 +577,9 @@ def run():
#---------------------------------------
# wxIconizeEvent
c = module.find('wxIconizeEvent')
# deprecated and removed
c.find('Iconized').ignore()
c.addPyCode("IconizeEvent.Iconized = wx.deprecated(IconizeEvent.IsIconized, 'Use IsIconized instead')")

View File

@@ -170,10 +170,9 @@ def run():
c.addPyProperty('Menus GetMenus SetMenus')
# deprecated and removed
c.find('GetLabelTop').ignore()
c.find('SetLabelTop').ignore()
c.addPyCode("MenuBar.GetLabelTop = wx.deprecated(MenuBar.GetMenuLabelText, 'Use GetMenuLabelText instead')")
c.addPyCode("MenuBar.SetLabelTop = wx.deprecated(MenuBar.SetMenuLabel, 'Use SetMenuLabel instead')")
module.addItem(tools.wxListWrapperTemplate('wxMenuList', 'wxMenu', module))

View File

@@ -38,18 +38,13 @@ def run():
c.find('SetSubMenu.menu').transfer = True
# deprecated and removed
c.find('GetLabel').ignore()
c.find('GetName').ignore()
c.find('GetText').ignore()
c.find('SetText').ignore()
c.find('GetLabelFromText').ignore()
c.addPyCode("MenuItem.GetLabel = wx.deprecated(MenuItem.GetItemLabelText, 'Use GetItemLabelText instead')")
c.addPyCode("MenuItem.GetName = wx.deprecated(MenuItem.GetItemLabelText, 'Use GetItemLabelText instead')")
c.addPyCode("MenuItem.GetText = wx.deprecated(MenuItem.GetItemLabel, 'Use GetItemLabel instead')")
c.addPyCode("MenuItem.SetText = wx.deprecated(MenuItem.SetItemLabel, 'Use SetItemLabel instead')")
c.addPyCode("MenuItem.GetLabelFromText = wx.deprecated(MenuItem.GetLabelText, 'Use GetLabelText instead')")
# These are MSW only. Make them be empty stubs for the other ports
c.find('GetBackgroundColour').type = 'wxColour*'

View File

@@ -135,11 +135,9 @@ def run():
c.find('GetEditorDialog').factory = True
# deprecated and removed
c.find('AddChild').ignore()
c.find('GetValueString').ignore()
c.addPyCode("PGProperty.AddChild = wx.deprecated(PGProperty.AddPrivateChild, 'Use AddPrivateChild instead')")
c.addPyCode("PGProperty.GetValueString = wx.deprecated(PGProperty.GetValueAsString, 'Use GetValueAsString instead')")
#---------------------------------------------------------

View File

@@ -94,8 +94,8 @@ def run():
# Needs wxWin 2.6 compatibility
c.find('Remove').findOverload('(wxWindow *window)').ignore()
# deprecated and removed
c.find('SetVirtualSizeHints').ignore()
c.addPyCode("Sizer.SetVirtualSizeHints = wx.deprecated(Sizer.FitInside, 'Use FitInside instead')")
c.addPyMethod('AddMany', '(self, items)',
doc="""\

View File

@@ -63,8 +63,8 @@ def run():
module.find('wxSetDisplayName').ignore()
module.find('wxPostDelete').ignore()
# deprecated and removed
module.find('wxUsleep').ignore()
module.addPyCode("Usleep = deprecated(MilliSleep, 'Use MilliSleep instead.')")
# ignore all the environment related functions