Skip to content

Commit

Permalink
Merge branch 'release/v4.23.0'
Browse files Browse the repository at this point in the history
Release v4.23.0
  • Loading branch information
delphidabbler committed Apr 2, 2024
2 parents 90cc0bb + 9c2e46a commit 02bad50
Show file tree
Hide file tree
Showing 26 changed files with 242 additions and 133 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ Releases are listed in reverse version number order.

> Note that _CodeSnip_ v4 was developed in parallel with v3 for a while. As a consequence some v3 releases have later release dates than early v4 releases.
## Release v4.23.0 of 02 April 2024

* Removed marketing names (e.g. "Athens" or "Rio") from Delphi compiler names to save space when the compiler names are displayed in the UI [issue #125].
* Added new `'` entity to REML markup language and boosted REML version to v6 as a consequence [issue #99].
* Refactored class helper code by splitting a single monolithic unit into three more specialised units [issue #90].
* Updated documentation and related help topic re change to REML v6.

## Release v4.22.0 of 08 November 2023

* Added support for test compiling snippets with Delphi 12 Athens [issue #121].
Expand Down
21 changes: 17 additions & 4 deletions Docs/Design/FileFormats/export.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/
*
* Copyright (C) 2012-2023, Peter Johnson (gravatar.com/delphidabbler).
* Copyright (C) 2012-2024, Peter Johnson (gravatar.com/delphidabbler).
*
* CodeSnip File Format Documentation: Export
-->
Expand Down Expand Up @@ -300,9 +300,13 @@ <h2>
encoded in REML markup. REML v4 is supported.
</li>
<li>
<span class="highlight">version 7.3 and later:</span> Content is formatted text
<span class="highlight">version 7.3 and 7.4:</span> Content is formatted text
encoded in REML markup. REML v5 is supported.
</li>
<li>
<span class="highlight">version 7.5 and later:</span> Content is formatted text
encoded in REML markup. REML v6 is supported.
</li>
</ul>
</dd>

Expand Down Expand Up @@ -447,7 +451,10 @@ <h2>
<span class="highlight">versions 5 to 7.2:</span> supports REML v4.
</li>
<li>
<span class="highlight">version 7.3 &amp; later:</span> supports REML v5.
<span class="highlight">version 7.3 &amp; 7.4:</span> supports REML v5.
</li>
<li>
<span class="highlight">version 7.5 &amp; later:</span> supports REML v6.
</li>
</ul>
</li>
Expand Down Expand Up @@ -993,6 +1000,12 @@ <h2>
<dd>
Updated in time for CodeSnip v4.22.0 to add support for Delphi 12 Athens.
</dd>
<dt>
<em>Version 7.5 - 2 April 2014</em>
</dt>
<dd>
Added support for REML v6, which is backward compatible with REML v4.
</dd>
</dl>
</dd>
</dl>
Expand Down Expand Up @@ -1042,7 +1055,7 @@ <h2>
</p>

<p>
Readers of v2 files and later can parse REML as v5, since all versions of REML up to v5 are backwards compatible.
Readers of v2 files and later can parse REML as v6, since all versions of REML up to v6 are backwards compatible.
</p>

</section>
Expand Down
4 changes: 2 additions & 2 deletions Docs/Design/FileFormats/main-db.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/
*
* Copyright (C) 2012-2023, Peter Johnson (gravatar.com/delphidabbler).
* Copyright (C) 2012-2024, Peter Johnson (gravatar.com/delphidabbler).
*
* CodeSnip File Format Documentation: Main Database
-->
Expand Down Expand Up @@ -928,7 +928,7 @@ <h2>
<ol>
<li id="footnote-1">
<p>
REML is a text markup language used to format text. REML version 5 is supported. The REML format is documented <a href="../reml.html">here</a>.
REML is a text markup language used to format text. REML version 6 is supported. The REML format is documented <a href="../reml.html">here</a>.
</p>
</li>
<li id="footnote-2">
Expand Down
21 changes: 17 additions & 4 deletions Docs/Design/FileFormats/user-db.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/
*
* Copyright (C) 2012-2023, Peter Johnson (gravatar.com/delphidabbler).
* Copyright (C) 2012-2024, Peter Johnson (gravatar.com/delphidabbler).
*
* CodeSnip File Format Documentation: User Database
-->
Expand Down Expand Up @@ -325,9 +325,13 @@ <h3 id="xml-file">
encoded in REML markup. REML v4 is supported.
</li>
<li>
<span class="highlight">version 6.11 &amp; later:</span> Content is formatted text
<span class="highlight">version 6.11 &amp; 6.12:</span> Content is formatted text
encoded in REML markup. REML v5 is supported.
</li>
<li>
<span class="highlight">version 6.13 &amp; later:</span> Content is formatted text
encoded in REML markup. REML v6 is supported.
</li>
</ul>
</dd>

Expand Down Expand Up @@ -472,7 +476,10 @@ <h3 id="xml-file">
<span class="highlight">versions 5 &amp; 6.10:</span> supports REML v4.
</li>
<li>
<span class="highlight">version 6.11 &amp; later:</span> supports REML v5.
<span class="highlight">version 6.11 &amp; 6.12:</span> supports REML v5.
</li>
<li>
<span class="highlight">version 6.13 &amp; later:</span> supports REML v6.
</li>
</ul>
</li>
Expand Down Expand Up @@ -1029,6 +1036,12 @@ <h2>
<dd>
Updated in time for CodeSnip v4.22.0 to add support for Delphi 12 Athens.
</dd>
<dt>
<em>Version 6.13 - 2 April 2024</em>
</dt>
<dd>
Updated with CodeSnip v4.23.0 to add support for REML v6, which is backwards compatible with REML v4.
</dd>
</dl>
</dd>
</dl>
Expand Down Expand Up @@ -1087,7 +1100,7 @@ <h3>
</ul>

<p>
Readers of v2 and later files may parse REML from any file version as if it were REML v5, since all versions of REML up to v5 are compatible.
Readers of v2 and later files may parse REML from any file version as if it were REML v6, since all versions of REML up to v6 are compatible.
</p>

<h3>
Expand Down
27 changes: 24 additions & 3 deletions Docs/Design/reml.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE HTML>

<!--
* This file copyright (C) 2020-2023, Peter Johnson (gravatar.com/delphidabbler) and
* This file copyright (C) 2020-2024, Peter Johnson (gravatar.com/delphidabbler) and
* is licensed under the MIT License: https://opensource.org/licenses/MIT
*
* DelphiDabbler Code Snippets Database Documentation: REML markup language
Expand Down Expand Up @@ -251,7 +251,7 @@ <h1>
The REML language is a SGML language similar to a greatly simplified XHTML. The are a small number of tags and character entities that can be used.
</p>
<aside>
<strong>Note:</strong> The language described here is REML v5. v4 is still in regular use in CodeSnip up to v4.20.x. Earlier versions are obsolete.
<strong>Note:</strong> The language described here is REML v6. v4 is still in regular use in CodeSnip up to v4.20.x. Earlier versions are obsolete.
</aside>

</section>
Expand Down Expand Up @@ -524,6 +524,10 @@ <h1>
<td><code>&amp;deg;</code></td>
<td>°</td>
</tr>
<tr>
<td><code>&amp;cent;</code></td>
<td>¢</td>
</tr>
<tr>
<td><code>&amp;laquo;</code></td>
<td>«</td>
Expand All @@ -536,6 +540,10 @@ <h1>
<td><code>&amp;iquest;</code></td>
<td>¿</td>
</tr>
<tr>
<td><code>&amp;apos;</code></td>
<td>'</td>
</tr>
</tbody>
</table>

Expand Down Expand Up @@ -644,8 +652,21 @@ <h1>Change Log</h1>
</li>
</ul>

</section>
<p>
<strong>v6 of 2024-04-02</strong>
</p>

<p>
Introduced in CodeSnip v4.23.0
</p>

<ul>
<li>
Added entity: <code class="value">&amp;apos;</code>.
</li>
</ul>

</section>

</body>

Expand Down
6 changes: 3 additions & 3 deletions Docs/License.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE HTML>

<!--
* Copyright (C) 2012-2023, Peter Johnson (gravatar.com/delphidabbler).
* Copyright (C) 2012-2024, Peter Johnson (gravatar.com/delphidabbler).
*
* CodeSnip license.
*
Expand Down Expand Up @@ -231,7 +231,7 @@ <h2>
Executable Program
</h2>
<p>
DelphiDabbler <em>CodeSnip</em> is copyright &copy; 2005-2023 by <a
DelphiDabbler <em>CodeSnip</em> is copyright &copy; 2005-2024 by <a
href="https://gravatar.com/delphidabbler"
>Peter D Johnson</a>.
</p>
Expand Down Expand Up @@ -1801,7 +1801,7 @@ <h2 id="ddab-exclusive">
</h2>

<p>
Files covered by this license are original work, copyright &copy; 2012-2023, <a href="https://gravatar.com/delphidabbler">Peter D Johnson</a>.
Files covered by this license are original work, copyright &copy; 2012-2024, <a href="https://gravatar.com/delphidabbler">Peter D Johnson</a>.
</p>

<p>
Expand Down
43 changes: 43 additions & 0 deletions Src/ClassHelpers.UActions.pas
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/
*
* Copyright (C) 2012-2024, Peter Johnson (gravatar.com/delphidabbler).
*
* Class helper for TCustomActionList
*
* Extracted in 2024 from original UClassHelpers unit (2012-2021)
}

unit ClassHelpers.UActions;

interface

uses
// Delphi
ActnList;

type
/// <summary>Class helper that adds a method to TCustomActionList that can
/// update all the actions in the list.</summary>
TActionListHelper = class helper for TCustomActionList
public
/// <summary>Updates all actions in the action list by calling their Update
/// methods.</summary>
procedure Update;
end;

implementation

{ TActionListHelper }

procedure TActionListHelper.Update;
var
Action: TContainedAction; // each action in list
begin
for Action in Self do
Action.Update;
end;

end.
68 changes: 68 additions & 0 deletions Src/ClassHelpers.UControls.pas
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/
*
* Copyright (C) 2012-2024, Peter Johnson (gravatar.com/delphidabbler).
*
* Class helper for TControl.
*
* Extracted in 2024 from original UClassHelpers unit (2012-2021).
}

unit ClassHelpers.UControls;

interface

uses
// Delphi
Controls, Menus;

type
/// <summary>Class helper that adds functionality to TControl.</summary>
TControlHelper = class helper for TControl
public
/// <summary>Gets reference to pop-up menu assigned to protected PopupMenu
/// property.</summary>
function GetPopupMenu: TPopupMenu;
/// <summary>Checks if protected PopupMenu property is assigned.</summary>
function HasPopupMenu: Boolean;
/// <summary>Refreshes control's action. Any changes in action that affect
/// state of control are reflected in control.</summary>
procedure RefreshAction;
/// <summary>Refreshes all owned controls to reflect any changes in their
/// associated actions.</summary>
procedure RefreshActions;
end;

implementation

{ TControlHelper }

function TControlHelper.GetPopupMenu: TPopupMenu;
begin
Result := PopupMenu;
end;

function TControlHelper.HasPopupMenu: Boolean;
begin
Result := Assigned(PopupMenu);
end;

procedure TControlHelper.RefreshAction;
begin
if Assigned(Action) then
ActionChange(Action, False);
end;

procedure TControlHelper.RefreshActions;
var
Idx: Integer; // loops through all controls
begin
for Idx := 0 to Pred(ComponentCount) do
if Components[Idx] is TControl then
(Components[Idx] as TControl).RefreshAction;
end;

end.

Loading

0 comments on commit 02bad50

Please sign in to comment.