- bitmap = wx.Image(doc.GetFilename()).ConvertToBitmap()
- self._ctrl = wx.StaticBitmap(panel, -1, bitmap, (0,0), (bitmap.GetWidth(), bitmap.GetHeight()))
- panel.SetClientSize(bitmap.GetSize())
+ self._bitmap = wx.Image(doc.GetFilename()).ConvertToBitmap()
+ self._ctrl = wx.StaticBitmap(panel, -1, self._bitmap, (0,0), (self._bitmap.GetWidth(), self._bitmap.GetHeight()))
+ wx.EVT_LEFT_DOWN(self._ctrl, self.OnFocus)
+ wx.EVT_LEFT_DCLICK(self._ctrl, self.OnFocus)
+ wx.EVT_RIGHT_DOWN(self._ctrl, self.OnFocus)
+ wx.EVT_RIGHT_DCLICK(self._ctrl, self.OnFocus)
+ wx.EVT_MIDDLE_DOWN(self._ctrl, self.OnFocus)
+ wx.EVT_MIDDLE_DCLICK(self._ctrl, self.OnFocus)
+ panel.SetClientSize(self._bitmap.GetSize())