Explorar el Código

wxGUI/dialog: generate interactive input area only for old_file

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@42574 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa hace 15 años
padre
commit
d8701385c4
Se han modificado 1 ficheros con 20 adiciones y 18 borrados
  1. 20 18
      gui/wxpython/gui_modules/menuform.py

+ 20 - 18
gui/wxpython/gui_modules/menuform.py

@@ -1544,27 +1544,29 @@ class cmdPanel(wx.Panel):
                     which_sizer.Add(item=fbb, proportion=0,
                     which_sizer.Add(item=fbb, proportion=0,
                                     flag=wx.EXPAND | wx.RIGHT, border=5)
                                     flag=wx.EXPAND | wx.RIGHT, border=5)
                     
                     
-                    # widget for interactive input
-                    ifbb = wx.TextCtrl(parent = which_panel, id = wx.ID_ANY,
-                                       style = wx.TE_MULTILINE,
-                                       size = (-1, 75))
-                    if p.get('value', '') and os.path.isfile(p['value']):
-                        f = open(p['value'])
-                        ifbb.SetValue(''.join(f.readlines()))
-                        f.close()
-                    
-                    ifbb.Bind(wx.EVT_TEXT, self.OnFileText)
-                    which_sizer.Add(item = wx.StaticText(parent = which_panel, id = wx.ID_ANY,
-                                                         label = _('or enter values interactively')),
-                                    proportion=0,
-                                    flag=wx.EXPAND | wx.RIGHT | wx.LEFT | wx.BOTTOM, border=5)
-                    which_sizer.Add(item=ifbb, proportion=0,
-                                    flag=wx.EXPAND | wx.RIGHT | wx.LEFT, border=5)
-                    
                     # A file browse button is a combobox with two children:
                     # A file browse button is a combobox with two children:
                     # a textctl and a button;
                     # a textctl and a button;
                     # we have to target the button here
                     # we have to target the button here
-                    p['wxId'] = [ fbb.GetChildren()[1].GetId(), ifbb.GetId() ]
+                    p['wxId'] = [ fbb.GetChildren()[1].GetId() ]
+
+                    if p.get('age', 'new_file') == 'old_file':
+                        # widget for interactive input
+                        ifbb = wx.TextCtrl(parent = which_panel, id = wx.ID_ANY,
+                                           style = wx.TE_MULTILINE,
+                                           size = (-1, 75))
+                        if p.get('value', '') and os.path.isfile(p['value']):
+                            f = open(p['value'])
+                            ifbb.SetValue(''.join(f.readlines()))
+                            f.close()
+                    
+                        ifbb.Bind(wx.EVT_TEXT, self.OnFileText)
+                        which_sizer.Add(item = wx.StaticText(parent = which_panel, id = wx.ID_ANY,
+                                                             label = _('or enter values interactively')),
+                                        proportion=0,
+                                        flag=wx.EXPAND | wx.RIGHT | wx.LEFT | wx.BOTTOM, border=5)
+                        which_sizer.Add(item=ifbb, proportion=0,
+                                        flag=wx.EXPAND | wx.RIGHT | wx.LEFT, border=5)
+                        p['wxId'].append(ifbb.GetId())
             
             
             if self.parent.GetName() == 'MainFrame' and self.parent.modeler:
             if self.parent.GetName() == 'MainFrame' and self.parent.modeler:
                 parChk = wx.CheckBox(parent = which_panel, id = wx.ID_ANY,
                 parChk = wx.CheckBox(parent = which_panel, id = wx.ID_ANY,