[Greater-commits] r3577 - trunk/GREAT-ER/Thuban/UI

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


Author: aheinecke
Date: 2011-07-14 14:58:15 +0200 (Thu, 14 Jul 2011)
New Revision: 3577

Modified:
   trunk/GREAT-ER/Thuban/UI/labeldialog.py
Log:
LabelListCtrl: Return the value of the selected list element as a string.
    Since it will be used as a Label it needs to be a string representable
    object. When a "non str" object is added to the Layer as a label
    the Viewport throws an exception.

LabelDialog:
    Change the Layout to have a larger default size (350x350) and remove
    the size setting from the LabelListCtrl since the list is automatically
    expanded to fit the size of the dialog anyway.


Modified: trunk/GREAT-ER/Thuban/UI/labeldialog.py
===================================================================
--- trunk/GREAT-ER/Thuban/UI/labeldialog.py	2009-12-11 13:00:35 UTC (rev 3576)
+++ trunk/GREAT-ER/Thuban/UI/labeldialog.py	2011-07-14 12:58:15 UTC (rev 3577)
@@ -19,7 +19,11 @@
         SelectableRecordListCtrl.__init__(self, parent, id)
         self.fill_list(table, shape)
 
+    def GetValue(self):
+        """Return the currently selected value as a string"""
+        return str(SelectableRecordListCtrl.GetValue(self))
 
+
 class LabelDialog(wx.Dialog):
 
     def __init__(self, parent, table, shape_index):
@@ -34,7 +38,6 @@
         top_box = wx.BoxSizer(wx.VERTICAL)
 
         self.list = LabelListCtrl(self, -1, table, shape_index)
-        self.list.SetSize(wx.Size(305,200))
         top_box.Add(self.list, 1, wx.EXPAND|wx.ALL, 4)
 
         box = wx.BoxSizer(wx.HORIZONTAL)
@@ -49,6 +52,7 @@
         self.SetSizer(top_box)
         top_box.Fit(self)
         top_box.SetSizeHints(self)
+        self.SetSize(wx.Size(350, 350))
 
     def OnOK(self, event):
         result = self.list.GetValue()



More information about the Greater-commits mailing list