[GRASS-SVN] r38350 - grass/branches/develbranch_6/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jul 10 10:55:45 EDT 2009


Author: martinl
Date: 2009-07-10 10:55:44 -0400 (Fri, 10 Jul 2009)
New Revision: 38350

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
Log:
ColumnSelect writable by default (see trac #671)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py	2009-07-10 13:49:33 UTC (rev 38349)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py	2009-07-10 14:55:44 UTC (rev 38350)
@@ -609,18 +609,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, excludeKey = False, type = None):
         """!Insert columns for a vector attribute table into the columns combobox
 

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2009-07-10 13:49:33 UTC (rev 38349)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2009-07-10 14:55:44 UTC (rev 38350)
@@ -1293,8 +1293,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