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

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jul 10 11:02:11 EDT 2009


Author: martinl
Date: 2009-07-10 11:02:11 -0400 (Fri, 10 Jul 2009)
New Revision: 38351

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/gselect.py
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py
Log:
ColumnSelect writable by default (see trac #671)
	     (merge from devbr6, r38350)


Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/gselect.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/gselect.py	2009-07-10 14:55:44 UTC (rev 38350)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/gselect.py	2009-07-10 15:02:11 UTC (rev 38351)
@@ -541,18 +541,24 @@
     The 'layer' terminology is likely to change for GRASS 7
     """
     def __init__(self, parent,
-                 id=wx.ID_ANY, value='', pos=wx.DefaultPosition,
-                 size=globalvar.DIALOG_COMBOBOX_SIZE, vector=None,
-                 layer=1, choices=[]):
+                 id = wx.ID_ANY, value = '',
+                 size = globalvar.DIALOG_COMBOBOX_SIZE,
+                 vector = None, layer = 1, choices = [], readonly = False,
+                 **kwargs):
+        if readonly:
+            if kwargs.has_key('style'):
+                style |= wx.CB_READONLY
+            else:
+                style = wx.CB_READONLY
         
-        super(ColumnSelect, self).__init__(parent, id, value, pos, size, choices,
-                                           style=wx.CB_READONLY)
-
+        super(ColumnSelect, self).__init__(parent, id, value = value, choices = choices, size = size,
+                                           **kwargs)
+        
         self.SetName("ColumnSelect")
 
         if vector:
             self.InsertColumns(vector, layer)
-                
+    
     def InsertColumns(self, vector, layer):
         """Insert columns for a vector attribute table into the columns combobox"""
         dbInfo = VectorDBInfo(vector)

Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py	2009-07-10 14:55:44 UTC (rev 38350)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py	2009-07-10 15:02:11 UTC (rev 38351)
@@ -1400,8 +1400,9 @@
                                 win.Bind(wx.EVT_TEXT, self.OnSetValue)
                         elif p.get('prompt', '') == 'dbcolumn':
                             win = gselect.ColumnSelect(parent=which_panel)
-                            p['wxGetValue'] = win.GetStringSelection
-                            win.Bind(wx.EVT_COMBOBOX, self.OnSetValue)
+                            ### p['wxGetValue'] = win.GetStringSelection
+                            ### win.Bind(wx.EVT_COMBOBOX, self.OnSetValue)
+                            win.Bind(wx.EVT_TEXT, self.OnSetValue)
                             
                     p['wxId'] = win.GetId()
                     



More information about the grass-commit mailing list