diff --git a/app/src/gambas3/.src/FMain.class b/app/src/gambas3/.src/FMain.class index 865515632..56949c05f 100644 --- a/app/src/gambas3/.src/FMain.class +++ b/app/src/gambas3/.src/FMain.class @@ -1603,9 +1603,12 @@ Public Sub Action_Activate((Key) As String) As Boolean Endif Next - If Key = "_close" Then - Project.ActiveForm.Close - Endif + Select Case Key + Case "_save-as" + Project.SaveAsExtern() + Case "_close" + Project.ActiveForm.Close + End Select Endif diff --git a/app/src/gambas3/.src/FMain.form b/app/src/gambas3/.src/FMain.form index a66fcf64c..658db9b61 100644 --- a/app/src/gambas3/.src/FMain.form +++ b/app/src/gambas3/.src/FMain.form @@ -91,7 +91,7 @@ Picture = Picture["icon:/small/save"] } { Menu40 Menu - Action = ".save-as" + Action = "_save-as" Text = ("Save as") & "..." Picture = Picture["icon:/small/save-as"] Shortcut = "Ctrl+Alt+S" @@ -1030,19 +1030,19 @@ Picture = Picture["icon:/small/play"] } { btnPause ToolButton - MoveScaled(79,0,4,4) + MoveScaled(78,0,4,4) ToolTip = ("Pause") Action = "pause" Picture = Picture["icon:/small/pause"] } { btnStop ToolButton - MoveScaled(82,0,4,4) + MoveScaled(81,0,4,4) ToolTip = ("Stop") Action = "stop" Picture = Picture["icon:/small/stop"] } { btnStep ToolButton - MoveScaled(85,0,4,4) + MoveScaled(84,0,4,4) ToolTip = ("Step") Action = "step" Picture = Picture["icon:/small/end"] @@ -1054,14 +1054,14 @@ Picture = Picture["icon:/small/forward"] } { btnFrom ToolButton - MoveScaled(90,0,4,4) + MoveScaled(91,0,4,4) ToolTip = ("Finish current function") Action = "return" Picture = Picture["icon:/small/eject"] } { btnUntil ToolButton mnuUntil Name = "btnUntil" - MoveScaled(93,0,4,4) + MoveScaled(95,0,4,4) ToolTip = ("Run until current line") Action = "until" Picture = Picture["icon:/small/jump"] @@ -1314,7 +1314,7 @@ Visible = False } { wrkProject Workspace - MoveScaled(3,3,81,29) + MoveScaled(3,2,81,29) Background = Color.LightForeground Expand = True Border = False @@ -1450,6 +1450,11 @@ Shortcut = "" Picture = "icon:/small/save" } + { Action _save-as + Text = "Save as" + Shortcut = "Ctrl+Alt+S" + Picture = "icon:/small/save-as" + } { Action about Text = "About Gambas" Shortcut = "" @@ -1754,11 +1759,6 @@ Shortcut = "" Picture = "icon:/small/play" } - { Action save-as - Text = "Save as" - Shortcut = "Ctrl+Alt+S" - Picture = "icon:/small/save-as" - } { Action save-project Text = "Save project" Shortcut = "Ctrl+Alt+S" diff --git a/app/src/gambas3/.src/Packager/Package.module b/app/src/gambas3/.src/Packager/Package.module index 3606f34a1..771c3072b 100644 --- a/app/src/gambas3/.src/Packager/Package.module +++ b/app/src/gambas3/.src/Packager/Package.module @@ -369,20 +369,22 @@ Private Function GetDependencies(Optional aComp As String[]) As String Endif Endif - For Each sComp In aComp - - iPos = InStr(sComp, ":") - If iPos Then - sTest = Mid$(sComp, iPos + 1) - If Not Project.Components.Exist(sTest) Then Continue - sComp = Left(sComp, iPos - 1) - Endif - - If IsRuntimeComponent(sComp) Then Continue - - sRes &= GetDependency(sComp) - 'If sComp = "gb.form" Then sRes &= GetDependency("gb.form.stock") - Next + If aComp Then + For Each sComp In aComp + + iPos = InStr(sComp, ":") + If iPos Then + sTest = Mid$(sComp, iPos + 1) + If Not Project.Components.Exist(sTest) Then Continue + sComp = Left(sComp, iPos - 1) + Endif + + If IsRuntimeComponent(sComp) Then Continue + + sRes &= GetDependency(sComp) + 'If sComp = "gb.form" Then sRes &= GetDependency("gb.form.stock") + Next + Endif For Each sComp In Project.Libraries sRes &= GetDependency(sComp) diff --git a/app/src/gambas3/.src/Project.module b/app/src/gambas3/.src/Project.module index 04d579e25..5b680155a 100644 --- a/app/src/gambas3/.src/Project.module +++ b/app/src/gambas3/.src/Project.module @@ -6159,9 +6159,6 @@ Public Sub ReadComponentFile() As Collection Dim sGroup As String Dim iPos As Integer Dim sKey As String - Dim aNeed As String[] - Dim aRequire As String[] - Dim aImplement As String[] Dim cComp As New Collection If Type = TYPE_NORMAL Then Return @@ -6170,9 +6167,11 @@ Public Sub ReadComponentFile() As Collection If Not Exist(sPath) Then Return cComp - aNeed = New String[] - aRequire = New String[] - aImplement = New String[] + ' cComp["Need"] = New String[] + ' cComp["Require"] = New String[] + ' cComp["Exclude"] = New String[] + ' cComp["Implement"] = New String[] + ' cComp["Include"] = New String[] hFile = Open sPath @@ -6700,3 +6699,25 @@ Public Sub HasTest() As Boolean Return Tree.HasTest() End + +Public Sub SaveAsExtern() + + Dim hForm As Object + Dim sPath As String + + hForm = ActiveForm + If Not hForm Then Return + + Dialog.Key = "SaveAsExtern" + Dialog.Title = ("Save as") + If Dialog.SaveFile() Then Return + + sPath = Dialog.Path + + Files[hForm.Path] = Null + hForm.Rename(File.Name(sPath), sPath) + Files[hForm.Path] = hForm + + hForm.Save(True) + +End