[GRASS-SVN] r42574 - grass/trunk/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Jun 17 11:13:22 EDT 2010
Author: martinl
Date: 2010-06-17 15:13:22 +0000 (Thu, 17 Jun 2010)
New Revision: 42574
Modified:
grass/trunk/gui/wxpython/gui_modules/menuform.py
Log:
wxGUI/dialog: generate interactive input area only for old_file
Modified: grass/trunk/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/menuform.py 2010-06-17 15:08:58 UTC (rev 42573)
+++ grass/trunk/gui/wxpython/gui_modules/menuform.py 2010-06-17 15:13:22 UTC (rev 42574)
@@ -1544,27 +1544,29 @@
which_sizer.Add(item=fbb, proportion=0,
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 textctl and a button;
# 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:
parChk = wx.CheckBox(parent = which_panel, id = wx.ID_ANY,
More information about the grass-commit
mailing list