Skip to content

Commit bb917f5

Browse files
committed
Merge branch 'release/2.2.1'
2 parents ff9a243 + 1b682b1 commit bb917f5

11 files changed

+233
-91
lines changed

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,25 @@ This change log begins with the first ever pre-release version of what was then
88

99
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).
1010

11+
## Release 2.2.1 - 2022-08-29
12+
13+
This release includes _PasHi_ v2.2.1 and _PasHiGUI_ v1.2.1. Changes are as follows:
14+
15+
### PasHi v2.2.1 [build 14]
16+
17+
* Refactored internal handling of version information (see _General_ section below). No visible change to program output.
18+
19+
### PasHiGUI v1.2.1 [build 8]
20+
21+
* Fixed bug where pressing F1 key when a menu is open caused an error message to be displayed. [Issue 32]
22+
* Fixed bug where the About box was displaying the wrong version number for _PasHi_. [Issue 31]
23+
* Made minor changes to the text displayed in the About box.
24+
* Refactored internal handling of version information (see _General_ section below).
25+
26+
### General
27+
28+
* 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.
29+
1130
## Release 2.2.0 - 2022-07-04
1231

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

Src/GUI/FmMain.dfm

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,6 @@ object MainForm: TMainForm
237237
Top = 18
238238
Width = 223
239239
Height = 357
240-
VertScrollBar.Position = 27
241240
VertScrollBar.Tracking = True
242241
Align = alNone
243242
Anchors = [akLeft, akTop, akBottom]
@@ -250,18 +249,17 @@ object MainForm: TMainForm
250249
ParentColor = True
251250
TabOrder = 2
252251
object cpnlMisc: TCategoryPanel
253-
Top = 163
252+
Top = 190
254253
Height = 30
255254
Caption = 'Miscellaneous'
256255
Color = clWindow
257256
Collapsed = True
258257
TabOrder = 0
259-
ExplicitTop = 325
260258
ExpandedHeight = 262
261259
inline frmMisc: TMiscOptionsFrame
262260
Left = 0
263261
Top = 0
264-
Width = 202
262+
Width = 219
265263
Height = 0
266264
Align = alClient
267265
TabOrder = 0
@@ -270,7 +268,7 @@ object MainForm: TMainForm
270268
end
271269
end
272270
object cpnlLines: TCategoryPanel
273-
Top = 133
271+
Top = 160
274272
Height = 30
275273
Caption = 'Line Numbering && Striping'
276274
Color = clWindow
@@ -289,7 +287,7 @@ object MainForm: TMainForm
289287
end
290288
end
291289
object cpnlCSS: TCategoryPanel
292-
Top = 103
290+
Top = 130
293291
Height = 30
294292
Caption = 'Style Sheets'
295293
Color = clWindow
@@ -299,7 +297,7 @@ object MainForm: TMainForm
299297
inline frmCSS: TCSSOptionsFrame
300298
Left = 0
301299
Top = 0
302-
Width = 202
300+
Width = 219
303301
Height = 0
304302
Align = alClient
305303
TabOrder = 0
@@ -308,15 +306,15 @@ object MainForm: TMainForm
308306
end
309307
end
310308
object cpnlDocType: TCategoryPanel
311-
Top = -27
309+
Top = 0
312310
Height = 130
313311
Caption = 'Document Type'
314312
Color = clWindow
315313
TabOrder = 3
316314
inline frmDocType: TDocTypeOptionsFrame
317315
Left = 0
318316
Top = 0
319-
Width = 202
317+
Width = 219
320318
Height = 104
321319
Align = alClient
322320
TabOrder = 0
@@ -463,7 +461,7 @@ object MainForm: TMainForm
463461
Left = 336
464462
Top = 152
465463
Bitmap = {
466-
494C0101050009001C0010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
464+
494C010105000900200010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
467465
0000000000003600000028000000400000002000000001002000000000000020
468466
0000000000000000000000000000000000000000000000000000000000000000
469467
0000000000000000000000000000000000000000000000000000000000000000
@@ -734,4 +732,9 @@ object MainForm: TMainForm
734732
FF8F81FFBF7DF87FFFFFFFFF7F7EFFFF00000000000000000000000000000000
735733
000000000000}
736734
end
735+
object appEvents: TApplicationEvents
736+
OnHelp = appEventsHelp
737+
Left = 272
738+
Top = 88
739+
end
737740
end

Src/GUI/FmMain.pas

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
44
* obtain one at http://mozilla.org/MPL/2.0/
55
*
6-
* Copyright (C) 2006-2021, Peter Johnson (www.delphidabbler.com).
6+
* Copyright (C) 2006-2022, Peter Johnson (www.delphidabbler.com).
77
*
88
* Application's main form. Handles main user inteface interaction.
99
}
@@ -23,7 +23,7 @@ interface
2323
// Project
2424
IntfDropDataHandler, UOptions, UDocument, UWBContainer, UInputData,
2525
FrOptions.UBase, FrOptions.UDocType, FrOptions.ULineStyle, FrOptions.UCSS,
26-
FrOptions.UMisc;
26+
FrOptions.UMisc, AppEvnts;
2727

2828

2929
type
@@ -89,6 +89,7 @@ TMainForm = class(TForm, IDropDataHandler)
8989
lblOptionsHide: TLabel;
9090
miUserGuide: TMenuItem;
9191
actUserGuide: TAction;
92+
appEvents: TApplicationEvents;
9293
procedure actAboutExecute(Sender: TObject);
9394
procedure actCopyExecute(Sender: TObject);
9495
procedure actCopyUpdate(Sender: TObject);
@@ -111,6 +112,8 @@ TMainForm = class(TForm, IDropDataHandler)
111112
procedure lblOptionsHideMouseLeave(Sender: TObject);
112113
procedure actUserGuideExecute(Sender: TObject);
113114
procedure actUserGuideUpdate(Sender: TObject);
115+
function appEventsHelp(Command: Word; Data: Integer;
116+
var CallHelp: Boolean): Boolean;
114117
strict private
115118
type
116119
TLoadProc = reference to procedure;
@@ -179,21 +182,24 @@ implementation
179182
{ TMainForm }
180183

181184
procedure TMainForm.actAboutExecute(Sender: TObject);
185+
var
186+
VI: TVersionInfo;
187+
Msg: string;
182188
begin
183-
Application.MessageBox(
184-
PChar(
185-
Format('PasHiGUI %s.', [GetFileVersionStr])
186-
+ #10#10
187-
+ 'A GUI front end for the PasHi Syntax Highlighter v2.1.0'
188-
+ #10#10
189-
+ GetLegalCopyright
190-
+ #10#10
191-
+ 'Released under the terms of the Mozilla Public License v2.0. '
192-
+ 'See the file LICENSE.md for full details.'
193-
),
194-
'About',
195-
MB_OK
196-
);
189+
VI := TVersionInfo.Create;
190+
try
191+
Msg := Format(
192+
'PasHiGUI %0:s (build %1:s).'#10#10
193+
+ 'A GUI front end for the PasHi Syntax Highlighter v%2:s.'#10#10
194+
+ '%3:s'#10#10
195+
+ 'Released under the terms of the Mozilla Public License v2.0. '
196+
+ 'See the file LICENSE.md for full details.',
197+
[VI.GUIVersion, VI.GUIBuild, VI.CmdLineVersion, VI.Copyright]
198+
);
199+
Application.MessageBox(PChar(Msg), 'About', MB_OK);
200+
finally
201+
VI.Free;
202+
end;
197203
end;
198204

199205
procedure TMainForm.actApplyExecute(Sender: TObject);
@@ -317,6 +323,15 @@ procedure TMainForm.alMainUpdate(Action: TBasicAction; var Handled: Boolean);
317323
end;
318324
end;
319325

326+
function TMainForm.appEventsHelp(Command: Word; Data: Integer;
327+
var CallHelp: Boolean): Boolean;
328+
begin
329+
// Prevent Delphi Help system from interfering!
330+
// This prevents exception being raised when F1 is pressed over menu items
331+
CallHelp := False;
332+
Result := True;
333+
end;
334+
320335
procedure TMainForm.Busy(const Flag: Boolean);
321336
begin
322337
// Set main window and browser control's cursors

Src/GUI/Resources.rc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
44
* obtain one at http://mozilla.org/MPL/2.0/
55
*
6-
* Copyright (C) 2006-2015, Peter Johnson (www.delphidabbler.com).
6+
* Copyright (C) 2006-2022, Peter Johnson (www.delphidabbler.com).
77
*
88
* Application's resources.
99
*/
@@ -17,3 +17,6 @@ MAINICON ICON "Assets\MainIcon.ico"
1717

1818
/* Manifest file */
1919
1 24 "Assets\PasHiGUI.manifest"
20+
21+
/* Data file containing version information data for PasHi and PasHiGUI */
22+
VERSION_DATA RCDATA "..\..\VERSION"

Src/GUI/VersionInfo.vi

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@
66
; Copyright (C) 2006-2022, Peter Johnson (www.delphidabbler.com).
77
;
88
; Version information description file used to create VersionInfo.res resource
9-
; file. Build this file with DelphiDabbler Version Information Editor from
10-
; https://delphidabbler.com/. Compile the resulting .rc file using Borland
11-
; BRCC32 resource compiler.
9+
; file. Build this file with DelphiDabbler Version Information Editor v2.14.0 or
10+
; later from https://delphidabbler.com/. Compile the resulting .rc file using
11+
; the Embarcadero BRCC32 resource compiler.
1212
; ==============================================================================
1313

14+
[Macros]
15+
Import:ver=../../VERSION
1416

1517
[Fixed File Info]
16-
File Version #=1, 2, 0, 7
17-
Product Version #=2, 2, 0, 0
18+
File Version #=<%ver.guifilever>.<%ver.guibuild>
19+
Product Version #=<%ver.productver>
1820
File OS=4
1921
File Type=1
2022
File Sub-Type=0
@@ -31,7 +33,7 @@ Company Name=DelphiDabbler
3133
File Description=Pascal Highlighter GUI
3234
File Version=<#F1>.<#F2>.<#F3> build <#F4>
3335
Internal Name=<SHORTFNAME>
34-
Legal Copyright=Copyright (C) 2006-<YEAR>, Peter Johnson (www.delphidabbler.com).
36+
Legal Copyright=Copyright (C) 2006-<YEAR>, Peter Johnson (https://delphidabbler.com).
3537
Legal Trademark=
3638
Original File Name=PasHiGUI.exe
3739
Private Build=
@@ -42,3 +44,5 @@ Special Build=
4244
[Configuration Details]
4345
Identifier=
4446
NumRCComments=0
47+
ResOutputDir=
48+
FileVersion=1

Src/Renderers.UBranding.pas

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ TBrandingGenerator = class abstract(TInterfacedObject)
2424
fInhibited: Boolean;
2525
strict protected
2626
function RenderBranding: string; virtual; abstract;
27+
function GetFileVersionStr: string;
2728
public
2829
constructor Create(Inhibited: Boolean);
2930
function Render: string;
@@ -68,6 +69,18 @@ constructor TBrandingGenerator.Create(Inhibited: Boolean);
6869
fInhibited := Inhibited;
6970
end;
7071

72+
function TBrandingGenerator.GetFileVersionStr: string;
73+
var
74+
VI: TVersionInfo;
75+
begin
76+
VI := TVersionInfo.Create;
77+
try
78+
Result := VI.CmdLineVersion;
79+
finally
80+
VI.Free;
81+
end;
82+
end;
83+
7184
function TBrandingGenerator.Render: string;
7285
begin
7386
if fInhibited then

Src/Resources.rc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
44
* obtain one at http://mozilla.org/MPL/2.0/
55
*
6-
* Copyright (C) 2005-2012, Peter Johnson (www.delphidabbler.com).
6+
* Copyright (C) 2005-2022, Peter Johnson (www.delphidabbler.com).
77
*
88
* Resource file for PasHi.
99
*/
@@ -21,3 +21,5 @@ CSS_DEFAULT RCDATA Assets\Default.css
2121
/* Help screen text */
2222
HELP RCDATA Assets\Help.txt
2323

24+
/* Data file containing version information data for PasHi and PasHiGUI */
25+
VERSION_DATA RCDATA "..\VERSION"

Src/UMain.pas

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,15 @@ procedure TMain.ShowHelp;
177177
end;
178178

179179
procedure TMain.ShowVersion;
180+
var
181+
VI: TVersionInfo;
180182
begin
181-
fConsole.WriteLn(GetFileVersionStr);
183+
VI := TVersionInfo.Create;
184+
try
185+
fConsole.WriteLn(VI.CmdLineVersion);
186+
finally
187+
VI.Free;
188+
end;
182189
end;
183190

184191
procedure TMain.ShowWarnings;

0 commit comments

Comments
 (0)