|
@@ -75,6 +75,11 @@ from wx.lib.expando import ExpandoTextCtrl, EVT_ETC_LAYOUT_NEEDED
|
|
from wx.lib.newevent import NewEvent
|
|
from wx.lib.newevent import NewEvent
|
|
|
|
|
|
try:
|
|
try:
|
|
|
|
+ import wx.lib.agw.floatspin as FS
|
|
|
|
+except ImportError:
|
|
|
|
+ FS = None
|
|
|
|
+
|
|
|
|
+try:
|
|
import xml.etree.ElementTree as etree
|
|
import xml.etree.ElementTree as etree
|
|
except ImportError:
|
|
except ImportError:
|
|
import elementtree.ElementTree as etree # Python <= 2.4
|
|
import elementtree.ElementTree as etree # Python <= 2.4
|
|
@@ -1252,7 +1257,7 @@ class cmdPanel(wx.Panel):
|
|
title_txt.SetLabel("%s. %s %s" % (title, _('Valid range'),
|
|
title_txt.SetLabel("%s. %s %s" % (title, _('Valid range'),
|
|
str(valuelist[0]) + ':'))
|
|
str(valuelist[0]) + ':'))
|
|
|
|
|
|
- if p.get('type','') == 'integer' and \
|
|
|
|
|
|
+ if p.get('type', '') == 'integer' and \
|
|
p.get('multiple','no') == 'no':
|
|
p.get('multiple','no') == 'no':
|
|
|
|
|
|
# for multiple integers use textctrl instead of spinsctrl
|
|
# for multiple integers use textctrl instead of spinsctrl
|
|
@@ -1304,7 +1309,7 @@ class cmdPanel(wx.Panel):
|
|
|
|
|
|
title_txt.SetLabel(title + ':' )
|
|
title_txt.SetLabel(title + ':' )
|
|
if p.get('multiple','yes') == 'yes' or \
|
|
if p.get('multiple','yes') == 'yes' or \
|
|
- p.get('type', 'string') in ('string', 'float') or \
|
|
|
|
|
|
+ p.get('type', 'string') == 'string' or \
|
|
len(p.get('key_desc', [])) > 1:
|
|
len(p.get('key_desc', [])) > 1:
|
|
txt3 = wx.TextCtrl(parent=which_panel, value = p.get('default',''))
|
|
txt3 = wx.TextCtrl(parent=which_panel, value = p.get('default',''))
|
|
|
|
|
|
@@ -1316,15 +1321,35 @@ class cmdPanel(wx.Panel):
|
|
else:
|
|
else:
|
|
minValue = -1e9
|
|
minValue = -1e9
|
|
maxValue = 1e9
|
|
maxValue = 1e9
|
|
- txt3 = wx.SpinCtrl(parent=which_panel, value=p.get('default',''),
|
|
|
|
- size=globalvar.DIALOG_SPIN_SIZE,
|
|
|
|
- min=minValue, max=maxValue)
|
|
|
|
- if p.get('value','') != '':
|
|
|
|
- txt3.SetValue(int(p['value'])) # parameter previously set
|
|
|
|
-
|
|
|
|
- txt3.Bind(wx.EVT_SPINCTRL, self.OnSetValue)
|
|
|
|
- txt3.Bind(wx.EVT_TEXT, self.OnSetValue)
|
|
|
|
- style = wx.BOTTOM | wx.LEFT | wx.RIGHT
|
|
|
|
|
|
+ if p.get('type', '') == 'integer':
|
|
|
|
+ txt3 = wx.SpinCtrl(parent=which_panel, value=p.get('default',''),
|
|
|
|
+ size=globalvar.DIALOG_SPIN_SIZE,
|
|
|
|
+ min=minValue, max=maxValue)
|
|
|
|
+ style = wx.BOTTOM | wx.LEFT | wx.RIGHT
|
|
|
|
+
|
|
|
|
+ if p.get('value', '') != '':
|
|
|
|
+ txt3.SetValue(int(p['value'])) # parameter previously set
|
|
|
|
+
|
|
|
|
+ txt3.Bind(wx.EVT_SPINCTRL, self.OnSetValue)
|
|
|
|
+ elif FS:
|
|
|
|
+ txt3 = FS.FloatSpin(parent = which_panel, id = wx.ID_ANY,
|
|
|
|
+ size = globalvar.DIALOG_SPIN_SIZE,
|
|
|
|
+ min_val = minValue, max_val = maxValue)
|
|
|
|
+ txt3.SetDigits(3)
|
|
|
|
+ style = wx.BOTTOM | wx.LEFT | wx.RIGHT
|
|
|
|
+
|
|
|
|
+ if p.get('value', '') != '':
|
|
|
|
+ txt3.SetValue(float(p['value'])) # parameter previously set
|
|
|
|
+
|
|
|
|
+ txt3.Bind(FS.EVT_FLOATSPIN, self.OnSetValue)
|
|
|
|
+ else:
|
|
|
|
+ txt3 = wx.TextCtrl(parent=which_panel, value = p.get('default',''))
|
|
|
|
+ style = wx.EXPAND | wx.BOTTOM | wx.LEFT | wx.RIGHT
|
|
|
|
+
|
|
|
|
+ if p.get('value', '') != '':
|
|
|
|
+ txt3.SetValue(str(p['value'])) # parameter previously set
|
|
|
|
+
|
|
|
|
+ # txt3.Bind(wx.EVT_TEXT, self.OnSetValue)
|
|
|
|
|
|
which_sizer.Add(item=txt3, proportion=0,
|
|
which_sizer.Add(item=txt3, proportion=0,
|
|
flag=style, border=5)
|
|
flag=style, border=5)
|