chiark / gitweb /
Fixes #95
authorFerdi van der Werf <efcm@vdwerf.eu>
Fri, 11 May 2012 00:31:18 +0000 (02:31 +0200)
committerFerdi van der Werf <efcm@vdwerf.eu>
Fri, 11 May 2012 00:31:18 +0000 (02:31 +0200)
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
Cura/gui/gcodeTextArea.py

index 144f3d94175a7f7f9174bd3ef7a4421b711f3caf..c47772d72e1a319e6828f1daa10a08b816d19d44 100644 (file)
@@ -1,4 +1,4 @@
-import wx\r
+import wx,wx.stc\r
 import sys,math,threading,os\r
 \r
 from gui import gcodeTextArea\r
@@ -20,6 +20,7 @@ class alterationPanel(wx.Panel):
                self.list.SetSelection(0)\r
                self.Bind(wx.EVT_LISTBOX, self.OnSelect, self.list)\r
                self.textArea.Bind(wx.EVT_KILL_FOCUS, self.OnFocusLost, self.textArea)\r
+               self.textArea.Bind(wx.stc.EVT_STC_CHANGE, self.OnFocusLost, self.textArea)\r
                \r
                sizer = wx.GridBagSizer()\r
                sizer.Add(self.list, (0,0), span=(1,1), flag=wx.EXPAND)\r
index 5487241f009779d68b85671c005a9e0fca05aabb..b8fc86f4032627f3448a2c074f2ae436c0004e7e 100644 (file)
@@ -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)