dabo Commit
Revision 4592
Date: 2008-10-24 09:48:43 -0700 (Fri, 24 Oct 2008)
Author: Paul
Trac: http://svn.dabodev.com/trac/dabo/changeset/4592

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

Log:
Added [Dynamic]CellBackColor property to dColumn.



Diff:
Modified: trunk/dabo/ui/uiwx/dGrid.py
===================================================================
--- trunk/dabo/ui/uiwx/dGrid.py 2008-10-24 16:17:38 UTC (rev 4591)
+++ trunk/dabo/ui/uiwx/dGrid.py 2008-10-24 16:48:43 UTC (rev 4592)
@@ -816,6 +816,22 @@
                        self._properties["Caption"] = val
 
 
+       def _getCellBackColor(self):
+               row = self.Parent.CurrentRow
+               cellAttr = self._gridCellAttrs.get(row, False)
+               if cellAttr:
+                       return cellAttr.GetBackgroundColour()
+               return self.BackColor
+
+       def _setCellBackColor(self, val):
+               if self._constructed():
+                       if isinstance(val, basestring):
+                               val = dColors.colorTupleFromName(val)
+                       self._setCellProp("SetBackgroundColour", val)
+               else:
+                       self._properties["CellBackColor"] = val
+
+
        def _getCellForeColor(self):
                row = self.Parent.CurrentRow
                cellAttr = self._gridCellAttrs.get(row, False)
@@ -1427,6 +1443,9 @@
        ColumnIndex = property(_getColumnIndex, None,
                        _("Returns the index of this column in the parent 
grid."))
 
+       CellBackColor = property(_getCellBackColor, _setCellBackColor, None,
+                       _("Color for the background of the current cell in the 
column."))
+
        CellForeColor = property(_getCellForeColor, _setCellForeColor, None,
                        _("Color for the foreground (text) of the current cell 
in the column."))
 
@@ -1610,6 +1629,7 @@
        # Dynamic Property Declarations
        DynamicBackColor = makeDynamicProperty(BackColor)
        DynamicCaption = makeDynamicProperty(Caption)
+       DynamicCellBackColor = makeDynamicProperty(CellBackColor)
        DynamicCellForeColor = makeDynamicProperty(CellForeColor)
        DynamicCustomEditorClass = makeDynamicProperty(CustomEditorClass)
        DynamicCustomEditors = makeDynamicProperty(CustomEditors)




_______________________________________________
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