Browse Source

wxGUI/forms: fix commit https://trac.osgeo.org/grass/changeset/63173

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@63199 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 10 years ago
parent
commit
7258575109
1 changed files with 7 additions and 3 deletions
  1. 7 3
      gui/wxpython/gui_core/forms.py

+ 7 - 3
gui/wxpython/gui_core/forms.py

@@ -1220,12 +1220,16 @@ class CmdPanel(wx.Panel):
                             p['wxId'] = [selection.GetId(), ]
                             p['wxId'] = [selection.GetId(), ]
                         else:
                         else:
                             p['wxId'] = [textWin.GetId(), ]
                             p['wxId'] = [textWin.GetId(), ]
+                        if prompt != 'vector':
+                            self.FindWindowById(p['wxId'][0]).Bind(wx.EVT_TEXT, self.OnSetValue)
 
 
                     if prompt == 'vector':
                     if prompt == 'vector':
+                        win = self.FindWindowById(p['wxId'][0])
                         # handlers should be bound in this order
                         # handlers should be bound in this order
-                        selection.Bind(wx.EVT_TEXT, self.OnUpdateSelection)
-                        selection.Bind(wx.EVT_TEXT, self.OnSetValue)
-                        
+                        # OnUpdateSelection depends on calling OnSetValue first which is bad
+                        win.Bind(wx.EVT_TEXT, self.OnUpdateSelection)
+                        win.Bind(wx.EVT_TEXT, self.OnSetValue)
+
                         # if formatSelector and p.get('age', 'old') == 'old':
                         # if formatSelector and p.get('age', 'old') == 'old':
                         #     # OGR supported (read-only)
                         #     # OGR supported (read-only)
                         #     self.hsizer = wx.BoxSizer(wx.HORIZONTAL)
                         #     self.hsizer = wx.BoxSizer(wx.HORIZONTAL)