diff options
| author | Kaalleen <36401965+kaalleen@users.noreply.github.com> | 2021-03-14 09:38:36 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-14 09:38:36 +0100 |
| commit | 21614c7c3ae46fbfa229755916aec433faba0c95 (patch) | |
| tree | 8a676049b49ba83890f320ab219b7b96aedc9aac /lib/extensions/params.py | |
| parent | 3dd767917d8e604bf4a1f3b41c5c4fc506fa2b96 (diff) | |
add lock stitches select box (#1076)
Co-authored-by: Lex Neva <github.com@lexneva.name>
Diffstat (limited to 'lib/extensions/params.py')
| -rw-r--r-- | lib/extensions/params.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/extensions/params.py b/lib/extensions/params.py index 910941fe..b03ea973 100644 --- a/lib/extensions/params.py +++ b/lib/extensions/params.py @@ -153,7 +153,11 @@ class ParamsTab(ScrolledPanel): for name, input in self.param_inputs.items(): if input in self.changed_inputs and input != self.toggle_checkbox: - values[name] = input.GetValue() + try: + values[name] = input.GetValue() + except AttributeError: + # dropdown + values[name] = input.GetSelection() return values @@ -271,6 +275,10 @@ class ParamsTab(ScrolledPanel): input.SetValue(param.values[0]) input.Bind(wx.EVT_CHECKBOX, self.changed) + elif param.type == 'dropdown': + input = wx.Choice(self, wx.ID_ANY, choices=param.options) + input.SetSelection(int(param.values[0])) + input.Bind(wx.EVT_CHOICE, self.changed) elif len(param.values) > 1: input = wx.ComboBox(self, wx.ID_ANY, choices=sorted(str(value) for value in param.values), style=wx.CB_DROPDOWN) input.Bind(wx.EVT_COMBOBOX, self.changed) |
