X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1f780e48af479e7bf9a07eaaa1ab6b41f1ffb17b..8d38bd1d05770f7c7837abcb71ff50b98aefec14:/wxPython/samples/ide/activegrid/tool/PythonEditor.py diff --git a/wxPython/samples/ide/activegrid/tool/PythonEditor.py b/wxPython/samples/ide/activegrid/tool/PythonEditor.py index 06236d126c..6496f7f58a 100644 --- a/wxPython/samples/ide/activegrid/tool/PythonEditor.py +++ b/wxPython/samples/ide/activegrid/tool/PythonEditor.py @@ -49,6 +49,11 @@ class PythonDocument(CodeEditor.CodeDocument): class PythonView(CodeEditor.CodeView): + def GetCtrlClass(self): + """ Used in split window to instantiate new instances """ + return PythonCtrl + + def ProcessUpdateUIEvent(self, event): if not self.GetCtrl(): return False @@ -62,11 +67,6 @@ class PythonView(CodeEditor.CodeView): return CodeEditor.CodeView.ProcessUpdateUIEvent(self, event) - def GetCtrlClass(self): - """ Used in split window to instantiate new instances """ - return PythonCtrl - - def OnActivateView(self, activate, activeView, deactiveView): STCTextEditor.TextView.OnActivateView(self, activate, activeView, deactiveView) if activate: @@ -345,8 +345,8 @@ class PythonService(CodeEditor.CodeService): class PythonCtrl(CodeEditor.CodeCtrl): - def __init__(self, parent, ID = -1, style = wx.NO_FULL_REPAINT_ON_RESIZE): - CodeEditor.CodeCtrl.__init__(self, parent, ID, style) + def __init__(self, parent, id=-1, style=wx.NO_FULL_REPAINT_ON_RESIZE): + CodeEditor.CodeCtrl.__init__(self, parent, id, style) self.SetProperty("tab.timmy.whinge.level", "1") self.SetProperty("fold.comment.python", "1") self.SetProperty("fold.quotes.python", "1") @@ -516,6 +516,7 @@ class PythonCtrl(CodeEditor.CodeCtrl): if doExtraIndent or len(textNoTrailingSpaces) and textNoTrailingSpaces[-1] == ':': spaces = spaces + ' ' * self.GetIndent() self.AddText('\n' + spaces) + self.EnsureCaretVisible() # Callback for tokenizer in self.DoIndent @@ -581,7 +582,6 @@ class PythonOptionsPanel(wx.Panel): # Icon Bitmaps - generated by encode_bitmaps.py #---------------------------------------------------------------------------- from wx import ImageFromStream, BitmapFromImage -from wx import EmptyIcon import cStringIO @@ -609,6 +609,4 @@ def getPythonImage(): return ImageFromStream(stream) def getPythonIcon(): - icon = EmptyIcon() - icon.CopyFromBitmap(getPythonBitmap()) - return icon + return wx.IconFromBitmap(getPythonBitmap())