daboide Commit
Revision 394
Date: 2006-01-26 21:49:44 -0800 (Thu, 26 Jan 2006)
Author: ed
Changed:
U trunk/Designer.py
U trunk/DesignerComponents.py
Log:
Changed the Rows and Columns properties of the LayoutGridSizer to be real live
properties. Modifying their values in the Designer will change the layout
accordingly.
Diff:
Modified: trunk/Designer.py
===================================================================
--- trunk/Designer.py 2006-01-27 02:23:43 UTC (rev 393)
+++ trunk/Designer.py 2006-01-27 05:49:44 UTC (rev 394)
@@ -1306,10 +1306,10 @@
# If there is no controlling sizer, set the
Parent
# object's sizer to the grid sizer.
newSizer = LayoutGridSizer(maxCols=cols)
- for ii in range(rows*cols):
- lp = LayoutPanel(obj, AutoSizer=False)
- newSizer.append(lp, "expand")
- newSizer.setFullExpand()
+# for ii in range(rows*cols):
+# lp = LayoutPanel(obj, AutoSizer=False)
+# newSizer.append(lp, "expand")
+# newSizer.setFullExpand()
newSizer.Rows, newSizer.Columns = rows, cols
if controllingSizer.ControllingSizer is not
None:
cscs = controllingSizer.ControllingSizer
@@ -1355,10 +1355,10 @@
elif isSpacer:
pass
else:
- for ii in range(rows*cols):
- lp = LayoutPanel(obj, AutoSizer=False)
- newSizer.append(lp, "expand")
- newSizer.setFullExpand()
+# for ii in range(rows*cols):
+# lp = LayoutPanel(obj, AutoSizer=False)
+# newSizer.append(lp, "expand")
+# newSizer.setFullExpand()
newSizer.Rows, newSizer.Columns = rows, cols
try:
itm = newSizer.ControllingSizerItem
Modified: trunk/DesignerComponents.py
===================================================================
--- trunk/DesignerComponents.py 2006-01-27 02:23:43 UTC (rev 393)
+++ trunk/DesignerComponents.py 2006-01-27 05:49:44 UTC (rev 394)
@@ -797,14 +797,42 @@
return self._cols
def _setColCount(self, val):
- self._cols = val
+ curr = self._cols
+ if curr != val:
+ self._cols = val
+ if val > curr:
+ self.MaxCols = val
+ prnt = self.Parent
+ for cc in range(curr, val):
+ for rr in range(self.Rows):
+ lp = LayoutPanel(prnt,
AutoSizer=False)
+ self.append(lp, "x", row=rr,
col=cc)
+ self.setColExpand(True, cc)
+ else:
+ for cc in range(curr-1, val-1, -1):
+ self.removeCol(cc)
+ self.layout()
def _getRowCount(self):
return self._rows
def _setRowCount(self, val):
- self._rows = val
+ curr = self._rows
+ if curr != val:
+ self._rows = val
+ if val > curr:
+ self.MaxRows = val
+ prnt = self.Parent
+ for rr in range(curr, val):
+ for cc in range(self.Columns):
+ lp = LayoutPanel(prnt,
AutoSizer=False)
+ self.append(lp, "x", row=rr,
col=cc)
+ self.setRowExpand(True, rr)
+ else:
+ for rr in range(curr-1, val-1, -1):
+ self.removeRow(rr)
+ self.layout()
def _getSzBorder(self):
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev