dabo Commit
Revision 6324
Date: 2011-01-17 19:48:08 -0800 (Mon, 17 Jan 2011)
Author: Ed
Trac: http://trac.dabodev.com/changeset/6324

Changed:
U   trunk/demo/samples/dGrid.py

Log:
Updated the demo to include the new grid properties.


Diff:
Modified: trunk/demo/samples/dGrid.py
===================================================================
--- trunk/demo/samples/dGrid.py 2011-01-18 03:45:41 UTC (rev 6323)
+++ trunk/demo/samples/dGrid.py 2011-01-18 03:48:08 UTC (rev 6324)
@@ -103,30 +103,50 @@
 
                chk = dabo.ui.dCheckBox(self, Caption="Show Cell Borders?",
                                DataSource=self.grid, 
DataField="ShowCellBorders")
-               gsz.append(chk, row=0, col=1)
+               gsz.append(chk, row=4, col=0)
                chk.refresh()
 
                chk = dabo.ui.dCheckBox(self, Caption="Allow Multiple 
Selection?",
                                DataSource=self.grid, 
DataField="MultipleSelection")
                chk.refresh()
-               gsz.append(chk, row=1, col=1)
+               gsz.append(chk, row=0, col=1)
 
                chk = dabo.ui.dCheckBox(self, Caption="Allow Row Resizing?",
                                DataSource=self.grid, DataField="ResizableRows")
                chk.refresh()
-               gsz.append(chk, row=2, col=1)
+               gsz.append(chk, row=1, col=1)
 
                chk = dabo.ui.dCheckBox(self, Caption="Allow Column Resizing?",
                                DataSource=self.grid, 
DataField="ResizableColumns")
                chk.refresh()
+               gsz.append(chk, row=2, col=1)
+
+               chk = dabo.ui.dCheckBox(self, Caption="Vertical Headers?",
+                               DataSource=self.grid, 
DataField="VerticalHeaders")
+               chk.refresh()
                gsz.append(chk, row=3, col=1)
 
+               chk = dabo.ui.dCheckBox(self, Caption="Auto-adjust Header 
Height?",
+                               DataSource=self.grid, 
DataField="AutoAdjustHeaderHeight")
+               chk.refresh()
+               gsz.append(chk, row=4, col=1)
+
                radSelect = dabo.ui.dRadioList(self, Choices=["Row", "Col", 
"Cell"],
                                ValueMode="string", Caption="Sel Mode",
                                DataSource=self.grid, DataField="SelectionMode")
                radSelect.refresh()
-               gsz.append(radSelect, row=0, col=2, rowSpan=4)
+               gsz.append(radSelect, row=0, col=2, rowSpan=5)
 
+               lbl = dabo.ui.dLabel(self, Caption="Sort Indicator Size")
+               spnSort = dabo.ui.dSpinner(self, Min=2, Max=20, 
DataSource=self.grid,
+                               DataField="SortIndicatorSize", 
OnHit=self.onSortSizeChange)
+               gsz.append(lbl, row=0, col=3)
+               gsz.append(spnSort, row=1, col=3, halign="center")
+
+               btn = dabo.ui.dButton(self, Caption="Sort Indicator Color")
+               btn.bindEvent(dEvents.Hit, self.onSetSortIndicatorColor)
+               gsz.append(btn, row=3, col=3, halign="center")
+
                sz.append(gsz, halign="Center", border=10)
                gsz.setColExpand(True, 2)
 
@@ -189,9 +209,23 @@
                self.grid.refresh()
 
 
+       def onSetSortIndicatorColor(self, evt):
+               clr = self.grid.SortIndicatorColor
+               new = dabo.ui.getColor(clr)
+               if new:
+                       self.grid.SortIndicatorColor = new
+               self.grid.refresh()
+
+
+       def onSortSizeChange(self, evt):
+               self.grid.refresh()
+
+
+
 category = "Controls.dGrid"
 
 overview = """
 <p>The <b>dGrid</b> class is used to display (and optionally edit)
-tabular data.
+tabular data. It is highly customizable; this demo shows off many of the
+properties used to control its appearance and behavior.
 """



_______________________________________________
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