[GRASS-SVN] r62531 - in grass/branches/releasebranch_7_0: . gui/wxpython/gui_core
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Nov 1 15:48:24 PDT 2014
Author: annakrat
Date: 2014-11-01 15:48:24 -0700 (Sat, 01 Nov 2014)
New Revision: 62531
Modified:
grass/branches/releasebranch_7_0/
grass/branches/releasebranch_7_0/gui/wxpython/gui_core/forms.py
Log:
wxGUI/forms: guisection is preferred to requiredwhen organizing options into tab, also red star added to required options to better distiguish them (merge from trunk, r62403)
Property changes on: grass/branches/releasebranch_7_0
___________________________________________________________________
Modified: svn:mergeinfo
- /grass/trunk:62179-62180,62182,62487,62491,62494,62506,62508-62509,62515,62519,62521,62526
+ /grass/trunk:62179-62180,62182,62403,62487,62491,62494,62506,62508-62509,62515,62519,62521,62526
Modified: grass/branches/releasebranch_7_0/gui/wxpython/gui_core/forms.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/gui_core/forms.py 2014-11-01 22:40:30 UTC (rev 62530)
+++ grass/branches/releasebranch_7_0/gui/wxpython/gui_core/forms.py 2014-11-01 22:48:24 UTC (rev 62531)
@@ -812,7 +812,7 @@
self.Bind(wx.EVT_SIZE, self.OnSize)
for task in not_hidden:
- if task.get('required', False):
+ if task.get('required', False) and not task.get('guisection', ''):
# All required go into Main, even if they had defined another guisection
task['guisection'] = _('Required')
if task.get('guisection','') == '':
@@ -941,12 +941,6 @@
tooltip = None
prompt = p.get('prompt', '')
-
- # text style (required -> bold)
- if not p.get('required', False):
- text_style = wx.FONTWEIGHT_NORMAL
- else:
- text_style = wx.FONTWEIGHT_BOLD
# title sizer (description, name, type)
if (len(p.get('values', [])) > 0) and \
@@ -961,10 +955,19 @@
ltype = ','.join(p['key_desc'])
else:
ltype = p['type']
+ # red star for required options
+ if p.get('required', False):
+ required_txt = wx.StaticText(parent=which_panel, label="*")
+ required_txt.SetForegroundColour(wx.RED)
+ required_txt.SetToolTipString(_("This option is required"))
+ else:
+ required_txt = wx.StaticText(parent=which_panel, label="")
rtitle_txt = wx.StaticText(parent = which_panel,
label = '(' + p['name'] + '=' + ltype + ')')
- title_sizer.Add(item = title_txt, proportion = 1,
+ title_sizer.Add(item = title_txt, proportion = 0,
flag = wx.LEFT | wx.TOP | wx.EXPAND, border = 5)
+ title_sizer.Add(item = required_txt, proportion=1,
+ flag = wx.EXPAND, border=0)
title_sizer.Add(item = rtitle_txt, proportion = 0,
flag = wx.ALIGN_RIGHT | wx.RIGHT | wx.TOP, border = 5)
which_sizer.Add(item = title_sizer, proportion = 0,
@@ -980,11 +983,11 @@
if (len(p.get('values', [])) > 0):
valuelist = map(str, p.get('values',[]))
valuelist_desc = map(unicode, p.get('values_desc',[]))
-
+ required_text = "*" if p.get('required', False) else ""
if p.get('multiple', False) and \
p.get('gisprompt',False) == False and \
p.get('type', '') == 'string':
- title_txt.SetLabel(" %s: (%s, %s) " % (title, p['name'], p['type']))
+ title_txt.SetLabel(" %s:%s (%s=%s) " % (title, required_text, p['name'], p['type']))
stSizer = wx.StaticBoxSizer(box = title_txt, orient = wx.VERTICAL)
if valuelist_desc:
hSizer = wx.FlexGridSizer(cols = 1, vgap = 1)
More information about the grass-commit
mailing list