[Commits] (davids) disabled double-buffered CollectionCanvas drawing

commits at osafoundation.org commits at osafoundation.org
Fri Apr 29 21:02:21 PDT 2005


Commit by: davids
Modified files:
chandler/parcels/osaf/framework/blocks/calendar/CollectionCanvas.py 1.36 1.37

Log message:

disabled double-buffered CollectionCanvas drawing
rewrote basic render routine so that the buffering can be switched on or off
with ease
r=TBD



ViewCVS links:
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/blocks/calendar/CollectionCanvas.py.diff?r1=text&tr1=1.36&r2=text&tr2=1.37

Index: chandler/parcels/osaf/framework/blocks/calendar/CollectionCanvas.py
diff -u chandler/parcels/osaf/framework/blocks/calendar/CollectionCanvas.py:1.36 chandler/parcels/osaf/framework/blocks/calendar/CollectionCanvas.py:1.37
--- chandler/parcels/osaf/framework/blocks/calendar/CollectionCanvas.py:1.36	Wed Apr 20 18:16:22 2005
+++ chandler/parcels/osaf/framework/blocks/calendar/CollectionCanvas.py	Fri Apr 29 21:02:19 2005
@@ -1,8 +1,8 @@
 """ Canvas block for displaying item collections
 """
 
-__version__ = "$Revision: 1.36 $"
-__date__ = "$Date: 2005/04/21 01:16:22 $"
+__version__ = "$Revision: 1.37 $"
+__date__ = "$Date: 2005/04/30 04:02:19 $"
 __copyright__ = "Copyright (c) 2004 Open Source Applications Foundation"
 __license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -642,36 +642,38 @@
         self.DrawCanvas(dc)
         
     def DrawCanvas(self, dc):
-        # Find update rect in scrolled coordinates
-        updateRect = self.GetUpdateRegion().GetBox()
-        point = self.CalcUnscrolledPosition((updateRect.GetLeft(),
-                                             updateRect.GetTop()))
-        wBuffer = updateRect.GetWidth()
-        hBuffer = updateRect.GetHeight()
-
-        # Create offscreen buffer
-        memoryDC = wx.MemoryDC()
-        buffer = wx.EmptyBitmap(wBuffer, hBuffer)
-        memoryDC.SelectObject(buffer)
-        memoryDC.SetDeviceOrigin(-point.x, -point.y)
-
-        memoryDC.BeginDrawing()
-
-        self.DrawBackground(memoryDC)
-        self.DrawCells(memoryDC)
-
-        memoryDC.EndDrawing()      
-
-        dc.Blit(point.x, point.y,
-                wBuffer, hBuffer,
-                memoryDC,
-                point.x, point.y)
+        if (True):
+            dc.BeginDrawing()
+            self.DrawBackground(dc)
+            self.DrawCells(dc)
+            dc.EndDrawing()
+        else:
+            # Find update rect in scrolled coordinates
+            updateRect = self.GetUpdateRegion().GetBox()
+            point = self.CalcUnscrolledPosition((updateRect.GetLeft(), updateRect.GetTop()))
+            wBuffer = updateRect.GetWidth()
+            hBuffer = updateRect.GetHeight()
+
+            # Create offscreen buffer
+            memoryDC = wx.MemoryDC()
+            buffer = wx.EmptyBitmap(wBuffer, hBuffer)
+            memoryDC.SelectObject(buffer)
+            memoryDC.SetDeviceOrigin(-point.x, -point.y)
+
+            memoryDC.BeginDrawing()
+            self.DrawBackground(memoryDC)
+            self.DrawCells(memoryDC)
+            memoryDC.EndDrawing()      
+
+            dc.Blit(point.x, point.y,
+                    wBuffer, hBuffer,
+                    memoryDC,
+                    point.x, point.y)
 
-        
     def PrintCanvas(self, dc):
         dc.BeginDrawing()
         self.DrawBackground(dc)
-        self.DrawCells(dc)        
+        self.DrawCells(dc)
         dc.EndDrawing()
 
     def DrawCells(self, dc):



More information about the Commits mailing list