# HG changeset patch # User Laurent Bessard # Date 1367831705 -7200 # Node ID e91f2c8d6f51206950e1777c126e8002ec412f50 # Parent 5f612651d2271fb052f6c94c30920f0a4d317db1 Fixed bugs in CustomStyledTextCtrl diff -r 5f612651d227 -r e91f2c8d6f51 controls/CustomStyledTextCtrl.py --- a/controls/CustomStyledTextCtrl.py Mon May 06 10:28:47 2013 +0200 +++ b/controls/CustomStyledTextCtrl.py Mon May 06 11:15:05 2013 +0200 @@ -45,7 +45,7 @@ class CustomStyledTextCtrl(wx.stc.StyledTextCtrl): def __init__(self, *args, **kwargs): - wx.stc.StyledTextCtrl(self, *args, **kwargs) + wx.stc.StyledTextCtrl.__init__(self, *args, **kwargs) self.Bind(wx.EVT_MOTION, self.OnMotion) @@ -55,22 +55,18 @@ x, y = event.GetPosition() margin_width = reduce( lambda x, y: x + y, - [self.LogConsole.GetMarginWidth(i) + [self.GetMarginWidth(i) for i in xrange(3)], 0) if x <= margin_width: - self.LogConsole.SetCursor(wx.StockCursor(wx.CURSOR_ARROW)) + self.SetCursor(wx.StockCursor(wx.CURSOR_ARROW)) else: - self.LogConsole.SetCursor(wx.StockCursor(wx.CURSOR_IBEAM)) + self.SetCursor(wx.StockCursor(wx.CURSOR_IBEAM)) + else: + event.Skip() else: event.Skip() def AppendText(self, text): - last_position = self.GetLength() - current_selection = self.GetSelection() - self.GotoPos(last_position) + self.GotoPos(self.GetLength()) self.AddText(text) - if current_selection[0] != last_position: - self.SetSelection(*current_selection) - else: - self.ScrollToLine(self.GetLineCount()) diff -r 5f612651d227 -r e91f2c8d6f51 controls/__init__.py --- a/controls/__init__.py Mon May 06 10:28:47 2013 +0200 +++ b/controls/__init__.py Mon May 06 11:15:05 2013 +0200 @@ -39,3 +39,4 @@ from TextCtrlAutoComplete import TextCtrlAutoComplete from FolderTree import FolderTree from LogViewer import LogViewer +from CustomStyledTextCtrl import CustomStyledTextCtrl