diff --git a/comp/src/gb.form.editor/.hidden/control/texteditor.png b/comp/src/gb.form.editor/.hidden/control/texteditor.png index 012d97488..445172e75 100644 Binary files a/comp/src/gb.form.editor/.hidden/control/texteditor.png and b/comp/src/gb.form.editor/.hidden/control/texteditor.png differ diff --git a/comp/src/gb.form.editor/.src/CDocument.class b/comp/src/gb.form.editor/.src/CDocument.class index afc023e06..c64f95ad6 100644 --- a/comp/src/gb.form.editor/.src/CDocument.class +++ b/comp/src/gb.form.editor/.src/CDocument.class @@ -56,6 +56,9 @@ End Public Sub Clear() + Dim hView As TextEditor + Dim aViews As TextEditor[] + Lines = New String[1] LinesInfo = New CLineInfo[1] LineLength = New Integer[1] @@ -67,6 +70,13 @@ Public Sub Clear() $cBreakpoint = New Collection $cBookmark = New Collection + Try aViews = GetAllViews() + If aViews Then + For Each hView In aViews + hView.Goto(0, 0) + Next + Endif + End Private Function Text_Read() As String diff --git a/comp/src/gb.form.editor/.src/TextEditor.class b/comp/src/gb.form.editor/.src/TextEditor.class index aa3490b66..fa0aa39f4 100644 --- a/comp/src/gb.form.editor/.src/TextEditor.class +++ b/comp/src/gb.form.editor/.src/TextEditor.class @@ -372,7 +372,6 @@ End Private Sub Text_Write(Value As String) - Goto(0, 0) $hDoc.Text = Value Init If $bShowPreview Then $hTimerSideBarRefresh.Trigger @@ -2809,6 +2808,7 @@ Public Sub View_Draw() Dim W, NL As Integer 'Dim hImage As Image Dim hPict As Picture + Dim iCount As Integer If Not $bUpdateHeightAllowed Then $bUpdateHeightAllowed = True @@ -2829,10 +2829,11 @@ Public Sub View_Draw() 'Debug Me.Font.ToString();; Draw.Font.ToString() + iCount = $hDoc.Count NL = $hView.ClientH \ $hRows.H + 1 hClip = Paint.ClipRect - If $hDoc.Count < NL Then Paint.FillRect(hClip.X, hClip.Y, hClip.W, hClip.H, $iBackground) + If iCount < NL Then Paint.FillRect(hClip.X, hClip.Y, hClip.W, hClip.H, $iBackground) iRow = $hRows._FindRowFromPos($hView.ScrollY + hClip.Y) If iRow < 0 Then Return @@ -2871,6 +2872,8 @@ Public Sub View_Draw() Y = YY For I = 0 To iMaxRow iRow = aRow[I] + If iRow >= iCount Then Break + H = $hRows._GetRowHeight(iRow) If H >= $hView.ClientH Or If $bRemoteDisplay Then @@ -2915,9 +2918,11 @@ Public Sub View_Draw() Y = YY For I = 0 To iMaxRow + iRow = aRow[I] + If iRow >= iCount Then Break Paint.Save - H = $hRows._GetRowHeight(aRow[I]) - DrawMargin(XX, Y, $iWidth, H, aRow[I]) + H = $hRows._GetRowHeight(iRow) + DrawMargin(XX, Y, $iWidth, H, iRow) Paint.Restore Y += H Next