From bc4de606ad05f1c8a6060d8546f0c4876d0005ae Mon Sep 17 00:00:00 2001 From: Bruce Steers Date: Tue, 16 Mar 2021 02:26:59 +0000 Subject: [PATCH 1/2] Make executable dialog. Major/Minor/Release values can be changed on make executable dialog [DEVELOPMENT ENVIRONMENT] * NEW: Major/Minor/Release values can be changed on make executable dialog --- .../.src/Project/FMakeExecutable.class | 25 ++++++++++ .../gambas3/.src/Project/FMakeExecutable.form | 47 ++++++++++++++++--- 2 files changed, 65 insertions(+), 7 deletions(-) diff --git a/app/src/gambas3/.src/Project/FMakeExecutable.class b/app/src/gambas3/.src/Project/FMakeExecutable.class index 3b1ffb96c..2ad6d43db 100644 --- a/app/src/gambas3/.src/Project/FMakeExecutable.class +++ b/app/src/gambas3/.src/Project/FMakeExecutable.class @@ -25,6 +25,15 @@ Public Sub Form_Open() chkIncVersion.Value = Not Project.Config["/Executable/DoNotIncrementVersion", False] chkIncVersion.Visible = Not Project.VersionFile + Dim sVers As String[] = Split(Project.FormatVersion(), ".") + With Project + txtMajor.Value = sVers[0] + txtMinor.Value = sVers[1] + Try txtRelease.Value = sVers[2] + End With + + If Not chkIncVersion.Value And If chkIncVersion.Visible Then pnlVersion.Visible = True + chkNoTest.Visible = Project.HasTest() chkNoTest.Value = Project.Config["/Executable/NoTestModule", False] @@ -68,3 +77,19 @@ Public Sub btnCancel_Click() End + +Public Sub grpVersion_Change() + + With Project + .MajorVersion = txtMajor.Value + .MinorVersion = txtMinor.Value + .ReleaseVersion = txtRelease.Value + End With + +End + +Public Sub chkIncVersion_Click() + + pnlVersion.Visible = Not Last.Value + +End diff --git a/app/src/gambas3/.src/Project/FMakeExecutable.form b/app/src/gambas3/.src/Project/FMakeExecutable.form index c5f0461a4..336acec62 100644 --- a/app/src/gambas3/.src/Project/FMakeExecutable.form +++ b/app/src/gambas3/.src/Project/FMakeExecutable.form @@ -25,9 +25,42 @@ { VBox1 VBox MoveScaled(1,1,87,49) Margin = True - { chkIncVersion CheckBox - MoveScaled(1,1,19,4) - Text = ("Increment version") + { hbVersion HBox + MoveScaled(1,1,85,4) + Spacing = True + { chkIncVersion CheckBox + MoveScaled(0,0,19,4) + AutoResize = True + Text = ("Increment version") + } + { Spring2 Spring + MoveScaled(30,2,4,1) + } + { pnlVersion HBox + MoveScaled(35,0,49,4) + Visible = False + Spacing = True + { Label2 Label + MoveScaled(3,0,9,4) + AutoResize = True + Text = ("Version") + } + { txtMajor SpinBox grpVersion + Name = "txtMajor" + MoveScaled(14,0,9,4) + MaxValue = 9999 + } + { txtMinor SpinBox grpVersion + Name = "txtMinor" + MoveScaled(24,0,9,4) + MaxValue = 9999 + } + { txtRelease SpinBox grpVersion + Name = "txtRelease" + MoveScaled(35,0,12,4) + MaxValue = 999999 + } + } } { chkDebug CheckBox MoveScaled(1,5,39,4) @@ -67,8 +100,8 @@ Foreground = Color.TooltipForeground Padding = 8 AutoResize = True - Text = ("The following patterns will be substituted in the command :
\n• $(FILE) will be replaced by the executable path.
\n• $(DIR) by the project directory.
\n• $(NAME) by the project name.
\n• $(TITLE) by the project title.
\n• $(VERSION) by the project version.
\n
\nNote : all substitutions will be quoted.") Border = Border.Plain + Text = ("The following patterns will be substituted in the command :
\n• $(FILE) will be replaced by the executable path.
\n• $(DIR) by the project directory.
\n• $(NAME) by the project name.
\n• $(TITLE) by the project title.
\n• $(VERSION) by the project version.
\n
\nNote : all substitutions will be quoted.") } } } @@ -78,15 +111,15 @@ MoveScaled(6,62,79,4) Spacing = True { Spring1 Spring - MoveScaled(16,2,9,1) + MoveScaled(7,2,9,1) } { btnOK Button - MoveScaled(35,0,16,4) + MoveScaled(40,0,16,4) Text = ("OK") Default = True } { btnCancel Button - MoveScaled(54,0,16,4) + MoveScaled(59,0,16,4) Text = ("Cancel") Cancel = True } From 324d91d96a1da19bedcf3ab635467e44ab76b36b Mon Sep 17 00:00:00 2001 From: Bruce Steers Date: Tue, 16 Mar 2021 13:44:25 +0000 Subject: [PATCH 2/2] remove code from previous write. * OPT: remove old and no onger needed "With Project" statement --- app/src/gambas3/.src/Project/FMakeExecutable.class | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/src/gambas3/.src/Project/FMakeExecutable.class b/app/src/gambas3/.src/Project/FMakeExecutable.class index 2ad6d43db..9e4fc4ba6 100644 --- a/app/src/gambas3/.src/Project/FMakeExecutable.class +++ b/app/src/gambas3/.src/Project/FMakeExecutable.class @@ -26,11 +26,9 @@ Public Sub Form_Open() chkIncVersion.Visible = Not Project.VersionFile Dim sVers As String[] = Split(Project.FormatVersion(), ".") - With Project - txtMajor.Value = sVers[0] - txtMinor.Value = sVers[1] - Try txtRelease.Value = sVers[2] - End With + txtMajor.Value = sVers[0] + txtMinor.Value = sVers[1] + Try txtRelease.Value = sVers[2] If Not chkIncVersion.Value And If chkIncVersion.Visible Then pnlVersion.Visible = True