diff --git a/comp/src/gb.form.terminal/.src/TerminalView/TerminalLink.class b/comp/src/gb.form.terminal/.src/TerminalView/TerminalLink.class index 13af63988..d525eeeb9 100644 --- a/comp/src/gb.form.terminal/.src/TerminalView/TerminalLink.class +++ b/comp/src/gb.form.terminal/.src/TerminalView/TerminalLink.class @@ -30,7 +30,7 @@ End Public Sub Select(Start As Integer, Length As Integer, Optional (Type) As String) - GetView()._SelectLink(Start, Length, Type) + If _Pos >= Start And If _Pos < (Start + Length) Then GetView()._SelectLink(Start, Length, Type) End diff --git a/comp/src/gb.form.terminal/.src/TerminalView/TerminalScreen.class b/comp/src/gb.form.terminal/.src/TerminalView/TerminalScreen.class index 6cc323052..dc334b236 100644 --- a/comp/src/gb.form.terminal/.src/TerminalView/TerminalScreen.class +++ b/comp/src/gb.form.terminal/.src/TerminalView/TerminalScreen.class @@ -433,6 +433,7 @@ Public Sub Print(sText As String) Select Case iCode Case 7 + Bell Case 8 CursorLeft Case 9 @@ -2447,3 +2448,9 @@ Public Sub SetLink(Optional X1 As Integer, Y1 As Integer, X2 As Integer, Y2 As I $LY2 = Y2 End + +Private Sub Bell() + + GetView()._Bell() + +End diff --git a/comp/src/gb.form.terminal/.src/TerminalView/TerminalView.class b/comp/src/gb.form.terminal/.src/TerminalView/TerminalView.class index 1cae77fcd..1a54758df 100644 --- a/comp/src/gb.form.terminal/.src/TerminalView/TerminalView.class +++ b/comp/src/gb.form.terminal/.src/TerminalView/TerminalView.class @@ -23,6 +23,8 @@ Event Link '' '' The [./link] property will return an object that gives you the text of the link. Event Click +'' This event is raised when the terminal wants to emit a bell +Event Bell '' Return or set if the terminal view has a border. Property Border As Boolean @@ -157,6 +159,9 @@ Private $bSetLink As Boolean Private $iLinkY As Integer Private $iLinkLength As Integer +Private $bBell As Boolean +Private $hTimerBell As Timer + 'Private $bDoubleFont As Boolean = True '' Create a new TerminalView control @@ -508,6 +513,7 @@ Public Sub View_Draw() Endif If $bSuspend Then Paint.FillRect(0, 0, Paint.W, Paint.H, Color.SetAlpha($hView.Background, 128)) + If $bBell Then Paint.FillRect(0, 0, Paint.W, Paint.H, Color.SetAlpha($hView.Foreground, 128)) End @@ -1814,3 +1820,30 @@ Public Sub View_Drop() Endif End + +Public Sub TimerBell_Timer() + + $bBell = False + $hView.Refresh + Stop Event + +End + +Public Sub _Bell() + + If Object.CanRaise(Me, "Bell") Then + Raise Bell + Stop Event + Return + Endif + + $bBell = True + $hView.Refresh + + If Not $hTimerBell Then + $hTimerBell = New Timer As "TimerBell" + $hTimerBell.Delay = 100 + Endif + $hTimerBell.Start + +End