X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0c8f2860735721e6cd0a140e7af0b7e55a72eb54..75d9e502238df95fa53c0030b1fac0d4f43e4025:/wxPython/wx/lib/imagebrowser.py diff --git a/wxPython/wx/lib/imagebrowser.py b/wxPython/wx/lib/imagebrowser.py index 942eb877f4..72b1346d53 100644 --- a/wxPython/wx/lib/imagebrowser.py +++ b/wxPython/wx/lib/imagebrowser.py @@ -82,7 +82,7 @@ class ImageView(wx.Window): brush = wx.Brush(wx.NamedColour(self.back_color), wx.SOLID) dc.SetBrush(brush) dc.SetPen(wx.Pen(wx.NamedColour(self.border_color), 1)) - dc.DrawRectangle((0, 0), (self.image_sizex, self.image_sizey)) + dc.DrawRectangle(0, 0, self.image_sizex, self.image_sizey) def DrawImage(self, dc): try: @@ -95,7 +95,10 @@ class ImageView(wx.Window): if image is None: return - bmp = image.ConvertToBitmap() + try: + bmp = image.ConvertToBitmap() + except: + return iwidth = bmp.GetWidth() # dimensions of image file iheight = bmp.GetHeight() @@ -113,7 +116,7 @@ class ImageView(wx.Window): image.Rescale(iwidth, iheight) # rescale to fit the window image.ConvertToBitmap() bmp = image.ConvertToBitmap() - dc.DrawBitmap(bmp, (diffx, diffy)) # draw the image to window + dc.DrawBitmap(bmp, diffx, diffy) # draw the image to window class ImageDialog(wx.Dialog): @@ -124,7 +127,7 @@ class ImageDialog(wx.Dialog): self.y_pos = 20 self.delta = 20 - size = wx.Size(80, 25) + size = wx.Size(80, -1) self.set_dir = os.getcwd() self.set_file = None @@ -330,7 +333,7 @@ class FindFiles: if pattern.match(value) != None: filelist.append(i) - self.files = filelist + self.files = filelist def MakeRegex(self, pattern): import re