Skip to content

Commit 9514c13

Browse files
author
Markus Humm
committed
Opening project per cmd-line added and new about dialog
Added a still to be tested option to open dccp files by passing them as command-line params to the application and replaced the about dialog with a better one.
1 parent 3bea526 commit 9514c13

12 files changed

+1844
-52
lines changed

Icons/Magic-icon_128.png

23.4 KB
Loading

Icons/Magic-icon_64.png

7.57 KB
Loading

Icons/Magic-icon_96.png

15.5 KB
Loading

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ editing mode but other than that it looks fine.
3434
In the root folder of the project you will find further files with information about
3535
this project like *NOTICE.txt*, *CONTRIBUTING.md*, *SECURITY.md*.
3636

37+
## Where is the Code Coverage command line tool from?
38+
The command line tool used is some not yet up to date version of this one:
39+
https://github.com/DelphiCodeCoverage/DelphiCodeCoverage
40+
41+
The plan is to look at it again and update it, if it is still compatible or adapt
42+
if there's anything to change. This should happen in the near future.
43+
3744
## How to install?
3845
Just open and run the project provided in the Source directory.
3946
When run for the first time or when you installed another version of the IDE it will

Source/AboutForm.dfm

+144
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
object FormAbout: TFormAbout
2+
Left = 0
3+
Top = 0
4+
Caption = 'About'
5+
ClientHeight = 270
6+
ClientWidth = 479
7+
Color = clBtnFace
8+
Font.Charset = DEFAULT_CHARSET
9+
Font.Color = clWindowText
10+
Font.Height = -12
11+
Font.Name = 'Segoe UI'
12+
Font.Style = []
13+
Position = poOwnerFormCenter
14+
OnCreate = FormCreate
15+
TextHeight = 15
16+
object VirtualImage1: TVirtualImage
17+
Left = 16
18+
Top = 16
19+
Width = 64
20+
Height = 64
21+
ImageCollection = dm_Icons.ImageCollection
22+
ImageWidth = 0
23+
ImageHeight = 0
24+
ImageIndex = 14
25+
ImageName = 'Magic-icon'
26+
end
27+
object Label1: TLabel
28+
Left = 96
29+
Top = 16
30+
Width = 264
31+
Height = 21
32+
Caption = 'Delphi Code Coverage Wizard Plus'
33+
Font.Charset = DEFAULT_CHARSET
34+
Font.Color = clWindowText
35+
Font.Height = -16
36+
Font.Name = 'Segoe UI'
37+
Font.Style = [fsBold]
38+
ParentFont = False
39+
end
40+
object Label2: TLabel
41+
Left = 96
42+
Top = 43
43+
Width = 38
44+
Height = 15
45+
Caption = 'Version'
46+
end
47+
object LabelVersion: TLabel
48+
Left = 160
49+
Top = 43
50+
Width = 66
51+
Height = 15
52+
Caption = 'LabelVersion'
53+
end
54+
object Label3: TLabel
55+
Left = 96
56+
Top = 64
57+
Width = 364
58+
Height = 15
59+
Caption = #169' 2022-2022 Markus Humm and Team Delphi Code Coverage Wizard'
60+
end
61+
object Label4: TLabel
62+
Left = 16
63+
Top = 110
64+
Width = 234
65+
Height = 30
66+
Caption =
67+
'Based on the following works:'#13'Delphi Code Coverage Wizard from T' +
68+
'ridentT '
69+
end
70+
object Label5: TLabel
71+
Left = 16
72+
Top = 166
73+
Width = 271
74+
Height = 15
75+
Caption = 'and an older version of Delphi Code Coverage from'
76+
end
77+
object PanelBottom: TPanel
78+
Left = 0
79+
Top = 213
80+
Width = 479
81+
Height = 57
82+
Align = alBottom
83+
BevelEdges = [beTop]
84+
BevelKind = bkTile
85+
BevelOuter = bvNone
86+
TabOrder = 0
87+
ExplicitTop = 384
88+
ExplicitWidth = 624
89+
object ButtonOK: TButton
90+
Left = 16
91+
Top = 8
92+
Width = 158
93+
Height = 42
94+
Caption = '&OK'
95+
Default = True
96+
ImageIndex = 0
97+
ImageName = 'Actions-dialog-ok-apply-icon'
98+
ImageMargins.Left = 5
99+
Images = VirtualImageList32
100+
ModalResult = 1
101+
TabOrder = 0
102+
end
103+
end
104+
object LinkLabel1: TLinkLabel
105+
Left = 16
106+
Top = 141
107+
Width = 291
108+
Height = 19
109+
Caption = 'https://sourceforge.net/projects/delphicodecoverage/'
110+
TabOrder = 1
111+
UseVisualStyle = True
112+
end
113+
object LinkLabel2: TLinkLabel
114+
Left = 16
115+
Top = 187
116+
Width = 340
117+
Height = 19
118+
Caption = 'https://github.com/DelphiCodeCoverage/DelphiCodeCoverage'
119+
TabOrder = 2
120+
UseVisualStyle = True
121+
end
122+
object LinkLabel3: TLinkLabel
123+
Left = 96
124+
Top = 85
125+
Width = 348
126+
Height = 19
127+
Caption = 'https://github.com/MHumm/delphi-code-coverage-wizard-plus'
128+
TabOrder = 3
129+
UseVisualStyle = True
130+
end
131+
object VirtualImageList32: TVirtualImageList
132+
Images = <
133+
item
134+
CollectionIndex = 8
135+
CollectionName = 'Actions-dialog-ok-apply-icon'
136+
Name = 'Actions-dialog-ok-apply-icon'
137+
end>
138+
ImageCollection = dm_Icons.ImageCollection
139+
Width = 32
140+
Height = 32
141+
Left = 408
142+
Top = 8
143+
end
144+
end

Source/AboutForm.pas

+104
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
{*****************************************************************************
2+
The Delphi Code Coverage Wizzard team (see file NOTICE.txt) licenses this file
3+
to you under the Mozilla public License 1.1 (the
4+
"License"); you may not use this file except in compliance
5+
with the License. A copy of this licence is found in the root directory
6+
of this project in the file LICENCE.txt.
7+
8+
Unless required by applicable law or agreed to in writing,
9+
software distributed under the License is distributed on an
10+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
11+
KIND, either express or implied. See the License for the
12+
specific language governing permissions and limitations
13+
under the License.
14+
*****************************************************************************}
15+
16+
/// <summary>
17+
/// Copyright dialog
18+
/// </summary>
19+
unit AboutForm;
20+
21+
interface
22+
23+
uses
24+
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
25+
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, UDataModuleIcons, Vcl.StdCtrls,
26+
Vcl.ExtCtrls, System.ImageList, Vcl.ImgList, Vcl.VirtualImageList,
27+
Vcl.VirtualImage;
28+
29+
type
30+
/// <summary>
31+
/// Copyright dialog
32+
/// </summary>
33+
TFormAbout = class(TForm)
34+
PanelBottom: TPanel;
35+
ButtonOK: TButton;
36+
VirtualImageList32: TVirtualImageList;
37+
VirtualImage1: TVirtualImage;
38+
Label1: TLabel;
39+
Label2: TLabel;
40+
LabelVersion: TLabel;
41+
Label3: TLabel;
42+
Label4: TLabel;
43+
LinkLabel1: TLinkLabel;
44+
LinkLabel2: TLinkLabel;
45+
LinkLabel3: TLinkLabel;
46+
Label5: TLabel;
47+
procedure FormCreate(Sender: TObject);
48+
private
49+
/// <summary>
50+
/// Retrieves the file version from the version ressources
51+
/// </summary>
52+
/// <param name="FileName">
53+
/// Name of the exe/dll to retrieve the version from
54+
/// </param>
55+
/// <returns>
56+
/// Version information in the form of V<Major>.<Minor>.<Release> build <Build>
57+
/// </returns>
58+
function GetFileVersion(const FileName: TFileName): string;
59+
public
60+
end;
61+
62+
var
63+
FormAbout: TFormAbout;
64+
65+
implementation
66+
67+
{$R *.dfm}
68+
69+
procedure TFormAbout.FormCreate(Sender: TObject);
70+
begin
71+
try
72+
LabelVersion.Caption := GetFileVersion(Application.ExeName);
73+
except
74+
on e:Exception do
75+
LabelVersion.Caption := 'Failure: ' + e.Message;
76+
end;
77+
end;
78+
79+
function TFormAbout.GetFileVersion(const FileName: TFileName): string;
80+
var
81+
VerInfoSize: Cardinal;
82+
VerValueSize: Cardinal;
83+
Dummy: Cardinal;
84+
PVerInfo: Pointer;
85+
PVerValue: PVSFixedFileInfo;
86+
begin
87+
Result := '';
88+
VerInfoSize := GetFileVersionInfoSize(PChar(FileName), Dummy);
89+
GetMem(PVerInfo, VerInfoSize);
90+
try
91+
if GetFileVersionInfo(PChar(FileName), 0, VerInfoSize, PVerInfo) then
92+
if VerQueryValue(PVerInfo, '\', Pointer(PVerValue), VerValueSize) then
93+
with PVerValue^ do
94+
Result := Format('V%d.%d.%d build %d', [
95+
HiWord(dwFileVersionMS), //Major
96+
LoWord(dwFileVersionMS), //Minor
97+
HiWord(dwFileVersionLS), //Release
98+
LoWord(dwFileVersionLS)]); //Build
99+
finally
100+
FreeMem(PVerInfo, VerInfoSize);
101+
end;
102+
end;
103+
104+
end.

Source/DelphiCodeCoverageWizard.dpr

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ uses
1212
MainFormTexts in 'MainFormTexts.pas',
1313
UUtils in 'UUtils.pas',
1414
UScriptsGenerator in 'UScriptsGenerator.pas',
15-
UScriptRunner in 'UScriptRunner.pas';
15+
UScriptRunner in 'UScriptRunner.pas',
16+
AboutForm in 'AboutForm.pas' {FormAbout};
1617

1718
{$R *.res}
1819

@@ -21,5 +22,6 @@ begin
2122
Application.MainFormOnTaskbar := True;
2223
Application.CreateForm(Tdm_Icons, dm_Icons);
2324
Application.CreateForm(TFormMain, FormMain);
25+
Application.CreateForm(TFormAbout, FormAbout);
2426
Application.Run;
2527
end.

Source/DelphiCodeCoverageWizard.dproj

+11-2
Original file line numberDiff line numberDiff line change
@@ -76,24 +76,28 @@
7676
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
7777
<BT_BuildType>Debug</BT_BuildType>
7878
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
79-
<VerInfo_Keys>CompanyName=;FileDescription=Delphi Code Coverage Wizzard;FileVersion=1.0.0.0;InternalName=;LegalCopyright=© 2022 Markus Humm;LegalTrademarks=;OriginalFilename=;ProgramID=$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
79+
<VerInfo_Keys>CompanyName=;FileDescription=Delphi Code Coverage Wizard Plus;FileVersion=1.1.0.1;InternalName=;LegalCopyright=© 2022-2022 Markus Humm and Team DCCWP;LegalTrademarks=;OriginalFilename=;ProgramID=$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.1.0.0;Comments=</VerInfo_Keys>
8080
<VerInfo_Locale>1033</VerInfo_Locale>
8181
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
8282
<AppDPIAwarenessMode>PerMonitorV2</AppDPIAwarenessMode>
8383
<DCC_DcuOutput>..\Binaries\$(Platform)\$(Config)</DCC_DcuOutput>
8484
<DCC_ExeOutput>..\Binaries\$(Platform)\$(Config)</DCC_ExeOutput>
8585
<Icon_MainIcon>..\Icons\CodeCoverageWizard.ico</Icon_MainIcon>
86+
<VerInfo_Build>1</VerInfo_Build>
87+
<VerInfo_MinorVer>1</VerInfo_MinorVer>
8688
</PropertyGroup>
8789
<PropertyGroup Condition="'$(Base_Win64)'!=''">
8890
<DCC_UsePackage>FireDACIBDriver;RaizeComponentsVcl;vclwinx;fmx;vclie;DbxCommonDriver;bindengine;IndyIPCommon;VCLRESTComponents;FireDACCommonODBC;FireDACCommonDriver;appanalytics;IndyProtocols;vclx;IndyIPClient;dbxcds;vcledge;bindcompvclwinx;FmxTeeUI;bindcompfmx;inetdb;FireDACSqliteDriver;DbxClientDriver;Tee;soapmidas;vclactnband;TeeUI;fmxFireDAC;dbexpress;DBXMySQLDriver;VclSmp;inet;vcltouch;fmxase;dbrtl;fmxdae;TeeDB;FireDACMSAccDriver;CustomIPTransport;vcldsnap;DBXInterBaseDriver;IndySystem;vcldb;vclFireDAC;bindcomp;FireDACCommon;IndyCore;RESTBackendComponents;bindcompdbx;rtl;FireDACMySQLDriver;FireDACADSDriver;RaizeComponentsVclDb;RESTComponents;DBXSqliteDriver;vcl;IndyIPServer;dsnapxml;dsnapcon;adortl;VirtualTreesDR;vclimg;FireDACPgDriver;FireDAC;inetdbxpress;xmlrtl;tethering;bindcompvcl;dsnap;CloudService;fmxobj;bindcompvclsmp;FMXTee;soaprtl;soapserver;$(DCC_UsePackage)</DCC_UsePackage>
8991
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace)</DCC_Namespace>
9092
<BT_BuildType>Debug</BT_BuildType>
9193
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
92-
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
94+
<VerInfo_Keys>CompanyName=;FileDescription=Delphi Code Coverage Wizard Plus;FileVersion=1.1.0.1;InternalName=;LegalCopyright=© 2022-2022 Markus Humm and Team DCCWP;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.1.0.0;Comments=</VerInfo_Keys>
9395
<VerInfo_Locale>1033</VerInfo_Locale>
9496
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
9597
<Icon_MainIcon>..\Icons\CodeCoverageWizard.ico</Icon_MainIcon>
9698
<AppDPIAwarenessMode>none</AppDPIAwarenessMode>
99+
<VerInfo_Build>1</VerInfo_Build>
100+
<VerInfo_MinorVer>1</VerInfo_MinorVer>
97101
</PropertyGroup>
98102
<PropertyGroup Condition="'$(Cfg_1)'!=''">
99103
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
@@ -110,6 +114,7 @@
110114
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
111115
<VerInfo_Locale>1033</VerInfo_Locale>
112116
<DCC_DcuOutput>..\Binaries\$(Platform)\$(Config)</DCC_DcuOutput>
117+
<Icon_MainIcon>..\Icons\CodeCoverageWizard.ico</Icon_MainIcon>
113118
</PropertyGroup>
114119
<PropertyGroup Condition="'$(Cfg_1_Win64)'!=''">
115120
<AppDPIAwarenessMode>PerMonitorV2</AppDPIAwarenessMode>
@@ -152,6 +157,10 @@
152157
<DCCReference Include="UUtils.pas"/>
153158
<DCCReference Include="UScriptsGenerator.pas"/>
154159
<DCCReference Include="UScriptRunner.pas"/>
160+
<DCCReference Include="AboutForm.pas">
161+
<Form>FormAbout</Form>
162+
<FormType>dfm</FormType>
163+
</DCCReference>
155164
<BuildConfiguration Include="Base">
156165
<Key>Base</Key>
157166
</BuildConfiguration>

Source/DelphiCodeCoverageWizard.res

48 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)