From: Justin Nesselrotte Date: Sat, 20 Dec 2014 20:00:13 +0000 (-0600) Subject: Workaround for temperature control issue X-Git-Tag: 14.09-1.18~18^2~1 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=6e374711e03069c7478b45560b1d7969ec3dc8e7;p=cura.git Workaround for temperature control issue Also, removing a semicolon --- diff --git a/Cura/gui/configBase.py b/Cura/gui/configBase.py index f1be2783..0c211c84 100644 --- a/Cura/gui/configBase.py +++ b/Cura/gui/configBase.py @@ -22,7 +22,7 @@ class configPanelBase(wx.Panel): return leftConfigPanel, rightConfigPanel def CreateConfigPanel(self, parent): - configPanel = wx.Panel(parent); + configPanel = wx.Panel(parent) leftConfigPanel = wx.Panel(configPanel) rightConfigPanel = wx.Panel(configPanel) diff --git a/Cura/gui/printWindow.py b/Cura/gui/printWindow.py index 2c905b72..13ac87f5 100644 --- a/Cura/gui/printWindow.py +++ b/Cura/gui/printWindow.py @@ -136,14 +136,23 @@ class printWindowPlugin(wx.Frame): x, y, w, h = self._getColoredRect(r, g, b) if x < 0: return + + def run_command(spinner): + value = spinner.GetValue() + if spinner.last_value != value: + if spinner.last_value != '' and value != 0: + spinner.command(spinner.data % value) + spinner.last_value = value + spinner = wx.SpinCtrl(self, -1, style=wx.TE_PROCESS_ENTER) spinner.SetRange(0, 300) spinner.SetPosition((x, y)) spinner.SetSize((w, h)) spinner.command = command spinner.data = data + spinner.last_value = '' self._buttonList.append(spinner) - self.Bind(wx.EVT_SPINCTRL, lambda e: command(data % (spinner.GetValue())), spinner) + self.Bind(wx.EVT_SPINCTRL, lambda e: run_command(spinner), spinner) def _getColoredRect(self, r, g, b): for x in xrange(0, self._mapImage.GetWidth()):