Skip to content

Commit 4af4e84

Browse files
ver. 2.2.0
- Fixed loading content when Viewer is already open
1 parent 39bfa58 commit 4af4e84

File tree

6 files changed

+41
-9
lines changed

6 files changed

+41
-9
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Markdown Help Viewer [![License](https://img.shields.io/badge/License-Apache%202.0-yellowgreen.svg)](https://opensource.org/licenses/Apache-2.0)
22

3-
**Latest Version 2.1.2 - 19 Mar 2024**
3+
**Latest Version 2.2.0 - 20 Mar 2024**
44

55
**An integrated help system based on files in Markdown format (and also html), for Delphi and Windows applications**
66

@@ -98,6 +98,9 @@ Then the interface searches in the same folder of default file (specified into A
9898

9999
## Release Notes ##
100100

101+
20 Mar 2024: ver. 2.2.0
102+
- Fixed loading content when Viewer is already open
103+
101104
19 Mar 2024: ver. 2.1.2
102105
- Added property "AutoLoadOnHotSpotClick" to TMarkdownViewer
103106
- Fixed resize Font changing Monitor-DPI

Setup/MarkDownHelpViewerSetup.iss

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
; Script generated by the Inno Setup Script Wizard.
22
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
33
#define MyAppName 'Markdown Help Viewer'
4-
#define MyAppVersion '2.1.2'
4+
#define MyAppVersion '2.2.0'
55

66
[Setup]
77
AppName={#MyAppName}
@@ -45,6 +45,16 @@ Name: es; MessagesFile: compiler:Languages\Spanish.isl; LicenseFile: .\License_E
4545
Name: fr; MessagesFile: compiler:Languages\French.isl; LicenseFile: .\License_ENG.rtf
4646
Name: pt; MessagesFile: compiler:Languages\Portuguese.isl; LicenseFile: .\License_ENG.rtf
4747

48+
49+
[CustomMessages]
50+
UninstallMessage=Undefined
51+
en.UninstallMessage=An older version of "Markdown Help Viewer" was detected. The uninstaller will be executed...
52+
it.UninstallMessage=È stata rilevata una versione precedente di "Markdown Help Viewer". Il programma di disinstallazione verrà eseguito...
53+
de.UninstallMessage=Eine ältere Version von "Markdown Help Viewer" wurde erkannt. Das Deinstallationsprogramm wird ausgeführt...
54+
es.UninstallMessage=Se detectó una versión anterior de "Markdown Help Viewer". El desinstalador se ejecutará...
55+
fr.UninstallMessage=Une ancienne version de «Markdown Help Viewer» a été détectée. Le programme de désinstallation sera exécuté...
56+
pt.UninstallMessage=Uma versão mais antiga do "Markdown Help Viewer" foi detectada. O desinstalador será executado...
57+
4858
[Tasks]
4959
Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked; Components: Viewer
5060

@@ -158,7 +168,7 @@ begin
158168
if (IsUpgrade()) then
159169
begin
160170
if not IsSilentMode() then
161-
MsgBox(ExpandConstant('An older version of "Markdown Help Viewer" was detected. The uninstaller will be executed...'), mbInformation, MB_OK);
171+
MsgBox(ExpandConstant('{cm:UninstallMessage}'), mbInformation, MB_OK);
162172
UnInstallOldVersion();
163173
end;
164174
end;

Source/MDHelpView.Main.pas

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,7 +1360,8 @@ procedure TMainForm.UpdateCaption;
13601360
procedure TMainForm.WMCopyData(var Message: TMessage);
13611361
var
13621362
p : PCopyDataStruct;
1363-
LFilePath, LFileName : string[255];
1363+
LFilePath, LFileName: string[255];
1364+
LFullName: string;
13641365
r : PRecToPass;
13651366
begin
13661367
p := PCopyDataStruct( Message.lParam );
@@ -1369,8 +1370,9 @@ procedure TMainForm.WMCopyData(var Message: TMessage);
13691370
r := PRecToPass(PCopyDataStruct(Message.LParam)^.lpData);
13701371
LFilePath := r^.FilePath;
13711372
LFileName := r^.FileName;
1373+
LFullName := StripQuotes(String(LFilePath+LFileName));
13721374
{$WARN IMPLICIT_STRING_CAST OFF}
1373-
LoadAndTransformFile(LFilePath+LFileName);
1375+
LoadAndTransformFile(LFullName);
13741376
if Self.WindowState = wsMinimized then
13751377
Self.WindowState := wsNormal;
13761378
end

Source/MDHelpView.Misc.pas

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ interface
5555
var MajorVersion, MinorVersion, Release, Build : integer);
5656
function GetVersionString(const FileName: string;
5757
FormatString: string = '%d.%d.%d'): string;
58+
function StripQuotes(const AValue: string): string;
5859

5960
resourcestring
6061
STextNotFound = 'Text not found';
@@ -195,6 +196,23 @@ function GetVersionString(const FileName: string;
195196
Result := Format(FormatString,[MajorVersion, MinorVersion, Release, Build]);
196197
end;
197198

199+
function StripQuotes(const AValue: string): string;
200+
201+
procedure StripQuote(const AQuote: Char);
202+
begin
203+
var Len := Length(Result);
204+
if (Copy(Result,1,1) = AQuote) and
205+
(Copy(Result,Len,1) = AQuote) then
206+
Result := Copy(Result,2,Len-2);
207+
end;
208+
209+
begin
210+
Result := AValue;
211+
StripQuote('"');
212+
StripQuote('''');
213+
end;
214+
215+
198216
initialization
199217

200218
end.

Source/MDHelpViewer.dproj

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<FrameworkType>VCL</FrameworkType>
66
<Base>True</Base>
77
<Config Condition="'$(Config)'==''">Debug</Config>
8-
<Platform Condition="'$(Platform)'==''">Win32</Platform>
8+
<Platform Condition="'$(Platform)'==''">Win64</Platform>
99
<TargetedPlatforms>3</TargetedPlatforms>
1010
<AppType>Application</AppType>
1111
<MainSource>MDHelpViewer.dpr</MainSource>
@@ -69,13 +69,12 @@
6969
<SanitizedProjectName>MDHelpViewer</SanitizedProjectName>
7070
<DCC_UnitSearchPath>..\Ext\HTMLViewer\Source;..\Ext\MarkdownProcessor\Source;..\Ext\SVGIconImageList\Source;..\Ext\SVGIconImageList\Image32\Source;..\Ext\SynPDF;..\Ext\VclStyleUtils\Common;..\Ext\VclStyleUtils\DDetours\Source;..\Ext\StyledComponents\source;..\Ext\ISMultiLanguage\src\Engine;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
7171
<VerInfo_Locale>1033</VerInfo_Locale>
72-
<VerInfo_Keys>CompanyName=Ethea S.r.l.;FileDescription=Markdown Help Viewer;FileVersion=2.1.2.0;InternalName=;LegalCopyright=Copyright (c) Ethea S.r.l.;LegalTrademarks=;OriginalFilename=;ProgramID=;ProductName=MarkdownHelpViewer;ProductVersion=2.1;Comments=</VerInfo_Keys>
72+
<VerInfo_Keys>CompanyName=Ethea S.r.l.;FileDescription=Markdown Help Viewer;FileVersion=2.2.0.0;InternalName=;LegalCopyright=Copyright (c) Ethea S.r.l.;LegalTrademarks=;OriginalFilename=;ProgramID=;ProductName=MarkdownHelpViewer;ProductVersion=2.2;Comments=</VerInfo_Keys>
7373
<Custom_Styles>Glow|VCLSTYLE|$(BDSCOMMONDIR)\Styles\Glow.vsf;Sky|VCLSTYLE|$(BDSCOMMONDIR)\Styles\Sky.vsf;Windows10|VCLSTYLE|$(BDSCOMMONDIR)\Styles\Windows10.vsf;&quot;Windows10 Dark|VCLSTYLE|$(BDSCOMMONDIR)\Styles\Windows10Dark.vsf&quot;;&quot;Windows10 SlateGray|VCLSTYLE|$(BDSCOMMONDIR)\Styles\Windows10SlateGray.vsf&quot;;&quot;Windows11 Modern Dark|VCLSTYLE|$(BDSCOMMONDIR)\Styles\Windows11_Modern_Dark.vsf&quot;;&quot;Windows11 Modern Light|VCLSTYLE|$(BDSCOMMONDIR)\Styles\Windows11_Modern_Light.vsf&quot;</Custom_Styles>
7474
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
7575
<VerInfo_MajorVer>2</VerInfo_MajorVer>
7676
<DCC_Define>SKIA;STYLEDCOMPONENTS;$(DCC_Define)</DCC_Define>
77-
<VerInfo_MinorVer>1</VerInfo_MinorVer>
78-
<VerInfo_Release>2</VerInfo_Release>
77+
<VerInfo_MinorVer>2</VerInfo_MinorVer>
7978
</PropertyGroup>
8079
<PropertyGroup Condition="'$(Base_Win32)'!=''">
8180
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>

Source/MDHelpViewer.res

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)