Skip to content

Commit

Permalink
Merge branch 'release/2.2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
delphidabbler committed Aug 29, 2022
2 parents ff9a243 + 1b682b1 commit bb917f5
Show file tree
Hide file tree
Showing 11 changed files with 233 additions and 91 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,25 @@ This change log begins with the first ever pre-release version of what was then

From release 2.0.0 the version numbering has attempted to adhere to the principles of [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Release 2.2.1 - 2022-08-29

This release includes _PasHi_ v2.2.1 and _PasHiGUI_ v1.2.1. Changes are as follows:

### PasHi v2.2.1 [build 14]

* Refactored internal handling of version information (see _General_ section below). No visible change to program output.

### PasHiGUI v1.2.1 [build 8]

* Fixed bug where pressing F1 key when a menu is open caused an error message to be displayed. [Issue 32]
* Fixed bug where the About box was displaying the wrong version number for _PasHi_. [Issue 31]
* Made minor changes to the text displayed in the About box.
* Refactored internal handling of version information (see _General_ section below).

### General

* Changed method used to store and read version information. File version numbers for _PashHi_ and _PasHiGUI_ are now stored in a common `VERSION` file in the repo root. Information from this file is included in both program's version information resources and in special `RCDATA` resources. This enables each program to access the other's version numbers as required.

## Release 2.2.0 - 2022-07-04

This release includes _PasHi_ v2.2.0 and _PasHiGUI_ v1.2.0. Changes are as follows:
Expand Down
23 changes: 13 additions & 10 deletions Src/GUI/FmMain.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ object MainForm: TMainForm
Top = 18
Width = 223
Height = 357
VertScrollBar.Position = 27
VertScrollBar.Tracking = True
Align = alNone
Anchors = [akLeft, akTop, akBottom]
Expand All @@ -250,18 +249,17 @@ object MainForm: TMainForm
ParentColor = True
TabOrder = 2
object cpnlMisc: TCategoryPanel
Top = 163
Top = 190
Height = 30
Caption = 'Miscellaneous'
Color = clWindow
Collapsed = True
TabOrder = 0
ExplicitTop = 325
ExpandedHeight = 262
inline frmMisc: TMiscOptionsFrame
Left = 0
Top = 0
Width = 202
Width = 219
Height = 0
Align = alClient
TabOrder = 0
Expand All @@ -270,7 +268,7 @@ object MainForm: TMainForm
end
end
object cpnlLines: TCategoryPanel
Top = 133
Top = 160
Height = 30
Caption = 'Line Numbering && Striping'
Color = clWindow
Expand All @@ -289,7 +287,7 @@ object MainForm: TMainForm
end
end
object cpnlCSS: TCategoryPanel
Top = 103
Top = 130
Height = 30
Caption = 'Style Sheets'
Color = clWindow
Expand All @@ -299,7 +297,7 @@ object MainForm: TMainForm
inline frmCSS: TCSSOptionsFrame
Left = 0
Top = 0
Width = 202
Width = 219
Height = 0
Align = alClient
TabOrder = 0
Expand All @@ -308,15 +306,15 @@ object MainForm: TMainForm
end
end
object cpnlDocType: TCategoryPanel
Top = -27
Top = 0
Height = 130
Caption = 'Document Type'
Color = clWindow
TabOrder = 3
inline frmDocType: TDocTypeOptionsFrame
Left = 0
Top = 0
Width = 202
Width = 219
Height = 104
Align = alClient
TabOrder = 0
Expand Down Expand Up @@ -463,7 +461,7 @@ object MainForm: TMainForm
Left = 336
Top = 152
Bitmap = {
494C0101050009001C0010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
494C010105000900200010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
0000000000003600000028000000400000002000000001002000000000000020
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
Expand Down Expand Up @@ -734,4 +732,9 @@ object MainForm: TMainForm
FF8F81FFBF7DF87FFFFFFFFF7F7EFFFF00000000000000000000000000000000
000000000000}
end
object appEvents: TApplicationEvents
OnHelp = appEventsHelp
Left = 272
Top = 88
end
end
47 changes: 31 additions & 16 deletions Src/GUI/FmMain.pas
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at http://mozilla.org/MPL/2.0/
*
* Copyright (C) 2006-2021, Peter Johnson (www.delphidabbler.com).
* Copyright (C) 2006-2022, Peter Johnson (www.delphidabbler.com).
*
* Application's main form. Handles main user inteface interaction.
}
Expand All @@ -23,7 +23,7 @@ interface
// Project
IntfDropDataHandler, UOptions, UDocument, UWBContainer, UInputData,
FrOptions.UBase, FrOptions.UDocType, FrOptions.ULineStyle, FrOptions.UCSS,
FrOptions.UMisc;
FrOptions.UMisc, AppEvnts;


type
Expand Down Expand Up @@ -89,6 +89,7 @@ TMainForm = class(TForm, IDropDataHandler)
lblOptionsHide: TLabel;
miUserGuide: TMenuItem;
actUserGuide: TAction;
appEvents: TApplicationEvents;
procedure actAboutExecute(Sender: TObject);
procedure actCopyExecute(Sender: TObject);
procedure actCopyUpdate(Sender: TObject);
Expand All @@ -111,6 +112,8 @@ TMainForm = class(TForm, IDropDataHandler)
procedure lblOptionsHideMouseLeave(Sender: TObject);
procedure actUserGuideExecute(Sender: TObject);
procedure actUserGuideUpdate(Sender: TObject);
function appEventsHelp(Command: Word; Data: Integer;
var CallHelp: Boolean): Boolean;
strict private
type
TLoadProc = reference to procedure;
Expand Down Expand Up @@ -179,21 +182,24 @@ implementation
{ TMainForm }

procedure TMainForm.actAboutExecute(Sender: TObject);
var
VI: TVersionInfo;
Msg: string;
begin
Application.MessageBox(
PChar(
Format('PasHiGUI %s.', [GetFileVersionStr])
+ #10#10
+ 'A GUI front end for the PasHi Syntax Highlighter v2.1.0'
+ #10#10
+ GetLegalCopyright
+ #10#10
+ 'Released under the terms of the Mozilla Public License v2.0. '
+ 'See the file LICENSE.md for full details.'
),
'About',
MB_OK
);
VI := TVersionInfo.Create;
try
Msg := Format(
'PasHiGUI %0:s (build %1:s).'#10#10
+ 'A GUI front end for the PasHi Syntax Highlighter v%2:s.'#10#10
+ '%3:s'#10#10
+ 'Released under the terms of the Mozilla Public License v2.0. '
+ 'See the file LICENSE.md for full details.',
[VI.GUIVersion, VI.GUIBuild, VI.CmdLineVersion, VI.Copyright]
);
Application.MessageBox(PChar(Msg), 'About', MB_OK);
finally
VI.Free;
end;
end;

procedure TMainForm.actApplyExecute(Sender: TObject);
Expand Down Expand Up @@ -317,6 +323,15 @@ procedure TMainForm.alMainUpdate(Action: TBasicAction; var Handled: Boolean);
end;
end;

function TMainForm.appEventsHelp(Command: Word; Data: Integer;
var CallHelp: Boolean): Boolean;
begin
// Prevent Delphi Help system from interfering!
// This prevents exception being raised when F1 is pressed over menu items
CallHelp := False;
Result := True;
end;

procedure TMainForm.Busy(const Flag: Boolean);
begin
// Set main window and browser control's cursors
Expand Down
5 changes: 4 additions & 1 deletion Src/GUI/Resources.rc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at http://mozilla.org/MPL/2.0/
*
* Copyright (C) 2006-2015, Peter Johnson (www.delphidabbler.com).
* Copyright (C) 2006-2022, Peter Johnson (www.delphidabbler.com).
*
* Application's resources.
*/
Expand All @@ -17,3 +17,6 @@ MAINICON ICON "Assets\MainIcon.ico"

/* Manifest file */
1 24 "Assets\PasHiGUI.manifest"

/* Data file containing version information data for PasHi and PasHiGUI */
VERSION_DATA RCDATA "..\..\VERSION"
16 changes: 10 additions & 6 deletions Src/GUI/VersionInfo.vi
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@
; Copyright (C) 2006-2022, Peter Johnson (www.delphidabbler.com).
;
; Version information description file used to create VersionInfo.res resource
; file. Build this file with DelphiDabbler Version Information Editor from
; https://delphidabbler.com/. Compile the resulting .rc file using Borland
; BRCC32 resource compiler.
; file. Build this file with DelphiDabbler Version Information Editor v2.14.0 or
; later from https://delphidabbler.com/. Compile the resulting .rc file using
; the Embarcadero BRCC32 resource compiler.
; ==============================================================================

[Macros]
Import:ver=../../VERSION

[Fixed File Info]
File Version #=1, 2, 0, 7
Product Version #=2, 2, 0, 0
File Version #=<%ver.guifilever>.<%ver.guibuild>
Product Version #=<%ver.productver>
File OS=4
File Type=1
File Sub-Type=0
Expand All @@ -31,7 +33,7 @@ Company Name=DelphiDabbler
File Description=Pascal Highlighter GUI
File Version=<#F1>.<#F2>.<#F3> build <#F4>
Internal Name=<SHORTFNAME>
Legal Copyright=Copyright (C) 2006-<YEAR>, Peter Johnson (www.delphidabbler.com).
Legal Copyright=Copyright (C) 2006-<YEAR>, Peter Johnson (https://delphidabbler.com).
Legal Trademark=
Original File Name=PasHiGUI.exe
Private Build=
Expand All @@ -42,3 +44,5 @@ Special Build=
[Configuration Details]
Identifier=
NumRCComments=0
ResOutputDir=
FileVersion=1
13 changes: 13 additions & 0 deletions Src/Renderers.UBranding.pas
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ TBrandingGenerator = class abstract(TInterfacedObject)
fInhibited: Boolean;
strict protected
function RenderBranding: string; virtual; abstract;
function GetFileVersionStr: string;
public
constructor Create(Inhibited: Boolean);
function Render: string;
Expand Down Expand Up @@ -68,6 +69,18 @@ constructor TBrandingGenerator.Create(Inhibited: Boolean);
fInhibited := Inhibited;
end;

function TBrandingGenerator.GetFileVersionStr: string;
var
VI: TVersionInfo;
begin
VI := TVersionInfo.Create;
try
Result := VI.CmdLineVersion;
finally
VI.Free;
end;
end;

function TBrandingGenerator.Render: string;
begin
if fInhibited then
Expand Down
4 changes: 3 additions & 1 deletion Src/Resources.rc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at http://mozilla.org/MPL/2.0/
*
* Copyright (C) 2005-2012, Peter Johnson (www.delphidabbler.com).
* Copyright (C) 2005-2022, Peter Johnson (www.delphidabbler.com).
*
* Resource file for PasHi.
*/
Expand All @@ -21,3 +21,5 @@ CSS_DEFAULT RCDATA Assets\Default.css
/* Help screen text */
HELP RCDATA Assets\Help.txt

/* Data file containing version information data for PasHi and PasHiGUI */
VERSION_DATA RCDATA "..\VERSION"
9 changes: 8 additions & 1 deletion Src/UMain.pas
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,15 @@ procedure TMain.ShowHelp;
end;

procedure TMain.ShowVersion;
var
VI: TVersionInfo;
begin
fConsole.WriteLn(GetFileVersionStr);
VI := TVersionInfo.Create;
try
fConsole.WriteLn(VI.CmdLineVersion);
finally
VI.Free;
end;
end;

procedure TMain.ShowWarnings;
Expand Down
Loading

0 comments on commit bb917f5

Please sign in to comment.