From 00e83980de3addd69c99b296abc83335d627ff21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Tue, 16 Jun 2015 23:35:19 +0000 Subject: [PATCH] [GB.FORM.EDITOR] * BUG: TextEditor: Correctly draw the margin background when scrolling. git-svn-id: svn://localhost/gambas/trunk@7137 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- comp/src/gb.form.editor/.info | 8 ++--- .../src/gb.form.editor/.src/FTestEditor.class | 6 ++-- comp/src/gb.form.editor/.src/FTestEditor.form | 1 - comp/src/gb.form.editor/.src/TextEditor.class | 31 ++++++++++++++----- 4 files changed, 30 insertions(+), 16 deletions(-) diff --git a/comp/src/gb.form.editor/.info b/comp/src/gb.form.editor/.info index ef91c869b..c7bd61d3d 100644 --- a/comp/src/gb.form.editor/.info +++ b/comp/src/gb.form.editor/.info @@ -337,10 +337,6 @@ FindNextLimit m i (Y)i -_GetRowHeight -m -i -(Y)i CollapseAll m @@ -393,6 +389,10 @@ _AfterRemove m (Y1)i(Y2)i +_GetRowHeight +m +i +(Y)i View_Draw m diff --git a/comp/src/gb.form.editor/.src/FTestEditor.class b/comp/src/gb.form.editor/.src/FTestEditor.class index dbc9b5c85..a84ad4699 100644 --- a/comp/src/gb.form.editor/.src/FTestEditor.class +++ b/comp/src/gb.form.editor/.src/FTestEditor.class @@ -7,17 +7,17 @@ Public Sub Form_Open() 'Image.Debug = True - TextEditor1.Highlight = "gambas" + 'TextEditor1.Highlight = "html" 'TextEditor1.Highlight = "C++" + TextEditor1.Highlight = "gambas" 'TextEditor1.Load("~/gambas/3.0/trunk/comp/src/gb.form.editor/.src/TextEditor.class", True) 'TextEditor1.Load("/var/log/thttpd/debug.log.old") 'TextEditor1.Load("~/cosme/style.css") - 'TextEditor1.Text = File.Load("~/gambas/3.0/trunk/app/src/gambas3/.src/Project.module") + TextEditor1.Load("~/gambas/3.0/trunk/app/src/gambas3/.src/Project.module") 'TextEditor1.Load("~/gambas/3.0/trunk/gb.qt4/src/CWidget.cpp") 'TextEditor1.Load("~/gambas/3.0/trunk/main/share/gb_reserved_temp.h") 'TextEditor1.Goto(0, TextEditor1.Count - 1) - TextEditor1.Load("~/asap/guygle/trunk/gambas/guygle.cgi/.src/CFiche.class") 'TextEditor1.Highlight = "webpage" 'TextEditor1.Load("test.html") diff --git a/comp/src/gb.form.editor/.src/FTestEditor.form b/comp/src/gb.form.editor/.src/FTestEditor.form index bc1993eeb..1b807c8f9 100644 --- a/comp/src/gb.form.editor/.src/FTestEditor.form +++ b/comp/src/gb.form.editor/.src/FTestEditor.form @@ -29,7 +29,6 @@ Font = Font["Gambas,10"] Border = False TabSize = 8 - Wrap = True ShowPosition = True ShowLimit = True ShowCurrent = True diff --git a/comp/src/gb.form.editor/.src/TextEditor.class b/comp/src/gb.form.editor/.src/TextEditor.class index 7911146de..e9f2f12bb 100644 --- a/comp/src/gb.form.editor/.src/TextEditor.class +++ b/comp/src/gb.form.editor/.src/TextEditor.class @@ -1047,6 +1047,8 @@ Private Sub FindLargestLine() As Integer Dim W As Integer Dim WM As Integer = -1 + If $hDoc.Count >= 10000 Then Inc Application.Busy + For I = 0 To $hDoc.Count - 1 W = LinePos(I).X If W > WM Then @@ -1055,6 +1057,8 @@ Private Sub FindLargestLine() As Integer Endif Next + If $hDoc.Count >= 10000 Then Dec Application.Busy + Return WM End @@ -1255,20 +1259,27 @@ Public Sub View_KeyPress() Case Key.PageUp 'Y = RealToView($Y) - Y = $hRows._FindRowFromPos($hRows._GetRowY($Y) + $hRows._GetRowHeight($Y) - $hView.ClientH) + 'Y = $hRows._FindRowFromPos($hRows._GetRowY($Y) + $hRows._GetRowHeight($Y) - $hView.ClientH) 'Y = ViewToReal(Y) - Goto($X, Max(0, Y), Key.Shift) + 'Goto($X, Max(0, Y), Key.Shift) + If Key.Normal Then + GotoXY($X0 + $MW - $hView.ScrollX, $hRows._GetRowY($Y) + $XY.Y - $hView.ClientH - $hView.ScrollY, Key.Shift) + Endif Case Key.PageDown 'Y = RealToView($Y) - Y = $hRows._FindRowFromPos($hRows._GetRowY($Y) + $hView.ClientH) + 'Y = $hRows._FindRowFromPos($hRows._GetRowY($Y) + $hView.ClientH) 'Y = ViewToReal(Y) - If Y >= 0 Then - Goto($X, Y, Key.Shift) - Else - Goto($X, $hDoc.Max, Key.Shift) + 'If Y >= 0 Then + 'Goto($X, Y, Key.Shift) + 'Else + 'Goto($X, $hDoc.Max, Key.Shift) + 'Endif + If Key.Normal Then + GotoXY($X0 + $MW - $hView.ScrollX, $hRows._GetRowY($Y) + $XY.Y + $hView.ClientH - $hView.ScrollY, Key.Shift) Endif + Case Key.Enter, Key.Return If $bShowExpand Then @@ -2344,7 +2355,7 @@ Public Sub View_Draw() W = $MW If $bShowModified Then W -= 4 - If W > 0 Then Paint.FillRect(XX, hClip.Y, W, hClip.H, Color.SetAlpha($iLimitColor, &HC0)) + If W > 0 Then Paint.FillRect(XX + $hView.ScrollX, hClip.Y, W, hClip.H, Color.SetAlpha($iLimitColor, &HC0)) Y = YY For I = 0 To iMaxRow @@ -4199,6 +4210,8 @@ Public Sub TimerHeight_Timer() CY = $Y Endif + If $hDoc.Count >= 10000 Then Inc Application.Busy + $bNoResizeContents = True For Y = 0 To $hDoc.Max _UpdateLineHeight(Y) @@ -4220,6 +4233,8 @@ Public Sub TimerHeight_Timer() $hTimerHeight = Null Endif + If $hDoc.Count >= 10000 Then Dec Application.Busy + End Private Function Wrap_Read() As Boolean