[GRASS-SVN] r41423 - grass/branches/releasebranch_6_4/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Mar 13 12:17:39 EST 2010


Author: martinl
Date: 2010-03-13 12:17:38 -0500 (Sat, 13 Mar 2010)
New Revision: 41423

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/gselect.py
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py
Log:
wxGUI: track default column name
(merge r41421 & r41422 from devbr6)


Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/gselect.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/gselect.py	2010-03-13 17:12:47 UTC (rev 41422)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/gselect.py	2010-03-13 17:17:38 UTC (rev 41423)
@@ -584,6 +584,7 @@
                 style |= wx.CB_READONLY
             else:
                 style = wx.CB_READONLY
+        self.defaultValue = value
         
         super(ColumnSelect, self).__init__(parent, id, value = value, choices = choices, size = size,
                                            **kwargs)
@@ -607,7 +608,7 @@
             columns = []
 
         self.SetItems(columns)
-        self.SetValue('')
+        self.SetValue(self.defaultValue)
 
     def InsertTableColumns(self, table, driver=None, database=None):
         """Insert table columns"""
@@ -623,6 +624,7 @@
             columns = ret.splitlines()
 
         self.SetItems(columns)
+        self.SetValue(self.defaultValue)
         
 class DbColumnSelect(wx.ComboBox):
     """

Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py	2010-03-13 17:12:47 UTC (rev 41422)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py	2010-03-13 17:17:38 UTC (rev 41423)
@@ -1409,7 +1409,8 @@
                                                   size=globalvar.DIALOG_TEXTCTRL_SIZE)
                                 win.Bind(wx.EVT_TEXT, self.OnSetValue)
                         elif p.get('prompt', '') == 'dbcolumn':
-                            win = gselect.ColumnSelect(parent=which_panel)
+                            win = gselect.ColumnSelect(parent = which_panel,
+                                                       value = p.get('default', ''))
                             ### p['wxGetValue'] = win.GetStringSelection
                             ### win.Bind(wx.EVT_COMBOBOX, self.OnSetValue)
                             win.Bind(wx.EVT_TEXT, self.OnSetValue)



More information about the grass-commit mailing list