[Thuban-commits] r2894 - trunk/thuban/Thuban/UI

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Jul 14 15:15:35 CEST 2011


Author: bricks
Date: 2011-07-14 15:15:35 +0200 (Thu, 14 Jul 2011)
New Revision: 2894

Modified:
   trunk/thuban/Thuban/UI/classifier.py
Log:
wxGridCellBoolEditor uses string values for true and false internally

By default wxGridCellBoolEditor uses "1" for True and "" for False.
Therefore we must be sure that Table GetValue() returns a corresponding
value und SetValue() gets the correct value to be stored.
Thus wxGridCellBoolEditor stores now str(True) and str(False) which can
be easily converted from and to boolean


Modified: trunk/thuban/Thuban/UI/classifier.py
===================================================================
--- trunk/thuban/Thuban/UI/classifier.py	2011-07-14 11:29:15 UTC (rev 2893)
+++ trunk/thuban/Thuban/UI/classifier.py	2011-07-14 13:15:35 UTC (rev 2894)
@@ -362,7 +362,9 @@
         self.__colAttr = {}
 
         attr = grid.GridCellAttr()
-        attr.SetEditor(grid.GridCellBoolEditor())
+        editor = grid.GridCellBoolEditor()
+        editor.UseStringValues("True", "False")
+        attr.SetEditor(editor)
         attr.SetRenderer(grid.GridCellBoolRenderer())
         attr.SetAlignment(wx.ALIGN_CENTER, wx.ALIGN_CENTER)
         self.__colAttr[COL_VISIBLE] = attr
@@ -602,7 +604,7 @@
         mod = True # assume the data will change
 
         if col == COL_VISIBLE:
-            group.SetVisible(value)
+            group.SetVisible(value == "True")
         elif col == COL_SYMBOL:
             group.SetProperties(value)
         elif col == COL_LABEL:



More information about the Thuban-commits mailing list