dabo Commit
Revision 5606
Date: 2010-01-28 09:05:42 -0800 (Thu, 28 Jan 2010)
Author: Paul
Trac: http://trac.dabodev.com/changeset/5606
Changed:
U trunk/dabo/ui/uiwx/dGrid.py
U trunk/dabo/ui/uiwx/gridRenderers.py
Log:
Fixed the grid bool renderer to show the unchecked bitmap when the value
is None. It had been evaluating to True due to the conversion to '< None >'
in GetValue().
Diff:
Modified: trunk/dabo/ui/uiwx/dGrid.py
===================================================================
--- trunk/dabo/ui/uiwx/dGrid.py 2010-01-27 20:04:53 UTC (rev 5605)
+++ trunk/dabo/ui/uiwx/dGrid.py 2010-01-28 17:05:42 UTC (rev 5606)
@@ -293,7 +293,7 @@
# return False
- def GetValue(self, row, col, useCache=True):
+ def GetValue(self, row, col, useCache=True, convertNoneToString=True):
col = self._convertWxColNumToDaboColNum(col)
if useCache:
try:
@@ -320,7 +320,7 @@
ret = self.grid.DataSet[row][field]
except (TypeError, IndexError, KeyError):
ret = ""
- if ret is None:
+ if ret is None and convertNoneToString:
ret = self.grid.NoneDisplay
self.__cachedVals[(row, col)] = (ret, time.time())
return ret
Modified: trunk/dabo/ui/uiwx/gridRenderers.py
===================================================================
--- trunk/dabo/ui/uiwx/gridRenderers.py 2010-01-27 20:04:53 UTC (rev 5605)
+++ trunk/dabo/ui/uiwx/gridRenderers.py 2010-01-28 17:05:42 UTC (rev 5606)
@@ -35,14 +35,14 @@
return wx.Size(checkedBitmap.GetWidth(),
checkedBitmap.GetHeight())
- def getValueBitmap( self, grid, row, col ):
- value = grid._Table.GetValue(row, col)
+ def getValueBitmap(self, grid, row, col):
+ value = grid._Table.GetValue(row, col,
convertNoneToString=False)
if value:
return checkedBitmap
return uncheckedBitmap
- def drawBitmap( self, bitmap, attr, dc, rect, isSelected):
+ def drawBitmap(self, bitmap, attr, dc, rect, isSelected):
# draw background:
if isSelected:
syscolor = wx.SYS_COLOUR_HIGHLIGHT
_______________________________________________
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]