PR58: More fixes for Phoenix deprecations

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@75684 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2014-01-23 00:20:07 +00:00
parent ea181b5b72
commit 2bf5a267fa
9 changed files with 31 additions and 31 deletions

View File

@@ -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):

View File

@@ -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)

View File

@@ -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)

View File

@@ -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()})

View File

@@ -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()) )

View File

@@ -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

View File

@@ -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()

View File

@@ -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

View File

@@ -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