dabo Commit
Revision 7238
Date: 2012-08-31 10:34:35 -0700 (Fri, 31 Aug 2012)
Author: Paul
Trac: http://trac.dabodev.com/changeset/7238

Changed:
U   trunk/dabo/lib/reportWriter.py
U   trunk/ide/ReportDesigner.py

Log:
Added ColumnPadding property to the Report object, to specify how much space
to leave in between columns on the report. 

Fixed a problem with spanning lines and spanning rectangles that weren't 
accounting for column changes and thus were printing diagonal lines from
the group header on column 1 to the group footer on column 2.


Diff:
Modified: trunk/dabo/lib/reportWriter.py
===================================================================
--- trunk/dabo/lib/reportWriter.py      2012-08-28 18:34:03 UTC (rev 7237)
+++ trunk/dabo/lib/reportWriter.py      2012-08-31 17:34:35 UTC (rev 7238)
@@ -605,6 +605,9 @@
                self.AvailableProps["ColumnCount"] = toPropDict(int, 1,
                                """Specifies the number of columns to divide 
the report into.""")
 
+               self.AvailableProps["ColumnPadding"] = toPropDict(float, 0,
+                               """Specifies how much space to leave in between 
columns.""")
+
                self.MajorProperty = "Title"
 
 
@@ -2102,8 +2105,8 @@
 
                # Get the number of columns:
                columnCount = _form.getProp("columnCount")
+               columnPadding = self.getPt(_form.getProp("columnPadding")) * 
(columnCount - 1)
 
-
                # Initialize the groups list:
                groups = _form.get("groups", ())
                self._groupValues = {}
@@ -2184,7 +2187,7 @@
                        pageFooterOrigin = (ml, mb)
 
                        workingPageWidth = pageWidth - ml - mr
-                       columnWidth = workingPageWidth / columnCount
+                       columnWidth = (workingPageWidth / columnCount) - (.5 * 
columnPadding)
 
                        if y is None:
                                y = pageHeaderOrigin[1]
@@ -2293,6 +2296,7 @@
                                                headers_reprinted = True
                                        else:
                                                # Move to next column
+                                               
self.drawSpanningObjects((pageFooterOrigin[0],y))
                                                self._currentColumn += 1
                                                y = pageHeaderOrigin[1]
 
@@ -2328,7 +2332,7 @@
                                x,y = 0,1
                                width, height = pageWidth-1, pageHeight-1
 
-                       x = ml + (self._currentColumn * columnWidth)
+                       x = ml + (self._currentColumn * (columnWidth + 
columnPadding))
 
                        self.ReportForm.Bands[band]["x"] = x
                        self.ReportForm.Bands[band]["y"] = y

Modified: trunk/ide/ReportDesigner.py
===================================================================
--- trunk/ide/ReportDesigner.py 2012-08-28 18:34:03 UTC (rev 7237)
+++ trunk/ide/ReportDesigner.py 2012-08-31 17:34:35 UTC (rev 7238)
@@ -1364,12 +1364,15 @@
                dc.DestroyClippingRegion()
 
                columnCount = rdc.ReportForm.getProp("ColumnCount")
+               columnPadding = 
self._rw.getPt(rdc.ReportForm.getProp("ColumnPadding"))
                if isinstance(self.ReportObject, (Detail, GroupHeader, 
GroupFooter)) \
                                and columnCount > 1:
                        # Cover up all but the first column:
                        dc.SetBrush(wx.Brush((192,192,192), wx.SOLID))
                        dc.SetPen(wx.Pen((192,192,192), 0, wx.SOLID))
                        colWidth = self.Width / columnCount
+                       if columnCount > 1:
+                               colWidth -= columnPadding
                        dc.DrawRectangle(colWidth, 0, colWidth*(columnCount-1) 
+ 10, self.Height)
 
 



_______________________________________________
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