Browse Source

wxGUI: combobox readonly disabled (to unset paramater)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@41417 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 15 năm trước cách đây
mục cha
commit
d48c77e831
1 tập tin đã thay đổi với 10 bổ sung9 xóa
  1. 10 9
      gui/wxpython/gui_modules/menuform.py

+ 10 - 9
gui/wxpython/gui_modules/menuform.py

@@ -1245,16 +1245,17 @@ class cmdPanel(wx.Panel):
                     else:
                         # list of values (combo)
                         title_txt.SetLabel(title + ':')
-                        cb = wx.ComboBox(parent=which_panel, id=wx.ID_ANY, value=p.get('default',''),
-                                         size=globalvar.DIALOG_COMBOBOX_SIZE,
-                                         choices=valuelist, style=wx.CB_DROPDOWN | wx.CB_READONLY)
-                        if p.get('value','') != '':
+                        cb = wx.ComboBox(parent = which_panel, id = wx.ID_ANY, value = p.get('default',''),
+                                         size = globalvar.DIALOG_COMBOBOX_SIZE,
+                                         choices = valuelist, style = wx.CB_DROPDOWN)
+                        if p.get('value', '') != '':
                             cb.SetValue(p['value']) # parameter previously set
-                        which_sizer.Add( item=cb, proportion=0,
-                                         flag=wx.ADJUST_MINSIZE | wx.BOTTOM | wx.LEFT, border=5)
-                        p['wxId'] = [ cb.GetId(), ]
-                        cb.Bind( wx.EVT_COMBOBOX, self.OnSetValue)
-
+                        which_sizer.Add(item = cb, proportion = 0,
+                                        flag = wx.ADJUST_MINSIZE | wx.BOTTOM | wx.LEFT, border = 5)
+                        p['wxId'] = [cb.GetId(),]
+                        cb.Bind(wx.EVT_COMBOBOX, self.OnSetValue)
+                        cb.Bind(wx.EVT_TEXT, self.OnSetValue)
+            
             # text entry
             if (p.get('type','string') in ('string','integer','float')
                 and len(p.get('values',[])) == 0