From 3f836f0b9de6a7b3e1558d33b92f198d26028d9f Mon Sep 17 00:00:00 2001 From: gambas Date: Thu, 19 Jul 2018 17:44:15 +0200 Subject: [PATCH] Move the information tooltip to the top when the mouse cursor enters it, and move it back to the bottom if it enters it again. [DEVELOPMENT ENVIRONMENT] * NEW: Form editor: Move the information tooltip to the top when the mouse cursor enters it, and move it back to the bottom if it enters it again. * NEW: Image editor: Move the information tooltip to the top when the mouse cursor enters it, and move it back to the bottom if it enters it again. * BUG: Take the language direction into account when displaying the form and image editor tooltips. * BUG: Take the language direction into account when displaying the debug panel close button. --- app/src/gambas3/.src/Editor/Form/FForm.class | 20 +++++++++++++++++-- .../.src/Editor/Image/FImageEditor.class | 19 +++++++++++++++++- app/src/gambas3/.src/FMain.class | 6 +++++- app/src/gambas3/.src/Project.module | 1 - 4 files changed, 41 insertions(+), 5 deletions(-) diff --git a/app/src/gambas3/.src/Editor/Form/FForm.class b/app/src/gambas3/.src/Editor/Form/FForm.class index 4527011e7..3525e9cf4 100644 --- a/app/src/gambas3/.src/Editor/Form/FForm.class +++ b/app/src/gambas3/.src/Editor/Form/FForm.class @@ -95,6 +95,7 @@ Private $hDropTarget As CControl Private $bLockArrangement As Boolean Private $cInfo As Collection +Private $bInfoTop As Boolean Public Sub _new(sPath As String) @@ -3866,13 +3867,21 @@ End Private Sub MoveInfo() + Dim X, Y As Integer Dim DX As Integer Dim DY As Integer If svwWorkspace.ScrollH > svwWorkspace.ClientH Then DX = Style.ScrollbarSize If svwWorkspace.ScrollW > svwWorkspace.ClientW Then DY = Style.ScrollbarSize - - dwgInfo.Move(svwWorkspace.X + svwWorkspace.W - dwgInfo.W - Desktop.Scale - DX, svwWorkspace.Y + svwWorkspace.H - dwgInfo.H - Desktop.Scale - DY) + + If System.RightToLeft Then + X = svwWorkspace.X + Desktop.Scale + Else + X = svwWorkspace.X + svwWorkspace.W - dwgInfo.W - Desktop.Scale - DX + Endif + Y = svwWorkspace.Y + Desktop.Scale + If Not $bInfoTop Then Y = Max(Y, svwWorkspace.Y + svwWorkspace.H - dwgInfo.H - Desktop.Scale - DY) + dwgInfo.Move(X, Y) End @@ -4403,3 +4412,10 @@ Public Sub GetLocation(iLine As Integer) As String Wend End + +Public Sub dwgInfo_Enter() + + $bInfoTop = Not $bInfoTop + MoveInfo + +End diff --git a/app/src/gambas3/.src/Editor/Image/FImageEditor.class b/app/src/gambas3/.src/Editor/Image/FImageEditor.class index 5b713ffe9..524f73627 100644 --- a/app/src/gambas3/.src/Editor/Image/FImageEditor.class +++ b/app/src/gambas3/.src/Editor/Image/FImageEditor.class @@ -72,6 +72,7 @@ Private $hTextSelect As CImageSelection Private $sLastColor As Integer Private $cInfo As New Collection +Private $bInfoTop As Boolean Public Sub _new(sPath As String) @@ -3130,13 +3131,22 @@ End Private Sub MoveInfo() + Dim X, Y As Integer Dim DX As Integer Dim DY As Integer If imvImage.ScrollH > imvImage.ClientH Then DX = Style.ScrollbarSize If imvImage.ScrollW > imvImage.ClientW Then DY = Style.ScrollbarSize - dwgInfo.Move(panBackground.W - dwgInfo.W - Desktop.Scale - DX, panBackground.H - dwgInfo.H - Desktop.Scale - DY) + If System.RightToLeft Then + X = Desktop.Scale + Else + X = panBackground.W - dwgInfo.W - Desktop.Scale - DX + Endif + Y = Desktop.Scale + If Not $bInfoTop Then Y = Max(Y, panBackground.H - dwgInfo.H - Desktop.Scale - DY) + + dwgInfo.Move(X, Y) End @@ -3269,3 +3279,10 @@ Public Sub imvImage_DblClick() $bDblClick = True End + +Public Sub dwgInfo_Enter() + + $bInfoTop = Not $bInfoTop + MoveInfo + +End diff --git a/app/src/gambas3/.src/FMain.class b/app/src/gambas3/.src/FMain.class index a9c25665b..84119e22d 100644 --- a/app/src/gambas3/.src/FMain.class +++ b/app/src/gambas3/.src/FMain.class @@ -2918,7 +2918,11 @@ End Public Sub panDebug_Arrange() - btnClosePanel.Move(panDebug.W - btnClosePanel.W, 0) + If System.RightToLeft Then + btnClosePanel.Move(0, 0) + Else + btnClosePanel.Move(panDebug.W - btnClosePanel.W, 0) + Endif btnClosePanel.Raise End diff --git a/app/src/gambas3/.src/Project.module b/app/src/gambas3/.src/Project.module index 61b58bc71..f64850db3 100644 --- a/app/src/gambas3/.src/Project.module +++ b/app/src/gambas3/.src/Project.module @@ -6496,5 +6496,4 @@ Public Sub InitTooltip(hTooltip As Control) End With - End