More updates from Morgan Hua

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33956 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2005-05-05 00:10:29 +00:00
parent 123dc137d3
commit b792147db7
17 changed files with 745 additions and 422 deletions

View File

@@ -41,12 +41,23 @@ class ImageView(wx.lib.docview.View):
panel = wx.Panel(frame, -1)
bitmap = wx.Image(doc.GetFilename()).ConvertToBitmap()
self._ctrl = wx.StaticBitmap(panel, -1, bitmap, (0,0), (bitmap.GetWidth(), 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(bitmap.GetSize())
frame.SetClientSize(panel.GetSize())
self.Activate()
return True
def OnFocus(self, event):
self._ctrl.SetFocus()
event.Skip()
def OnClose(self, deleteWindow = True):
statusC = wx.GetApp().CloseChildDocuments(self.GetDocument())
statusP = wx.lib.docview.View.OnClose(self, deleteWindow = deleteWindow)