Fix deprecated class usage and function calls.

This commit is contained in:
Thomas Fleming 2018-11-09 22:17:39 +00:00 committed by Cas Cremers
parent 92aa826bf3
commit 44e5e340be
2 changed files with 7 additions and 9 deletions

View File

@ -54,7 +54,7 @@ class AttackDisplay(wx.ScrolledWindow):
wx.ScrolledWindow.__init__(self,parent,id=-1) wx.ScrolledWindow.__init__(self,parent,id=-1)
self.Bind(wx.EVT_SIZE, self.OnSize) self.Bind(wx.EVT_SIZE, self.OnSize)
self.Image = wx.StaticBitmap(self, -1, wx.EmptyBitmap(1,1)) self.Image = wx.StaticBitmap(self, -1, wx.Bitmap(1,1))
self.box = wx.BoxSizer(wx.VERTICAL) self.box = wx.BoxSizer(wx.VERTICAL)
self.box.Add(self.Image,1,wx.ALIGN_CENTER) self.box.Add(self.Image,1,wx.ALIGN_CENTER)
self.hbox = wx.BoxSizer(wx.HORIZONTAL) self.hbox = wx.BoxSizer(wx.HORIZONTAL)
@ -93,9 +93,7 @@ class AttackDisplay(wx.ScrolledWindow):
# This is needed, don't ask me why. # This is needed, don't ask me why.
self.SetScrollbars(0,0,0,0,0,0) self.SetScrollbars(0,0,0,0,0,0)
size = self.GetClientSize() (framewidth,frameheight) = self.GetClientSize()
framewidth = size.width
frameheight = size.height
(virtualwidth,virtualheight) = (framewidth,frameheight) (virtualwidth,virtualheight) = (framewidth,frameheight)
def makefit(width,height): def makefit(width,height):
@ -120,14 +118,14 @@ class AttackDisplay(wx.ScrolledWindow):
if self.attack.filetype == "png": if self.attack.filetype == "png":
bmp = self.original bmp = self.original
if not bmp.Ok(): if not bmp.IsOk():
bmp = wx.EmptyImage(1,1) bmp = wx.EmptyImage(1,1)
else: else:
(originalwidth,originalheight) = (bmp.GetWidth(), bmp.GetHeight()) (originalwidth,originalheight) = (bmp.GetWidth(), bmp.GetHeight())
if self.win.fit: if self.win.fit:
(factor, virtualwidth, virtualheight) = makefit(originalwidth,originalheight) (factor, virtualwidth, virtualheight) = makefit(originalwidth,originalheight)
bmp = self.original.Scale(virtualwidth,virtualheight) bmp = self.original.Scale(virtualwidth,virtualheight)
self.Image.SetBitmap(wx.BitmapFromImage(bmp)) self.Image.SetBitmap(wx.Bitmap(bmp))
elif self.attack.filetype == "ps": elif self.attack.filetype == "ps":
pil = self.original.copy() pil = self.original.copy()

View File

@ -470,7 +470,7 @@ class ScytherRun(object):
Error.ShowAndExit(text) Error.ShowAndExit(text)
# start the thread # start the thread
self.verifywin.SetCursor(wx.StockCursor(wx.CURSOR_WAIT)) self.verifywin.SetCursor(wx.Cursor(wx.CURSOR_WAIT))
self.verifywin.Bind(wx.EVT_CLOSE, self.closer) self.verifywin.Bind(wx.EVT_CLOSE, self.closer)
self.verifywin.Bind(wx.EVT_WINDOW_DESTROY, self.closer) self.verifywin.Bind(wx.EVT_WINDOW_DESTROY, self.closer)
self.verifywin.Bind(wx.EVT_BUTTON, self.closer, id=wx.ID_CANCEL) self.verifywin.Bind(wx.EVT_BUTTON, self.closer, id=wx.ID_CANCEL)
@ -520,12 +520,12 @@ class ScytherRun(object):
def allDone(): def allDone():
if resultwin: if resultwin:
resultwin.SetCursor(wx.StockCursor(wx.CURSOR_ARROW)) resultwin.SetCursor(wx.Cursor(wx.CURSOR_ARROW))
resultwin.SetStatusText("Done.") resultwin.SetStatusText("Done.")
resultwin.Center() resultwin.Center()
resultwin.Show(True) resultwin.Show(True)
resultwin.SetCursor(wx.StockCursor(wx.CURSOR_ARROWWAIT)) resultwin.SetCursor(wx.Cursor(wx.CURSOR_ARROWWAIT))
wx.Yield() wx.Yield()