DocView patches from Morgen Hua: bug fixes, and additional SVN

commands, also added a default template that uses the text editor for
any unknown file type.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34473 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2005-05-31 21:41:11 +00:00
parent b81383bbd9
commit 26ee3a06e2
22 changed files with 1191 additions and 316 deletions

View File

@@ -39,15 +39,15 @@ class ImageView(wx.lib.docview.View):
frame = wx.GetApp().CreateDocumentFrame(self, doc, flags)
panel = wx.Panel(frame, -1)
bitmap = wx.Image(doc.GetFilename()).ConvertToBitmap()
self._ctrl = wx.StaticBitmap(panel, -1, bitmap, (0,0), (bitmap.GetWidth(), bitmap.GetHeight()))
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(bitmap.GetSize())
panel.SetClientSize(self._bitmap.GetSize())
frame.SetClientSize(panel.GetSize())
self.Activate()
return True
@@ -69,6 +69,13 @@ class ImageView(wx.lib.docview.View):
return True
def OnDraw(self, dc):
""" for Print Preview and Print """
dc.BeginDrawing()
dc.DrawBitmap(self._bitmap, 10, 10, True)
dc.EndDrawing()
#----------------------------------------------------------------------------
# Icon Bitmaps - generated by encode_bitmaps.py
#----------------------------------------------------------------------------