TerminalView: Characters attributes are correctly kept when the screen size changes.

[GB.FORM.TERMINAL]
* BUG: TerminalView: Characters attributes are correctly kept when the screen size changes.
This commit is contained in:
Benoît Minisini 2023-04-19 19:56:37 +02:00
parent ddf2d2bd8d
commit 8d66be984d
7 changed files with 28 additions and 8 deletions

View file

@ -1,6 +1,6 @@
[Component]
Key=gb.form.terminal
Version=3.17.90
Version=3.18.90
Authors=Benoît Minisini,Fabien Bodard
Needs=Form
Requires=gb.term

View file

@ -2,7 +2,7 @@
Title=Gambas Terminal control
Startup=FTestTerminalView
Icon=.hidden/control/terminalview.png
Version=3.17.90
Version=3.18.90
VersionFile=1
Component=gb.image
Component=gb.gui

View file

@ -28,7 +28,7 @@ Private Sub Uncompress()
aAttr.Insert(aTemp)
Next
'If aAttr.Count > String.Len(Text) Then Stop
'If aAttr.Count > Length Then Stop
Attr = aAttr
$bCompressed = False
@ -43,7 +43,7 @@ Private Sub Compress(bFull As Boolean)
Dim iCount As Integer
Dim aAttr As New Long[]
For I = 0 To Attr.Max
For I = 0 To Min(Length - 1, Attr.Max)
iAttr = Attr[I]
If iAttr = iOldAttr And If iCount < 128 Then
@ -198,3 +198,20 @@ Public Sub Clear()
$bCompressed = False
End
' Public Sub _Dump()
'
' Dim I As Integer
' Dim hAttr As New TerminalAttr
' Dim iLen As Integer
'
' Compress(False)
' Print "<"; Length; "> ";
' For I = 0 To Attr.Max
' iLen = hAttr._FillFrom(Attr[I])
' Print Hex(hAttr._ToValue(), 16);; "["; iLen; "]";;
' Next
' Print
'
' End

View file

@ -55,7 +55,7 @@ Public Sub IsVoid() As Boolean
End
Public Sub _FillFrom(iAttr As Long)
Public Sub _FillFrom(iAttr As Long) As Integer
Background = Color.Default
BackgroundRGB = Color.Default
@ -81,6 +81,8 @@ Public Sub _FillFrom(iAttr As Long)
Underscore = BTst(iAttr, FLAG_UND)
Blink = BTst(iAttr, FLAG_BLK)
Return (Lsr(iAttr, 9) And 127) + 1
End
Public Sub _ToValue() As Long

View file

@ -932,8 +932,8 @@ Private Sub DrawLine(hView As TerminalView, L As Integer, X As Integer, Y As Int
If P > iMaxLen Then Break
hAttr._FillFrom(aAttr[I])
iLen = Min((Lsr(aAttr[I], 9) And 127), iMaxLen - P) + 1
iLen = hAttr._FillFrom(aAttr[I])
iLen = Min(iLen, iMaxLen - P + 1)
iBg = hAttr.BackgroundRGB
If iBg < 0 Then

View file

@ -31,6 +31,7 @@ Public Sub Form_Open()
Application.Animations = True
TerminalView1.Exec(["bash"], ["PWD=/home/benoit/gambas/git/master/comp/src/gb.form.terminal"])
TerminalView1.SetFocus
TerminalView1.Input("cat .src/TerminalView/TerminalView.class | grep Test\n")
End

View file

@ -1,7 +1,7 @@
# Gambas Form File 3.0
{ Form Form
MoveScaled(0,0,140,98)
MoveScaled(0,0,144,98)
Icon = Picture["terminalview.png"]
Arrangement = Arrange.Vertical
Spacing = True