Skip to content

Commit 0cc8f60

Browse files
author
Carlo Barazzetta
committed
20 Feb 2026: ver. 2.4.0
- Fixed position for "View" Button in multimonitor environment - Changed Open Dialog with modern Layout - Removed .txt files support
1 parent ae04ae3 commit 0cc8f60

File tree

93 files changed

+4276
-580
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+4276
-580
lines changed

Demo/Source/DemoAbout.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{ Markdown Help Viewer: Demo About Form }
44
{ (Help Viewer and Help Interfaces for Markdown files) }
55
{ }
6-
{ Copyright (c) 2023-2025 (Ethea S.r.l.) }
6+
{ Copyright (c) 2023-2026 (Ethea S.r.l.) }
77
{ Author: Carlo Barazzetta }
88
{ }
99
{ https://github.com/EtheaDev/MarkdownHelpViewer }

Demo/Source/MainForm.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{ Markdown Help Viewer: Demo Main Form }
44
{ (Help Viewer and Help Interfaces for Markdown files) }
55
{ }
6-
{ Copyright (c) 2023-2025 (Ethea S.r.l.) }
6+
{ Copyright (c) 2023-2026 (Ethea S.r.l.) }
77
{ Author: Carlo Barazzetta }
88
{ }
99
{ https://github.com/EtheaDev/MarkdownHelpViewer }

Demo/Source/MarkDownHelpViewerDemo.dpr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{ Markdown Help Viewer: Demo }
44
{ (Help Viewer and Help Interfaces for Markdown files) }
55
{ }
6-
{ Copyright (c) 2023-2025 (Ethea S.r.l.) }
6+
{ Copyright (c) 2023-2026 (Ethea S.r.l.) }
77
{ Author: Carlo Barazzetta }
88
{ }
99
{ https://github.com/EtheaDev/MarkdownHelpViewer }

Ext/HTMLViewer/Source/FramBrwz.pas

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ TFrameBrowser = class(TFVBase)
148148

149149
implementation
150150
{$ifdef Compiler24_Plus}
151-
uses System.Types;
151+
uses System.Types,
152+
System.Generics.Collections;
152153
{$endif}
153154

154155
function ConvDosToHTML(const Name: ThtString): ThtString; forward;

Ext/HTMLViewer/Source/HTMLSubs.pas

Lines changed: 57 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1761,6 +1761,7 @@ ThtDocument = class(TCell) {a list of all the sections -- the html document}
17611761
procedure SetBackgroundImage(const Name: ThtString; const APrec: PtPositionRec);
17621762
procedure SetFormControlData(FormData: TFormData);
17631763
procedure SetYOffset(Y: Integer);
1764+
procedure AddGDILinkComment(AHandle: HDC; const AUrl: ThtString; const ARect: TRect);
17641765
procedure SetFonts(const Name, PreName: ThtString; ASize: Integer;
17651766
AColor, AHotSpot, AVisitedColor, AActiveColor, ABackground: TColor; LnksActive, LinkUnderLine: Boolean;
17661767
ACodePage: TBuffCodePage; ACharSet: TFontCharSet; MarginHeight, MarginWidth: Integer);
@@ -2552,6 +2553,8 @@ procedure TFontObj.ConvertFont(const FI: ThtFontInfo);
25522553
end;
25532554

25542555
constructor TFontObj.CreateCopy(ASection: TSection; T: TFontObj);
2556+
var
2557+
LOriginalSize: Integer;
25552558
begin
25562559
inherited Create;
25572560
{$ifndef NoTabLink}
@@ -2561,8 +2564,13 @@ constructor TFontObj.CreateCopy(ASection: TSection; T: TFontObj);
25612564
SScript := T.SScript;
25622565
TheFont := ThtFont.Create;
25632566
TheFont.Assign(T.TheFont);
2567+
LOriginalSize := TheFont.Size; // Save original size before ConvertFont
25642568
if Assigned(T.FIArray) then
25652569
ConvertFont(T.FIArray.Ar[LFont]);
2570+
// Fix: restore font size if ConvertFont set it to 0 (happens with links)
2571+
// This ensures link text is rendered in PDF export via MakePagedMetaFiles
2572+
if (TheFont.Size = 0) and (LOriginalSize <> 0) then
2573+
TheFont.Size := LOriginalSize;
25662574
UrlTarget := TUrlTarget.Create;
25672575
UrlTarget.Assign(T.UrlTarget);
25682576
FontChanged;
@@ -3497,7 +3505,7 @@ procedure TImageObj.DrawInline(Canvas: TCanvas; X, Y, YBaseline: Integer; FO: TF
34973505
end;
34983506

34993507
if (Assigned(MyFormControl) and MyFormControl.Active or FO.Active) or
3500-
IsCopy and Assigned(Document.LinkDrawnEvent) and (FO.UrlTarget.Url <> '')
3508+
(IsCopy and (FO.UrlTarget.Url <> ''))
35013509
then
35023510
with Canvas do
35033511
begin
@@ -3517,8 +3525,15 @@ procedure TImageObj.DrawInline(Canvas: TCanvas; X, Y, YBaseline: Integer; FO: TF
35173525
Canvas.DrawFocusRect(ARect); {draw focus box}
35183526
end
35193527
else
3520-
Document.LinkDrawnEvent(Document.TheOwner, Document.LinkPage,
3521-
FO.UrlTarget.Url, FO.UrlTarget.Target, ARect);
3528+
begin
3529+
// When IsCopy is true (PDF export via MakePagedMetaFiles), insert a GDI comment
3530+
// that SynPDF will interpret as a hyperlink annotation
3531+
if FO.UrlTarget.Url <> '' then
3532+
Document.AddGDILinkComment(Canvas.Handle, FO.UrlTarget.Url, ARect);
3533+
if Assigned(Document.LinkDrawnEvent) then
3534+
Document.LinkDrawnEvent(Document.TheOwner, Document.LinkPage,
3535+
FO.UrlTarget.Url, FO.UrlTarget.Target, ARect);
3536+
end;
35223537
SetTextColor(handle, SaveColor);
35233538
end;
35243539
end;
@@ -7590,6 +7605,41 @@ procedure ThtDocument.SetYOffset(Y: Integer);
75907605
HideControls;
75917606
end;
75927607

7608+
//------------------------------------------------------------------------------
7609+
// AddGDILinkComment - Inserts a GDI comment into the metafile canvas that
7610+
// SynPDF will interpret as a hyperlink annotation during PDF export.
7611+
// The comment format is compatible with SynPDF's pgcLink/pgcLinkNoBorder.
7612+
//------------------------------------------------------------------------------
7613+
procedure ThtDocument.AddGDILinkComment(AHandle: HDC; const AUrl: ThtString;
7614+
const ARect: TRect);
7615+
const
7616+
pgcLinkNoBorder: Byte = 3; // from SynPdf.pas TPdfGDIComment enumeration
7617+
var
7618+
LUrl: RawByteString;
7619+
LData: RawByteString;
7620+
LLen, LTotalLen: Integer;
7621+
D: PAnsiChar;
7622+
begin
7623+
// Convert URL to UTF8 for SynPDF compatibility
7624+
LUrl := UTF8Encode(AUrl);
7625+
LLen := Length(LUrl);
7626+
// Format: 1 byte (link type) + SizeOf(TRect) bytes (rectangle) + URL bytes
7627+
LTotalLen := 1 + SizeOf(TRect) + LLen;
7628+
SetLength(LData, LTotalLen);
7629+
D := PAnsiChar(LData);
7630+
// pgcLinkNoBorder = 3 (no visible border around the link in PDF)
7631+
D^ := AnsiChar(pgcLinkNoBorder);
7632+
Inc(D);
7633+
// Copy rectangle
7634+
PRect(D)^ := ARect;
7635+
Inc(D, SizeOf(TRect));
7636+
// Copy URL
7637+
if LLen > 0 then
7638+
System.Move(Pointer(LUrl)^, D^, LLen);
7639+
// Insert GDI comment into the metafile
7640+
GdiComment(AHandle, LTotalLen, Pointer(LData));
7641+
end;
7642+
75937643
//-- BG ---------------------------------------------------------- 08.01.2023 --
75947644
function ThtDocument.ThemedColor(AColor: TColor; AStyleElement: ThtStyleElement): TColor;
75957645
begin
@@ -13799,6 +13849,10 @@ function TSection.Draw1(Canvas: TCanvas; const ARect: TRect;
1379913849
if Document.TheOwner.ShowFocusRect then //MK20091107
1380013850
Canvas.DrawFocusRect(ARect);
1380113851
end;
13852+
// When IsCopy is true (PDF export via MakePagedMetaFiles), insert a GDI comment
13853+
// that SynPDF will interpret as a hyperlink annotation
13854+
if IsCopy and (FO.UrlTarget.Url <> '') then
13855+
Document.AddGDILinkComment(Canvas.Handle, FO.UrlTarget.Url, ARect);
1380213856
if Assigned(Document.LinkDrawnEvent) then
1380313857
Document.LinkDrawnEvent(Document.TheOwner, Document.LinkPage,
1380413858
FO.UrlTarget.Url, FO.UrlTarget.Target, ARect);

Ext/HTMLViewer/package/Rad Studio 13/dclFrameViewer.dproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<FrameworkType>VCL</FrameworkType>
99
<Base>True</Base>
1010
<Platform Condition="'$(Platform)'==''">Win32</Platform>
11-
<TargetedPlatforms>1</TargetedPlatforms>
11+
<TargetedPlatforms>3</TargetedPlatforms>
1212
<AppType>Package</AppType>
1313
<ProjectName Condition="'$(ProjectName)'==''">dclFrameViewer</ProjectName>
1414
</PropertyGroup>
@@ -97,7 +97,7 @@
9797
</Delphi.Personality>
9898
<Platforms>
9999
<Platform value="Win32">True</Platform>
100-
<Platform value="Win64">False</Platform>
100+
<Platform value="Win64">True</Platform>
101101
<Platform value="Win64x">False</Platform>
102102
</Platforms>
103103
</BorlandProject>

Ext/ISMultiLanguage/src/Engine/CBMultiLanguage.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{ CBMultiLanguage }
44
{ (Localization engine) }
55
{ }
6-
{ Copyright (c) 2005-2025 (Ethea S.r.l.) }
6+
{ Copyright (c) 2005-2026 (Ethea S.r.l.) }
77
{ Author: Carlo Barazzetta }
88
{ }
99
{ https://github.com/EtheaDev/CBMultiLanguage }

Ext/ISMultiLanguage/src/Engine/CBMultiLanguageMessages.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{ CBMultiLanguage }
44
{ (Localization engine) }
55
{ }
6-
{ Copyright (c) 2005-2025 (Ethea S.r.l.) }
6+
{ Copyright (c) 2005-2026 (Ethea S.r.l.) }
77
{ Author: Carlo Barazzetta }
88
{ }
99
{ https://github.com/EtheaDev/CBMultiLanguage }

Ext/ISMultiLanguage/src/Engine/CBMultiLanguageUtils.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{ CBMultiLanguage }
44
{ (Localization engine) }
55
{ }
6-
{ Copyright (c) 2005-2025 (Ethea S.r.l.) }
6+
{ Copyright (c) 2005-2026 (Ethea S.r.l.) }
77
{ Author: Carlo Barazzetta }
88
{ }
99
{ https://github.com/EtheaDev/CBMultiLanguage }

Ext/ISMultiLanguage/src/Engine/CBMultiLanguageVCL.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{ CBMultiLanguage }
44
{ (Localization engine) }
55
{ }
6-
{ Copyright (c) 2005-2025 (Ethea S.r.l.) }
6+
{ Copyright (c) 2005-2026 (Ethea S.r.l.) }
77
{ Author: Carlo Barazzetta }
88
{ }
99
{ https://github.com/EtheaDev/CBMultiLanguage }

0 commit comments

Comments
 (0)