From 2bf5a267fad9083d7dc65ad62eaa3c81c59eee5d Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 23 Jan 2014 00:20:07 +0000 Subject: [PATCH] PR58: More fixes for Phoenix deprecations git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@75684 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- demo/AUI_DockingWindowMgr.py | 32 ++++++++++++++++---------------- demo/ColourDB.py | 2 +- demo/Grid_MegaExample.py | 2 +- demo/Main.py | 8 ++++---- demo/PropertyGrid.py | 4 ++-- demo/agw/AUI.py | 2 +- demo/agw/FlatMenu.py | 4 ++-- demo/agw/HyperTreeList.py | 4 ++-- demo/run.py | 4 ++-- 9 files changed, 31 insertions(+), 31 deletions(-) diff --git a/demo/AUI_DockingWindowMgr.py b/demo/AUI_DockingWindowMgr.py index bade3525..51bed68d 100644 --- a/demo/AUI_DockingWindowMgr.py +++ b/demo/AUI_DockingWindowMgr.py @@ -153,18 +153,18 @@ class PyAUIFrame(wx.Frame): tb1 = wx.ToolBar(self, -1, wx.DefaultPosition, wx.DefaultSize, wx.TB_FLAT | wx.TB_NODIVIDER) tb1.SetToolBitmapSize(wx.Size(48,48)) - tb1.AddLabelTool(101, "Test", wx.ArtProvider_GetBitmap(wx.ART_ERROR)) + tb1.AddLabelTool(101, "Test", wx.ArtProvider.GetBitmap(wx.ART_ERROR)) tb1.AddSeparator() - tb1.AddLabelTool(102, "Test", wx.ArtProvider_GetBitmap(wx.ART_QUESTION)) - tb1.AddLabelTool(103, "Test", wx.ArtProvider_GetBitmap(wx.ART_INFORMATION)) - tb1.AddLabelTool(103, "Test", wx.ArtProvider_GetBitmap(wx.ART_WARNING)) - tb1.AddLabelTool(103, "Test", wx.ArtProvider_GetBitmap(wx.ART_MISSING_IMAGE)) + tb1.AddLabelTool(102, "Test", wx.ArtProvider.GetBitmap(wx.ART_QUESTION)) + tb1.AddLabelTool(103, "Test", wx.ArtProvider.GetBitmap(wx.ART_INFORMATION)) + tb1.AddLabelTool(103, "Test", wx.ArtProvider.GetBitmap(wx.ART_WARNING)) + tb1.AddLabelTool(103, "Test", wx.ArtProvider.GetBitmap(wx.ART_MISSING_IMAGE)) tb1.Realize() tb2 = wx.ToolBar(self, -1, wx.DefaultPosition, wx.DefaultSize, wx.TB_FLAT | wx.TB_NODIVIDER) tb2.SetToolBitmapSize(wx.Size(16,16)) - tb2_bmp1 = wx.ArtProvider_GetBitmap(wx.ART_QUESTION, wx.ART_OTHER, wx.Size(16, 16)) + tb2_bmp1 = wx.ArtProvider.GetBitmap(wx.ART_QUESTION, wx.ART_OTHER, wx.Size(16, 16)) tb2.AddLabelTool(101, "Test", tb2_bmp1) tb2.AddLabelTool(101, "Test", tb2_bmp1) tb2.AddLabelTool(101, "Test", tb2_bmp1) @@ -182,7 +182,7 @@ class PyAUIFrame(wx.Frame): tb3 = wx.ToolBar(self, -1, wx.DefaultPosition, wx.DefaultSize, wx.TB_FLAT | wx.TB_NODIVIDER) tb3.SetToolBitmapSize(wx.Size(16,16)) - tb3_bmp1 = wx.ArtProvider_GetBitmap(wx.ART_FOLDER, wx.ART_OTHER, wx.Size(16, 16)) + tb3_bmp1 = wx.ArtProvider.GetBitmap(wx.ART_FOLDER, wx.ART_OTHER, wx.Size(16, 16)) tb3.AddLabelTool(101, "Test", tb3_bmp1) tb3.AddLabelTool(101, "Test", tb3_bmp1) tb3.AddLabelTool(101, "Test", tb3_bmp1) @@ -195,7 +195,7 @@ class PyAUIFrame(wx.Frame): tb4 = wx.ToolBar(self, -1, wx.DefaultPosition, wx.DefaultSize, wx.TB_FLAT | wx.TB_NODIVIDER | wx.TB_HORZ_TEXT) tb4.SetToolBitmapSize(wx.Size(16,16)) - tb4_bmp1 = wx.ArtProvider_GetBitmap(wx.ART_NORMAL_FILE, wx.ART_OTHER, wx.Size(16, 16)) + tb4_bmp1 = wx.ArtProvider.GetBitmap(wx.ART_NORMAL_FILE, wx.ART_OTHER, wx.Size(16, 16)) tb4.AddLabelTool(101, "Item 1", tb4_bmp1) tb4.AddLabelTool(101, "Item 2", tb4_bmp1) tb4.AddLabelTool(101, "Item 3", tb4_bmp1) @@ -210,12 +210,12 @@ class PyAUIFrame(wx.Frame): tb5 = wx.ToolBar(self, -1, wx.DefaultPosition, wx.DefaultSize, wx.TB_FLAT | wx.TB_NODIVIDER | wx.TB_VERTICAL) tb5.SetToolBitmapSize(wx.Size(48, 48)) - tb5.AddLabelTool(101, "Test", wx.ArtProvider_GetBitmap(wx.ART_ERROR)) + tb5.AddLabelTool(101, "Test", wx.ArtProvider.GetBitmap(wx.ART_ERROR)) tb5.AddSeparator() - tb5.AddLabelTool(102, "Test", wx.ArtProvider_GetBitmap(wx.ART_QUESTION)) - tb5.AddLabelTool(103, "Test", wx.ArtProvider_GetBitmap(wx.ART_INFORMATION)) - tb5.AddLabelTool(103, "Test", wx.ArtProvider_GetBitmap(wx.ART_WARNING)) - tb5.AddLabelTool(103, "Test", wx.ArtProvider_GetBitmap(wx.ART_MISSING_IMAGE)) + tb5.AddLabelTool(102, "Test", wx.ArtProvider.GetBitmap(wx.ART_QUESTION)) + tb5.AddLabelTool(103, "Test", wx.ArtProvider.GetBitmap(wx.ART_INFORMATION)) + tb5.AddLabelTool(103, "Test", wx.ArtProvider.GetBitmap(wx.ART_WARNING)) + tb5.AddLabelTool(103, "Test", wx.ArtProvider.GetBitmap(wx.ART_MISSING_IMAGE)) tb5.Realize() # add a bunch of panes @@ -687,8 +687,8 @@ class PyAUIFrame(wx.Frame): items = [] imglist = wx.ImageList(16, 16, True, 2) - imglist.Add(wx.ArtProvider_GetBitmap(wx.ART_FOLDER, wx.ART_OTHER, wx.Size(16,16))) - imglist.Add(wx.ArtProvider_GetBitmap(wx.ART_NORMAL_FILE, wx.ART_OTHER, wx.Size(16,16))) + imglist.Add(wx.ArtProvider.GetBitmap(wx.ART_FOLDER, wx.ART_OTHER, wx.Size(16,16))) + imglist.Add(wx.ArtProvider.GetBitmap(wx.ART_NORMAL_FILE, wx.ART_OTHER, wx.Size(16,16))) tree.AssignImageList(imglist) items.append(tree.AppendItem(root, "Item 1", 0)) @@ -985,7 +985,7 @@ class SettingsPanel(wx.Panel): def CreateColorBitmap(self, c): - image = wx.EmptyImage(25, 14) + image = wx.Image(25, 14) for x in xrange(25): for y in xrange(14): diff --git a/demo/ColourDB.py b/demo/ColourDB.py index e0e72be2..58f45b0f 100644 --- a/demo/ColourDB.py +++ b/demo/ColourDB.py @@ -84,7 +84,7 @@ class TestWindow(wx.ScrolledWindow): if not dc: dc = wx.ClientDC(self) rect = self.GetUpdateRegion().GetBox() - dc.SetClippingRect(rect) + dc.SetClippingRegion(rect) self.TileBackground(dc) diff --git a/demo/Grid_MegaExample.py b/demo/Grid_MegaExample.py index 1d1ccf3c..558349db 100644 --- a/demo/Grid_MegaExample.py +++ b/demo/Grid_MegaExample.py @@ -253,7 +253,7 @@ class MegaFontRenderer(Grid.GridCellRenderer): # and colors. We have to set the clipping region on # the grid's DC, otherwise the text will spill over # to the next cell - dc.SetClippingRect(rect) + dc.SetClippingRegion(rect) # clear the background dc.SetBackgroundMode(wx.SOLID) diff --git a/demo/Main.py b/demo/Main.py index a94c60ce..23b93e1b 100644 --- a/demo/Main.py +++ b/demo/Main.py @@ -1798,14 +1798,14 @@ class wxPythonDemo(wx.Frame): self.log.MacCheckSpelling(False) # Set the wxWindows log target to be this textctrl - #wx.Log_SetActiveTarget(wx.LogTextCtrl(self.log)) + #wx.Log.SetActiveTarget(wx.LogTextCtrl(self.log)) # But instead of the above we want to show how to use our own wx.Log class wx.Log.SetActiveTarget(MyLog(self.log)) # for serious debugging - #wx.Log_SetActiveTarget(wx.LogStderr()) - #wx.Log_SetTraceMask(wx.TraceMessages) + #wx.Log.SetActiveTarget(wx.LogStderr()) + #wx.Log.SetTraceMask(wx.TraceMessages) self.Bind(wx.EVT_ACTIVATE, self.OnActivate) wx.GetApp().Bind(wx.EVT_ACTIVATE_APP, self.OnAppActivate) @@ -2581,7 +2581,7 @@ class wxPythonDemo(wx.Frame): "Load user perspective %d"%(len(self.auiConfigurations)+1), wx.ITEM_RADIO) self.Bind(wx.EVT_MENU, self.OnAUIPerspectives, item) - self.perspectives_menu.AppendItem(item) + self.perspectives_menu.Append(item) item.Check(True) self.auiConfigurations.update({dlg.GetValue(): self.mgr.SavePerspective()}) diff --git a/demo/PropertyGrid.py b/demo/PropertyGrid.py index 3d5928d7..dd77a053 100644 --- a/demo/PropertyGrid.py +++ b/demo/PropertyGrid.py @@ -543,7 +543,7 @@ class LargeImagePickerCtrl(wx.Panel): image = wx.Image(path) image.Rescale(64, 64) - self.bmp = wx.BitmapFromImage(image) + self.bmp = wx.Bitmap(image) def SetProperty(self, property): self.property = property @@ -739,7 +739,7 @@ class TestPanel( wx.Panel ): "Text Not in List") ) pg.Append( wxpg.PropertyCategory("3 - Advanced Properties") ) - pg.Append( wxpg.DateProperty("Date",value=wx.DateTime_Now()) ) + pg.Append( wxpg.DateProperty("Date",value=wx.DateTime.Now()) ) pg.Append( wxpg.FontProperty("Font",value=panel.GetFont()) ) pg.Append( wxpg.ColourProperty("Colour", value=panel.GetBackgroundColour()) ) diff --git a/demo/agw/AUI.py b/demo/agw/AUI.py index 22f3db5f..ba9a673f 100644 --- a/demo/agw/AUI.py +++ b/demo/agw/AUI.py @@ -1597,7 +1597,7 @@ class AuiFrame(wx.Frame): for pane in panes: if checked: randimage = random.randint(0, len(ArtIDs) - 1) - bmp = wx.ArtProvider_GetBitmap(eval(ArtIDs[randimage]), wx.ART_OTHER, (16, 16)) + bmp = wx.ArtProvider.GetBitmap(eval(ArtIDs[randimage]), wx.ART_OTHER, (16, 16)) else: bmp = None diff --git a/demo/agw/FlatMenu.py b/demo/agw/FlatMenu.py index 9be7f457..6b8d307d 100644 --- a/demo/agw/FlatMenu.py +++ b/demo/agw/FlatMenu.py @@ -145,7 +145,7 @@ class FM_MyRenderer(FM.FMRenderer): dc.SetPen(wx.Pen(endColour)) dc.SetBrush(wx.Brush(endColour)) - dc.DrawRectangleRect(rect) + dc.DrawRectangle(rect) def DrawToolBarBg(self, dc, rect): @@ -775,7 +775,7 @@ class FlatMenuDemo(wx.Frame): def OnFileOpenDialog(self, evt): dlg = wx.FileDialog(self, defaultDir = os.getcwd(), - wildcard = "All Files|*", style = wx.OPEN | wx.CHANGE_DIR) + wildcard = "All Files|*", style = wx.FD_OPEN | wx.FD_CHANGE_DIR) if dlg.ShowModal() == wx.ID_OK: path = dlg.GetPath() diff --git a/demo/agw/HyperTreeList.py b/demo/agw/HyperTreeList.py index 221b24e2..e1bfe95f 100644 --- a/demo/agw/HyperTreeList.py +++ b/demo/agw/HyperTreeList.py @@ -890,7 +890,7 @@ class HyperTreeHeaderRenderer(object): """ # determine if the string can fit inside the current width - w, h, dummy = dc.GetMultiLineTextExtent(text) + w, h, dummy = dc.GetFullMultiLineTextExtent(text) width = rect.width if w <= width: @@ -982,7 +982,7 @@ class HyperTreeHeaderRenderer(object): dc.SetTextForeground(text_color) # Determine the width of the text - wLabel, hLabel, dummy = dc.GetMultiLineTextExtent(text) + wLabel, hLabel, dummy = dc.GetFullMultiLineTextExtent(text) wLabel += 4 # 2 pixel margin either side # and the width of the icon, if any diff --git a/demo/run.py b/demo/run.py index f80a922a..dbc42bfa 100755 --- a/demo/run.py +++ b/demo/run.py @@ -98,8 +98,8 @@ class RunDemoApp(wx.App, wx.lib.mixins.inspection.InspectionMixin): self.SetTopWindow(frame) self.frame = frame - #wx.Log_SetActiveTarget(wx.LogStderr()) - #wx.Log_SetTraceMask(wx.TraceMessages) + #wx.Log.SetActiveTarget(wx.LogStderr()) + #wx.Log.SetTraceMask(wx.TraceMessages) if self.useShell: # Make a PyShell window, and position it below our test window