dabo Commit
Revision 5633
Date: 2010-02-03 14:11:24 -0800 (Wed, 03 Feb 2010)
Author: Paul
Trac: http://trac.dabodev.com/changeset/5633

Changed:
U   trunk/dabo/ui/uiwx/dPemMixin.py

Log:
Fixed getCaptureBitmap() to use a WindowDC for panels and dialogs instead of
the parent's ClientDC. This fixes ReportDesigner to correctly show the dragging
of the band label when sizing the height of bands. The only other place it is
used is in ClassDesignerMixin for showing the control moving around while
dragging, and testing on Linux shows that this still works.



Diff:
Modified: trunk/dabo/ui/uiwx/dPemMixin.py
===================================================================
--- trunk/dabo/ui/uiwx/dPemMixin.py     2010-02-03 21:26:06 UTC (rev 5632)
+++ trunk/dabo/ui/uiwx/dPemMixin.py     2010-02-03 22:11:24 UTC (rev 5633)
@@ -1322,39 +1322,33 @@
        
        
        def getCaptureBitmap(self):
-               """Returns a bitmap snapshot of self, as it appears in the 
-               UI at this moment. NOTE: recent changes in wxPython may cause
-               the bitmap to be returned as monochrome under OS X.
-               """
+               """Return a bitmap snapshot of self as it appears in the UI at 
this moment."""
                obj = self.Parent
                if self.Parent is None:
                        obj = self
                offset = 0
                htReduction = 0
                cltTop = self.absoluteCoordinates(self.GetClientAreaOrigin())[1]
-               if isinstance(self, dabo.ui.dForm):
+               if isinstance(self, (dabo.ui.dForm, dabo.ui.dDialog, 
dabo.ui.dPanel)):
                        dc = wx.WindowDC(self)
                        if self.Application.Platform == "Mac":
                                # Need to adjust for the title bar
                                offset = self.Top - cltTop
-                       elif self.Application.Platform == "GTK":
-                               # Probably no longer needed; currently 
commented out below.
-                               htReduction = cltTop - self.Top
                else:
                        dc = wx.ClientDC(obj)
                # Make sure that the elements are all current
                obj.iterateCall("_redraw", dc)
-               #obj._redraw(dc)
 
                # Suggested as an alternative for OS X
                if wx.Platform == "__WXMAC__":
                        return dc.GetAsBitmap()
+
                rect = self.GetRect()
-               bmp = wx.EmptyBitmap(rect.width, rect.height, -1)       # - 
htReduction)
+               bmp = wx.EmptyBitmap(rect.width, rect.height, -1)  ## -1: use 
same color depth
                memdc = wx.MemoryDC()
                memdc.SelectObject(bmp)
-               
-               memdc.Blit(0, 0, self.Width, self.Height, dc, 0, offset)
+       
+               memdc.Blit(0, 0, rect.width, rect.height, dc, 0, offset)
                memdc.SelectObject(wx.NullBitmap)
                memdc.Destroy()
                return bmp



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to