Commit 5fa144a7 authored by Guillaume Seguin's avatar Guillaume Seguin

Simplify tool change when using only 2 extruders

parent f4cbf671
...@@ -141,13 +141,27 @@ def add_extra_controls(self, root, parentpanel, extra_buttons = None): ...@@ -141,13 +141,27 @@ def add_extra_controls(self, root, parentpanel, extra_buttons = None):
ebuttonssizer = wx.BoxSizer(wx.HORIZONTAL) ebuttonssizer = wx.BoxSizer(wx.HORIZONTAL)
if root.settings.extruders > 1: if root.settings.extruders > 1:
ebuttonssizer.Add(wx.StaticText(ebuttonspanel, -1, _("Tool:")), flag = wx.ALIGN_CENTER) ebuttonssizer.Add(wx.StaticText(ebuttonspanel, -1, _("Tool:")), flag = wx.ALIGN_CENTER)
choices = [str(i) for i in range(0, root.settings.extruders)] if root.settings.extruders == 2:
root.extrudersel = wx.ComboBox(ebuttonspanel, -1, choices = choices, root.extrudersel = wx.Button(ebuttonspanel, -1, "0", style = wx.BU_EXACTFIT)
style = wx.CB_DROPDOWN | wx.CB_READONLY,
size = (50, -1)) def extrudersel_cb(event):
root.extrudersel.SetToolTip(wx.ToolTip("Select current extruder")) if root.extrudersel.GetLabel() == "1":
root.extrudersel.SetValue(choices[0]) new = "0"
root.extrudersel.Bind(wx.EVT_COMBOBOX, root.tool_change) else:
new = "1"
root.extrudersel.SetLabel(new)
root.tool_change(event)
root.extrudersel.Bind(wx.EVT_BUTTON, extrudersel_cb)
root.extrudersel.GetValue = root.extrudersel.GetLabel
root.extrudersel.SetValue = root.extrudersel.SetLabel
else:
choices = [str(i) for i in range(0, root.settings.extruders)]
root.extrudersel = wx.ComboBox(ebuttonspanel, -1, choices = choices,
style = wx.CB_DROPDOWN | wx.CB_READONLY,
size = (50, -1))
root.extrudersel.SetToolTip(wx.ToolTip("Select current extruder"))
root.extrudersel.SetValue(choices[0])
root.extrudersel.Bind(wx.EVT_COMBOBOX, root.tool_change)
root.printerControls.append(root.extrudersel) root.printerControls.append(root.extrudersel)
ebuttonssizer.Add(root.extrudersel) ebuttonssizer.Add(root.extrudersel)
ebuttonspanel.SetSizer(ebuttonssizer) ebuttonspanel.SetSizer(ebuttonssizer)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment