fixed some bugs:
authorgreg
Fri, 22 May 2009 08:38:12 +0200
changeset 352 5cd60f7e510c
parent 351 160ff73c0ac7
child 353 f2be2307d666
fixed some bugs:
- zoom functionality on windows
- mark project state as saved when open a project
- add test for "clean entry" in display menu
PLCControler.py
PLCOpenEditor.py
Viewer.py
--- a/PLCControler.py	Mon May 04 09:55:26 2009 +0200
+++ b/PLCControler.py	Fri May 22 08:38:12 2009 +0200
@@ -179,7 +179,7 @@
         self.Project = None
         self.ProjectBufferEnabled = False
         self.ProjectBuffer = None
-        self.ProjectSaved = False
+        self.ProjectSaved = True
         self.Buffering = False
         self.FilePath = ""
         self.FileName = ""
--- a/PLCOpenEditor.py	Mon May 04 09:55:26 2009 +0200
+++ b/PLCOpenEditor.py	Fri May 22 08:38:12 2009 +0200
@@ -1268,10 +1268,12 @@
             else:
                 self.DisplayMenu.Enable(wx.ID_REFRESH, False)
                 self.DisplayMenu.Enable(wx.ID_ZOOM_FIT, False)
-            self.DisplayMenu.Enable(wx.ID_CLEAR, True)
+            if not self.Debug and not self.ModeSolo:
+                self.DisplayMenu.Enable(wx.ID_CLEAR, True)
         else:
             self.DisplayMenu.Enable(wx.ID_REFRESH, False)
-            self.DisplayMenu.Enable(wx.ID_CLEAR, False)
+            if not self.Debug and not self.ModeSolo:
+                self.DisplayMenu.Enable(wx.ID_CLEAR, False)
             self.DisplayMenu.Enable(wx.ID_ZOOM_FIT, False)
         
     def OnRefreshMenu(self, event):
--- a/Viewer.py	Mon May 04 09:55:26 2009 +0200
+++ b/Viewer.py	Fri May 22 08:38:12 2009 +0200
@@ -455,7 +455,8 @@
 
     def GetLogicalDC(self, buffered=False):
         if buffered:
-            dc = wx.AutoBufferedPaintDC(self)
+            bitmap = wx.EmptyBitmap(*self.GetClientSize())
+            dc = wx.MemoryDC(bitmap)
         else:
             dc = wx.ClientDC(self)
         dc.SetFont(self.GetFont())
@@ -2873,7 +2874,9 @@
             dc.EndDrawing()
 
     def OnPaint(self, event):
-        self.DoDrawing(self.GetLogicalDC(True))
+        dc = self.GetLogicalDC(True)
+        self.DoDrawing(dc)
+        wx.BufferedPaintDC(self, dc.GetAsBitmap())
         event.Skip()