From d37d6c97b8a0bdd7951a848a4e146b15b6b6440c Mon Sep 17 00:00:00 2001 From: gambas Date: Wed, 22 Apr 2020 23:40:36 +0200 Subject: [PATCH] Form editor: Add a information line on the toolbox that displays the name of the current hovered toolbox control, and the component it belongs to. [DEVELOPMENT ENVIRONMENT] * BUG: Hitting ESC key when the focus is on the console immediate command textbox now always closes the console tab. * NEW: Form editor: Add a information line on the toolbox that displays the name of the current hovered toolbox control, and the component it belongs to. --- app/src/gambas3/.src/Debug/FDebugInfo.form | 12 ++++---- app/src/gambas3/.src/Debug/FOutput.class | 2 ++ .../gambas3/.src/Editor/Form/FToolBox.class | 29 +++++++++++-------- .../gambas3/.src/Editor/Form/FToolBox.form | 27 +++++++++++++++-- .../gambas3/.src/Editor/Form/FToolPanel.class | 17 +++++++---- app/src/gambas3/.src/Options/FOption.class | 2 +- 6 files changed, 61 insertions(+), 28 deletions(-) diff --git a/app/src/gambas3/.src/Debug/FDebugInfo.form b/app/src/gambas3/.src/Debug/FDebugInfo.form index c7f526dcb..896f36de9 100644 --- a/app/src/gambas3/.src/Debug/FDebugInfo.form +++ b/app/src/gambas3/.src/Debug/FDebugInfo.form @@ -193,11 +193,6 @@ Text = ("Cancel") Picture = Picture["icon:/small/halt"] } - { spnSearch Spinner - MoveScaled(6,0,4,4) - Visible = False - Padding = 4 - } { btnCloseSearch ToolButton MoveScaled(11,0,10,4) AutoResize = True @@ -221,11 +216,16 @@ Expand = True } { lblBrowse Label - MoveScaled(77,0,11,4) + MoveScaled(73,0,11,4) Font = Font["Italic"] Padding = 4 AutoResize = True } + { spnSearch Spinner + MoveScaled(86,0,4,4) + Visible = False + Padding = 4 + } { panButtonSearch Panel MoveScaled(90,0,4,4) } diff --git a/app/src/gambas3/.src/Debug/FOutput.class b/app/src/gambas3/.src/Debug/FOutput.class index fcf8c0808..7ed19db89 100644 --- a/app/src/gambas3/.src/Debug/FOutput.class +++ b/app/src/gambas3/.src/Debug/FOutput.class @@ -378,6 +378,8 @@ Public Sub txtEnter_KeyPress() Else If Key.Code = Key.End And If Key.Control Then trmOutput.Goto(0, trmOutput.Count - 1) Stop Event + Else If Key.Code = Key.Escape Then + Action["console"].Value = False Endif End diff --git a/app/src/gambas3/.src/Editor/Form/FToolBox.class b/app/src/gambas3/.src/Editor/Form/FToolBox.class index 660839c85..3c6e6b359 100644 --- a/app/src/gambas3/.src/Editor/Form/FToolBox.class +++ b/app/src/gambas3/.src/Editor/Form/FToolBox.class @@ -250,7 +250,6 @@ Public Sub RefreshToolbar(Optional bForce As Boolean) End - Private Sub ClearToolBar() $sLastLib = "" @@ -258,8 +257,6 @@ Private Sub ClearToolBar() End - - ' Public Sub Form_Close() ' ' 'Config.SaveWindow(ME, "/FToolBox") @@ -285,7 +282,6 @@ Public Function GetTool() As String End - Public Sub SetTool() If Not $sToolBar Then Return @@ -293,7 +289,6 @@ Public Sub SetTool() End - ' PUBLIC SUB ToolBar_Change() ' ' PRINT "ToolBar_Change: "; LAST.Name @@ -302,11 +297,10 @@ End Public Sub GetSize() As Integer - Return 24 + Settings["/ToolboxSize", 0] * 8 + Return 24 + Settings["/Toolbox/Size", 0] * 8 End - Private Sub UpdateSize() Dim iSize As Integer = GetSize() @@ -318,11 +312,14 @@ Private Sub UpdateSize() End - - Public Sub ReadConfig() - tabTool.TextFont = Project.GetSmallFont() + Dim hFont As Font + + hFont = Project.GetSmallFont() + tabTool.TextFont = hFont + panTooltip.Font = hFont + panTooltip.Height = hFont.H + 4 UpdateSize End @@ -388,9 +385,17 @@ Public Sub btnZoom_Click() Dim iSize As Integer - iSize = Settings["/ToolboxSize", 0] + iSize = Settings["/Toolbox/Size", 0] iSize = (iSize + 1) Mod 4 - Settings["/ToolboxSize"] = iSize + Settings["/Toolbox/Size"] = iSize UpdateSize End + +Public Sub SetTooltip(Optional sControl As String, sComp As String) + + If sComp = "$" Then sComp = "" & ("Current project") & "" + lblControl.Text = sControl + lblComp.Text = sComp + +End diff --git a/app/src/gambas3/.src/Editor/Form/FToolBox.form b/app/src/gambas3/.src/Editor/Form/FToolBox.form index 9e77ce5a4..371ed846e 100644 --- a/app/src/gambas3/.src/Editor/Form/FToolBox.form +++ b/app/src/gambas3/.src/Editor/Form/FToolBox.form @@ -1,12 +1,13 @@ # Gambas Form File 3.0 { Form Form - MoveScaled(0,0,36,47) + MoveScaled(0,0,36,50) Persistent = True - Arrangement = Arrange.Fill + Arrangement = Arrange.Vertical { tabTool TabPanel - MoveScaled(1,1,33,45) + MoveScaled(0,1,34,39) Font = Font["-1"] + Expand = True Arrangement = Arrange.Fill Padding = 2 Border = False @@ -15,6 +16,26 @@ Text = ("") Index = 0 } + { Separator1 Separator + MoveScaled(8,44,21,0) + } + { panTooltip HBox + MoveScaled(1,46,33,3) + { lblControl Label + MoveScaled(4,0,10,3) + Font = Font["Bold"] + Expand = True + Alignment = Align.Right + } + { Panel1 Panel + MoveScaled(15,0,1,3) + } + { lblComp TextLabel + MoveScaled(21,0,10,3) + Expand = True + Alignment = Align.Left + } + } { btnZoom ToolButton MoveScaled(24,6,4,4) Visible = False diff --git a/app/src/gambas3/.src/Editor/Form/FToolPanel.class b/app/src/gambas3/.src/Editor/Form/FToolPanel.class index c426fb45b..299cc9bd4 100644 --- a/app/src/gambas3/.src/Editor/Form/FToolPanel.class +++ b/app/src/gambas3/.src/Editor/Form/FToolPanel.class @@ -30,7 +30,6 @@ Public Sub _new(sName As String, sType As String) End - Public Sub Add(sControl As String, Optional sComp As String, Optional sType As String) Dim hCtrl As ToolButton @@ -43,10 +42,10 @@ Public Sub Add(sControl As String, Optional sComp As String, Optional sType As S H = $iSize + 8 hCtrl = New ToolButton(panTool) As "btnControl" - hCtrl.Tag = [sControl, sType] + hCtrl.Tag = [sControl, sType, sComp] hCtrl.Border = False hCtrl.Toggle = True - hCtrl.ToolTip = sControl + 'hCtrl.ToolTip = sControl hCtrl.Design = True hPict = CControl.GetIcon(sControl, sComp) @@ -68,8 +67,6 @@ Public Sub Exist(sControl As String) As Boolean End - - ' PUBLIC SUB Form_Resize() ' ' DIM hCtrl AS ToolButton @@ -133,13 +130,21 @@ End Public Procedure btnControl_Enter() - Last.Border = True + Dim hCtrl As ToolButton = Last + + hCtrl.Border = True + If IsNull(hCtrl.Tag[2]) Then + FToolBox.SetTooltip() + Else + FToolBox.SetTooltip(hCtrl.Tag[0], hCtrl.Tag[2]) + Endif End Public Procedure btnControl_Leave() Last.Border = False + FToolBox.SetTooltip() End diff --git a/app/src/gambas3/.src/Options/FOption.class b/app/src/gambas3/.src/Options/FOption.class index 70ba0c3a8..1c7853337 100644 --- a/app/src/gambas3/.src/Options/FOption.class +++ b/app/src/gambas3/.src/Options/FOption.class @@ -1704,7 +1704,7 @@ Private Sub SaveLayout(Optional sFile As String) hSettings["Toolbar/Form"] = ToolBar.GetLayout("form") hSettings["Toolbar/Image"] = ToolBar.GetLayout("image") hSettings["ShowMenus"] = Settings["/ShowMenus"] - hSettings["ToolboxSize"] = Settings["/ToolboxSize"] + hSettings["Toolbox/Size"] = Settings["/Toolbox/Size"] hSettings["CloseWithMiddleClick"] = Settings["/CloseWithMiddleClick"] hSettings["ProjectFontSize"] = Settings["/ProjectFontSize"] hSettings["TitleFontSize"] = Settings["/TitleFontSize"]