[GRASS-SVN] r32665 -
grass/branches/develbranch_6/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Aug 10 08:46:06 EDT 2008
Author: martinl
Date: 2008-08-10 08:46:06 -0400 (Sun, 10 Aug 2008)
New Revision: 32665
Modified:
grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py
Log:
wxGUI: some v.build-related fixes in goutput module
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py 2008-08-10 12:44:13 UTC (rev 32664)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py 2008-08-10 12:46:06 UTC (rev 32665)
@@ -382,53 +382,50 @@
elif type == 'error':
message = 'ERROR: ' + message
- # p1 = self.cmd_output.GetCurrentPos()
p1 = self.cmd_output.GetEndStyled()
self.cmd_output.GotoPos(p1)
- self.linePos = self.cmd_output.GetCurrentPos()
- pc = -1
-
if '\b' in message:
- pc = p1
+ if self.linepos < 0:
+ self.linepos = p1
last_c = ''
for c in message:
if c == '\b':
- pc -= 1
+ self.linepos -= 1
else:
if c == '\r':
- self.cmd_output.SetCurrentPos(self.linePos)
+ pos = self.cmd_output.GetCurLine()[1]
+ # self.cmd_output.SetCurrentPos(pos)
else:
- self.cmd_output.SetCurrentPos(pc)
+ self.cmd_output.SetCurrentPos(self.linepos)
self.cmd_output.ReplaceSelection(c)
- pc = self.cmd_output.GetCurrentPos()
+ self.linepos = self.cmd_output.GetCurrentPos()
if c != ' ':
last_c = c
if last_c not in ('0123456789'):
self.cmd_output.AddTextWrapped('\n', wrap=None)
- pc = -1
+ self.linepos = -1
else:
+ self.linepos = -1 # don't force position
if os.linesep not in message:
self.cmd_output.AddTextWrapped(message, wrap=60)
else:
self.cmd_output.AddTextWrapped(message, wrap=None)
p2 = self.cmd_output.GetCurrentPos()
-
- self.cmd_output.StartStyling(p1, 0xff)
- if type == 'error':
- self.cmd_output.SetStyling(p2 - p1, self.cmd_output.StyleError)
- elif type == 'warning':
- self.cmd_output.SetStyling(p2 - p1, self.cmd_output.StyleWarning)
- elif type == 'message':
- self.cmd_output.SetStyling(p2 - p1, self.cmd_output.StyleMessage)
- else: # unknown
- self.cmd_output.SetStyling(p2 - p1, self.cmd_output.StyleUnknown)
-
- if pc > 0:
- self.cmd_output.SetCurrentPos(pc)
-
+ if p2 >= p1:
+ self.cmd_output.StartStyling(p1, 0xff)
+
+ if type == 'error':
+ self.cmd_output.SetStyling(p2 - p1, self.cmd_output.StyleError)
+ elif type == 'warning':
+ self.cmd_output.SetStyling(p2 - p1, self.cmd_output.StyleWarning)
+ elif type == 'message':
+ self.cmd_output.SetStyling(p2 - p1, self.cmd_output.StyleMessage)
+ else: # unknown
+ self.cmd_output.SetStyling(p2 - p1, self.cmd_output.StyleUnknown)
+
self.cmd_output.EnsureCaretVisible()
def OnCmdProgress(self, event):
More information about the grass-commit
mailing list