From e8531901da6027da610a8798a81f7aa2b304e1a7 Mon Sep 17 00:00:00 2001 From: gambas Date: Tue, 2 Mar 2021 18:15:04 +0100 Subject: [PATCH] Automatic completion: Fix automatic completion overlap prevention routine. [DEVELOPMENT ENVIRONMENT] * BUG: Automatic completion: Fix automatic completion overlap prevention routine. --- app/src/gambas3/.src/Editor/Code/FCompletion.class | 8 +++++--- app/src/gambas3/.src/Editor/Code/FCompletion.form | 1 - app/src/gambas3/.src/Editor/Code/FSignature.class | 5 +++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/src/gambas3/.src/Editor/Code/FCompletion.class b/app/src/gambas3/.src/Editor/Code/FCompletion.class index 9f7cea48a..6638c61aa 100644 --- a/app/src/gambas3/.src/Editor/Code/FCompletion.class +++ b/app/src/gambas3/.src/Editor/Code/FCompletion.class @@ -108,11 +108,11 @@ Public Sub Position(hEditor As TextEditor) hCont = hCont.Parent Loop - FixPosition($hEditor, ByRef iX, ByRef iY) + FCompletion.FixPosition($hEditor, ByRef iX, ByRef iY) Dec Application.Busy - If Me.Parent = $hForm And If iX = Me.X And iY = Me.Y And Me.Visible Then Return + If Me.Parent = $hForm And If iX = Me.X And If iY = Me.Y And If Me.Visible Then Return Me.Reparent($hForm, iX, iY) If Not Me.Visible Then @@ -144,7 +144,9 @@ Static Public Sub FixPosition(hEditor As TextEditor, Optional ByRef X As Integer 'Debug Y;; "/";; FSignature.Y;; FSignature.H - If X >= FSignature.X And If X + Me.W <= FSignature.X + FSignature.W Then + 'FIXME: Had a crash with Me.W inside that static function + + If X < FSignature.X + FSignature.W And If X + FCompletion.W > FSignature.X Then If Y = FSignature.Y Then Y += FSignature.H - 1 diff --git a/app/src/gambas3/.src/Editor/Code/FCompletion.form b/app/src/gambas3/.src/Editor/Code/FCompletion.form index 071b1af50..b4b549d4f 100644 --- a/app/src/gambas3/.src/Editor/Code/FCompletion.form +++ b/app/src/gambas3/.src/Editor/Code/FCompletion.form @@ -6,7 +6,6 @@ Ignore = True Persistent = True Border = False - SkipTaskbar = True Arrangement = Arrange.Fill { panComp Panel MoveScaled(1,1,67,15) diff --git a/app/src/gambas3/.src/Editor/Code/FSignature.class b/app/src/gambas3/.src/Editor/Code/FSignature.class index 221d5bc08..976993a13 100644 --- a/app/src/gambas3/.src/Editor/Code/FSignature.class +++ b/app/src/gambas3/.src/Editor/Code/FSignature.class @@ -85,14 +85,14 @@ Private Sub UpdateSignature(Optional hForm As FEditor) If Not hForm Then Me.Move(iX, iY) Else - If Me.Parent <> hForm Or If iX <> Me.X Or If iY <> Me.Y Or If Me.Visible Then + If Me.Parent <> hForm Or If iX <> Me.X Or If iY <> Me.Y Or If Not Me.Visible Then Me.Reparent(hForm, iX, iY) Me.Show - Me.Raise $hEditor.SetFocus Endif Endif + Me.Raise FCompletion.FixPosition($hEditor) End @@ -229,6 +229,7 @@ Public Sub HideFrom(hEditor As TextEditor) If $hEditor <> hEditor Then Return $hEditor = Null Me.Hide + If FCompletion.VisibleFrom(hEditor) Then FCompletion.Position(hEditor) End