diff --git a/app/src/gambas3/.src/Editor/Code/FCompletion.class b/app/src/gambas3/.src/Editor/Code/FCompletion.class index 83d9ea800..10712485a 100644 --- a/app/src/gambas3/.src/Editor/Code/FCompletion.class +++ b/app/src/gambas3/.src/Editor/Code/FCompletion.class @@ -59,6 +59,7 @@ Public Sub Open(hForm As Object, sMode As String, Optional sClass As String, Opt Dim hCont As Container Dim sText As String Dim W, H As Integer + Dim hPos As Point If hForm.GetEditor() <> $hEditor Then HideFrom($hEditor) $bHideLater = False @@ -180,11 +181,13 @@ Public Sub Open(hForm As Object, sMode As String, Optional sClass As String, Opt sText &= Key.Text Endif - iX = $hEditor.X + $hEditor.ToPosX(0) + $hEditor.TextWidth(sText) + hPos = $hEditor.ToPos($hEditor.Line, $iCol) + + iX = $hEditor.X + hPos.X iX = Max(0, Min(iX, $hEditor.Window.ClientW - Me.Width)) - iY = $hEditor.Y + $hEditor.ToPosY() + $hEditor.Current.Height + iY = hPos.Y + $hEditor.LineHeight If (iY + Me.Height) > ($hEditor.Y + $hEditor.H) Then iY = $hEditor.Y + $hEditor.ToPosY() - Me.Height diff --git a/app/src/gambas3/.src/Editor/Code/FEditor.class b/app/src/gambas3/.src/Editor/Code/FEditor.class index 9742a3040..3bd8cb81f 100644 --- a/app/src/gambas3/.src/Editor/Code/FEditor.class +++ b/app/src/gambas3/.src/Editor/Code/FEditor.class @@ -2606,7 +2606,7 @@ Public Sub ShowWatchResult(sStr As String, X As Integer, Y As Integer) bError = True Endif - $hEditor.ShowMessageLabel(Html(sStr), X, Y, bError) + $hEditor.ShowMessageLabel(Html(sStr), X, Y, If(bError, Highlight.Breakpoint, Highlight.CurrentLine)) End @@ -2653,7 +2653,7 @@ Public Sub ShowErrorMessage(sMsg As String, (sIcon) As String) $hEditor.SetFocus Wait - $hEditor.ShowMessageLabel(sMsg, $hEditor.ToPosX(), $hEditor.ToPosY() + $hEditor.LineHeight, True) + $hEditor.ShowMessageLabel(sMsg, $hEditor.ToPosX(), $hEditor.ToPosY() + $hEditor.LineHeight, Highlight.Breakpoint) End diff --git a/app/src/gambas3/.src/Editor/Code/FTextEditor.class b/app/src/gambas3/.src/Editor/Code/FTextEditor.class index 2057a82da..9f6e56d18 100644 --- a/app/src/gambas3/.src/Editor/Code/FTextEditor.class +++ b/app/src/gambas3/.src/Editor/Code/FTextEditor.class @@ -876,7 +876,7 @@ Public Sub Compress() As Boolean $hEditor.Save(sPath) Endif SetText(sText) - CompressMessage = "" & Subst(("The file has been compressed from &1 to &2 bytes (&3)."), Str(iLen), Str(Len(sText)), Format(fGain, "#.##%")) & "
" & ("Original file has been saved in the Project folder.") + CompressMessage = "" & Subst(("The file has been compressed from &1 to &2 bytes (&3)."), Str(iLen), Str(Len(sText)), Format(fGain, "#.##%")) & " " & ("Original file has been saved in the Project folder.") Endif Catch @@ -893,7 +893,7 @@ Public Sub mnuCompress_Click() If Compress() Then FMain.ShowError(CompressMessage) Else - If CompressMessage Then FMain.ShowInfo(CompressMessage) + If CompressMessage Then $hEditor.ShowMessageLabel(CompressMessage) Endif End @@ -993,7 +993,7 @@ Public Sub ShowErrorMessage(sMsg As String, (sIcon) As String) $hEditor.SetFocus Wait - $hEditor.ShowMessageLabel(sMsg, $hEditor.ToPosX(), $hEditor.ToPosY() + $hEditor.LineHeight, True) + $hEditor.ShowMessageLabel(sMsg, $hEditor.ToPosX(), $hEditor.ToPosY() + $hEditor.LineHeight, Highlight.Breakpoint) End diff --git a/app/src/gambas3/.src/Exported/TextEditor.class b/app/src/gambas3/.src/Exported/TextEditor.class index 6f0de7031..2d058468e 100644 --- a/app/src/gambas3/.src/Exported/TextEditor.class +++ b/app/src/gambas3/.src/Exported/TextEditor.class @@ -201,35 +201,37 @@ Public Sub Label_MouseDown() End -Public Sub ShowMessageLabel(sStr As String, X As Integer, Y As Integer, Optional bError As Boolean) +Public Sub ShowMessageLabel(sStr As String, Optional X As Integer, Y As Integer, iStyle As Integer) Dim hParent As Container If Not $hLabel Then + hParent = Me.Parent If hParent Is HSplit Or If hParent Is VSplit Then hParent = hParent.Parent $hLabel = New TextLabel(hParent) As "Label" $hLabel.Ignore = True $hLabel.AutoResize = True - $hLabel.Border = Border.Plain + $hLabel.Border = If(IsMissing(Y), Border.None, Border.Plain) $hLabel.Padding = 2 $hLabel.Wrap = False $hLabelTimer = New Timer As "LabelTimer" $hLabelTimer.Delay = 10000 + Endif + + $hLabel.Foreground = Me.Styles[Highlight.Normal].Color + If IsMissing(iStyle) Then iStyle = Highlight.Highlight + $hLabel.Background = Color.Merge(Me.Styles[iStyle].Color, Style.BackgroundOf(Me), 0.3) + $hLabel.Text = " " & Replace(Replace(sStr, "
", " "), "
", " ") & " "
+
+ If IsMissing(X) Then X = 0
+ If IsMissing(Y) Then Y = Container(Me.Proxy).ClientH - $hLabel.H
X = Me.ScreenX + X - $hLabel.Parent.ScreenX
Y = Me.ScreenY + Y - $hLabel.Parent.ScreenY
- $hLabel.Foreground = Me.Styles[Highlight.Normal].Color
- If bError Then
- $hLabel.Background = Color.Merge(Me.Styles[Highlight.Breakpoint].Color, Style.BackgroundOf(Me), 0.3)
- Else
- $hLabel.Background = Color.Merge(Me.Styles[Highlight.CurrentLine].Color, Style.BackgroundOf(Me), 0.3)
- Endif
- $hLabel.Text = Replace(Replace(sStr, "
", " "), "
", " ")
-
If (Y + $hLabel.H) > $hLabel.Parent.ClientH Then Y -= $hLabel.H + Me.LineHeight
$hLabel.Move(X, Y)