From fbc9af3233321c14c876247d422801f55a21f760 Mon Sep 17 00:00:00 2001 From: Ferdi van der Werf Date: Fri, 11 May 2012 02:31:18 +0200 Subject: [PATCH] Fixes #95 wx.EVT_KILL_FOCUS is not fired on OSX, so we have to use a different event to save. I thought EVT_STC_CHANGE of wx.stc would be a good choice. See http://www.yellowbrain.com/stc/events.html#EVT_STC_CHANGE Altered gcodeTextArea slightly to use the new gcodeTextArea on OSX as well. --- Cura/gui/alterationPanel.py | 3 ++- Cura/gui/gcodeTextArea.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Cura/gui/alterationPanel.py b/Cura/gui/alterationPanel.py index 144f3d94..c47772d7 100644 --- a/Cura/gui/alterationPanel.py +++ b/Cura/gui/alterationPanel.py @@ -1,4 +1,4 @@ -import wx +import wx,wx.stc import sys,math,threading,os from gui import gcodeTextArea @@ -20,6 +20,7 @@ class alterationPanel(wx.Panel): self.list.SetSelection(0) self.Bind(wx.EVT_LISTBOX, self.OnSelect, self.list) self.textArea.Bind(wx.EVT_KILL_FOCUS, self.OnFocusLost, self.textArea) + self.textArea.Bind(wx.stc.EVT_STC_CHANGE, self.OnFocusLost, self.textArea) sizer = wx.GridBagSizer() sizer.Add(self.list, (0,0), span=(1,1), flag=wx.EXPAND) diff --git a/Cura/gui/gcodeTextArea.py b/Cura/gui/gcodeTextArea.py index 5487241f..b8fc86f4 100644 --- a/Cura/gui/gcodeTextArea.py +++ b/Cura/gui/gcodeTextArea.py @@ -3,7 +3,7 @@ import sys,math,os from util import profile -if sys.platform == 'darwin': +if False and sys.platform == 'darwin': class GcodeTextArea(wx.TextCtrl): def __init__(self, parent): super(GcodeTextArea, self).__init__(parent, style=wx.TE_MULTILINE|wx.TE_DONTWRAP|wx.TE_PROCESS_TAB) -- 2.30.2