summaryrefslogtreecommitdiff
path: root/lib/extensions/params.py
diff options
context:
space:
mode:
authorLex Neva <github.com@lexneva.name>2023-01-17 21:44:23 -0500
committerLex Neva <github.com@lexneva.name>2023-02-20 15:27:55 -0500
commit847e133f97d570e2967dfa7dcfc16a212dc2bbbc (patch)
treedf2fb20547bea95ad437155a1fac91290a9d07f3 /lib/extensions/params.py
parente2965e78f03fb41c9a02c92ef120caf038b837ae (diff)
meander fill: more work
Diffstat (limited to 'lib/extensions/params.py')
-rw-r--r--lib/extensions/params.py21
1 files changed, 17 insertions, 4 deletions
diff --git a/lib/extensions/params.py b/lib/extensions/params.py
index 1262ceb6..a34aeeae 100644
--- a/lib/extensions/params.py
+++ b/lib/extensions/params.py
@@ -190,8 +190,13 @@ class ParamsTab(ScrolledPanel):
try:
values[name] = input.GetValue()
except AttributeError:
- # dropdown
- values[name] = input.GetSelection()
+ param = self.dict_of_choices[name]['param']
+ if param.type == 'dropdown':
+ # dropdown
+ values[name] = input.GetSelection()
+ elif param.type == 'select':
+ selection = input.GetSelection()
+ values[name] = param.options[selection]
return values
@@ -368,9 +373,17 @@ class ParamsTab(ScrolledPanel):
input.SetValue(param.values[0])
input.Bind(wx.EVT_CHECKBOX, self.changed)
- elif param.type == 'dropdown':
+ elif param.type in ('dropdown', 'select'):
input = wx.Choice(self, wx.ID_ANY, choices=param.options)
- input.SetSelection(int(param.values[0]))
+
+ if param.type == 'dropdown':
+ input.SetSelection(int(param.values[0]))
+ else:
+ try:
+ input.SetSelection(param.options.index(param.values[0]))
+ except ValueError:
+ input.SetSelection(param.default)
+
input.Bind(wx.EVT_CHOICE, self.changed)
input.Bind(wx.EVT_CHOICE, self.update_choice_state)
self.dict_of_choices[param.name] = {