Fixed automatic console rising on w32
authoredouard
Fri, 04 Dec 2009 15:14:32 +0100
changeset 451 73b3913b6d9c
parent 450 18583d13f0fa
child 452 2d0718a05cc7
Fixed automatic console rising on w32
Beremiz.py
--- a/Beremiz.py	Wed Dec 02 20:22:28 2009 +0100
+++ b/Beremiz.py	Fri Dec 04 15:14:32 2009 +0100
@@ -247,12 +247,13 @@
                         
 class LogPseudoFile:
     """ Base class for file like objects to facilitate StdOut for the Shell."""
-    def __init__(self, output):
+    def __init__(self, output, risecall):
         self.red_white = wx.TextAttr("RED", "WHITE")
         self.red_yellow = wx.TextAttr("RED", "YELLOW")
         self.black_white = wx.TextAttr("BLACK", "WHITE")
         self.default_style = None
         self.output = output
+        self.risecall = risecall
         # to prevent rapid fire on rising log panel
         self.rising_timer = 0
 
@@ -268,7 +269,7 @@
         self.output.Thaw()
         newtime = time.time()
         if newtime - self.rising_timer > 1:
-            self.output.Rise()
+            self.risecall()
         self.rising_timer = newtime 
 
     def write_warning(self, s):
@@ -383,7 +384,7 @@
         self.LogConsole = wx.TextCtrl(id=ID_BEREMIZLOGCONSOLE, value='',
                   name='LogConsole', parent=self.BottomNoteBook, pos=wx.Point(0, 0),
                   size=wx.Size(0, 0), style=wx.TE_MULTILINE|wx.TE_RICH2)
-        self.LogConsole.Rise = self.RiseLogConsole 
+        self.LogConsole.SetRise(self.RiseLogConsole)
         self.LogConsole.Bind(wx.EVT_LEFT_DCLICK, self.OnLogConsoleDClick)
         self.BottomNoteBook.AddPage(self.LogConsole, _("Log Console"))
         
@@ -392,8 +393,7 @@
     def __init__(self, parent, projectOpen=None, buildpath=None, plugin_root=None, debug=True):
         IDEFrame.__init__(self, parent, debug)
         self.Config = wx.ConfigBase.Get()
-        
-        self.Log = LogPseudoFile(self.LogConsole)
+        self.Log = LogPseudoFile(self.LogConsole,self.RiseLogConsole)
         
         self.local_runtime = None
         self.runtime_port = None