TextViewer.py
changeset 90 2245e8776086
parent 80 c798a68c5560
child 98 ec5d7af033d8
--- a/TextViewer.py	Mon Sep 10 16:12:29 2007 +0200
+++ b/TextViewer.py	Mon Sep 10 18:16:07 2007 +0200
@@ -118,7 +118,10 @@
         
         # Indicators styles
         self.IndicatorSetStyle(0, wx.stc.STC_INDIC_SQUIGGLE)
-        self.IndicatorSetForeground(0, wx.RED)
+        if window and controler:
+            self.IndicatorSetForeground(0, wx.RED)
+        else:
+            self.IndicatorSetForeground(0, wx.WHITE)
         
         # Line numbers in the margin
         self.SetMarginType(1, wx.stc.STC_MARGIN_NUMBER)
@@ -137,13 +140,13 @@
         self.TextSyntax = "ST"
         self.CurrentAction = None
         
-        self.Parent = window
+        self.ParentWindow = window
         self.Controler = controler
 
         self.SetModEventMask(wx.stc.STC_MOD_BEFOREINSERT|wx.stc.STC_MOD_BEFOREDELETE)
 
         self.Bind(wx.stc.EVT_STC_STYLENEEDED, self.OnStyleNeeded, id=ID_TEXTVIEWER)
-        if window and controler :
+        if window and controler:
             self.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown)
             self.Bind(wx.stc.EVT_STC_DO_DROP, self.OnDoDrop, id=ID_TEXTVIEWER)
             self.Bind(wx.EVT_KILL_FOCUS, self.OnKillFocus)
@@ -207,13 +210,13 @@
     # Buffer the last model state
     def RefreshBuffer(self):
         self.Controler.BufferProject()
-        self.Parent.RefreshTitle()
-        self.Parent.RefreshEditMenu()
+        self.ParentWindow.RefreshTitle()
+        self.ParentWindow.RefreshEditMenu()
     
     def StartBuffering(self):
         self.Controler.StartBuffering()
-        self.Parent.RefreshTitle()
-        self.Parent.RefreshEditMenu()
+        self.ParentWindow.RefreshTitle()
+        self.ParentWindow.RefreshEditMenu()
     
     def ResetBuffer(self):
         if self.CurrentAction != None: