Skip to content

Commit e74d990

Browse files
author
Markus Humm
committed
Added icon, improved misc. settings display auto fill coverage exe path
Added a project icon and 64 bit target. Misc. settings path and memo contents will be shown in more (hopefully all) scenarios. Path to CodeCoverage.exe will be prefilled with the one supplied with this project when creating a new project.
1 parent 02c111c commit e74d990

5 files changed

+92
-29
lines changed

Icons/CodeCoverageWizard.ico

158 KB
Binary file not shown.

Source/DelphiCodeCoverageWizard.dproj

+29-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<Base>True</Base>
77
<Config Condition="'$(Config)'==''">Debug</Config>
88
<Platform Condition="'$(Platform)'==''">Win32</Platform>
9-
<TargetedPlatforms>1</TargetedPlatforms>
9+
<TargetedPlatforms>3</TargetedPlatforms>
1010
<AppType>Application</AppType>
1111
<MainSource>DelphiCodeCoverageWizard.dpr</MainSource>
1212
</PropertyGroup>
@@ -34,6 +34,12 @@
3434
<Cfg_1>true</Cfg_1>
3535
<Base>true</Base>
3636
</PropertyGroup>
37+
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win64)'!=''">
38+
<Cfg_1_Win64>true</Cfg_1_Win64>
39+
<CfgParent>Cfg_1</CfgParent>
40+
<Cfg_1>true</Cfg_1>
41+
<Base>true</Base>
42+
</PropertyGroup>
3743
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_2)'!=''">
3844
<Cfg_2>true</Cfg_2>
3945
<CfgParent>Base</CfgParent>
@@ -45,6 +51,12 @@
4551
<Cfg_2>true</Cfg_2>
4652
<Base>true</Base>
4753
</PropertyGroup>
54+
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win64)'!=''">
55+
<Cfg_2_Win64>true</Cfg_2_Win64>
56+
<CfgParent>Cfg_2</CfgParent>
57+
<Cfg_2>true</Cfg_2>
58+
<Base>true</Base>
59+
</PropertyGroup>
4860
<PropertyGroup Condition="'$(Base)'!=''">
4961
<DCC_DcuOutput>.\$(Platform)\$(Config)</DCC_DcuOutput>
5062
<DCC_ExeOutput>.\$(Platform)\$(Config)</DCC_ExeOutput>
@@ -70,9 +82,18 @@
7082
<AppDPIAwarenessMode>PerMonitorV2</AppDPIAwarenessMode>
7183
<DCC_DcuOutput>..\Binaries\$(Platform)\$(Config)</DCC_DcuOutput>
7284
<DCC_ExeOutput>..\Binaries\$(Platform)\$(Config)</DCC_ExeOutput>
85+
<Icon_MainIcon>..\Icons\CodeCoverageWizard.ico</Icon_MainIcon>
7386
</PropertyGroup>
7487
<PropertyGroup Condition="'$(Base_Win64)'!=''">
7588
<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>
89+
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace)</DCC_Namespace>
90+
<BT_BuildType>Debug</BT_BuildType>
91+
<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>
93+
<VerInfo_Locale>1033</VerInfo_Locale>
94+
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
95+
<Icon_MainIcon>..\Icons\CodeCoverageWizard.ico</Icon_MainIcon>
96+
<AppDPIAwarenessMode>none</AppDPIAwarenessMode>
7697
</PropertyGroup>
7798
<PropertyGroup Condition="'$(Cfg_1)'!=''">
7899
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
@@ -90,6 +111,9 @@
90111
<VerInfo_Locale>1033</VerInfo_Locale>
91112
<DCC_DcuOutput>..\Binaries\$(Platform)\$(Config)</DCC_DcuOutput>
92113
</PropertyGroup>
114+
<PropertyGroup Condition="'$(Cfg_1_Win64)'!=''">
115+
<AppDPIAwarenessMode>PerMonitorV2</AppDPIAwarenessMode>
116+
</PropertyGroup>
93117
<PropertyGroup Condition="'$(Cfg_2)'!=''">
94118
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
95119
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
@@ -100,6 +124,9 @@
100124
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
101125
<VerInfo_Locale>1033</VerInfo_Locale>
102126
</PropertyGroup>
127+
<PropertyGroup Condition="'$(Cfg_2_Win64)'!=''">
128+
<AppDPIAwarenessMode>PerMonitorV2</AppDPIAwarenessMode>
129+
</PropertyGroup>
103130
<ItemGroup>
104131
<DelphiCompile Include="$(MainSource)">
105132
<MainSource>MainSource</MainSource>
@@ -982,7 +1009,7 @@
9821009
</Deployment>
9831010
<Platforms>
9841011
<Platform value="Win32">True</Platform>
985-
<Platform value="Win64">False</Platform>
1012+
<Platform value="Win64">True</Platform>
9861013
</Platforms>
9871014
</BorlandProject>
9881015
<ProjectFileVersion>12</ProjectFileVersion>

Source/DelphiCodeCoverageWizard.res

51.1 KB
Binary file not shown.

Source/MainForm.dfm

+13-26
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ object FormMain: TFormMain
2626
Width = 624
2727
Height = 400
2828
Align = alClient
29-
ActiveCard = crd_Finished
29+
ActiveCard = crd_Start
3030
BevelEdges = []
3131
BevelOuter = bvNone
3232
Caption = 'cp_Main'
3333
TabOrder = 0
34-
ExplicitWidth = 620
35-
ExplicitHeight = 399
34+
ExplicitWidth = 618
35+
ExplicitHeight = 391
3636
object crd_Start: TCard
3737
Left = 0
3838
Top = 0
@@ -190,8 +190,6 @@ object FormMain: TFormMain
190190
Caption = 'crd_EditSettings'
191191
CardIndex = 1
192192
TabOrder = 1
193-
ExplicitWidth = 620
194-
ExplicitHeight = 399
195193
DesignSize = (
196194
624
197195
400)
@@ -201,12 +199,10 @@ object FormMain: TFormMain
201199
Width = 424
202200
Height = 289
203201
Anchors = [akLeft, akTop, akRight, akBottom]
204-
ActiveCard = crd_UnitTestExecutable
202+
ActiveCard = crd_SaveAndRun
205203
BevelEdges = [beBottom]
206204
Caption = 'cp_Wizard'
207205
TabOrder = 0
208-
ExplicitWidth = 420
209-
ExplicitHeight = 288
210206
object crd_UnitTestExecutable: TCard
211207
Left = 1
212208
Top = 1
@@ -217,8 +213,6 @@ object FormMain: TFormMain
217213
CardIndex = 0
218214
TabOrder = 0
219215
OnEnter = crd_UnitTestExecutableEnter
220-
ExplicitWidth = 418
221-
ExplicitHeight = 286
222216
DesignSize = (
223217
422
224218
287)
@@ -251,7 +245,6 @@ object FormMain: TFormMain
251245
Anchors = [akLeft, akTop, akRight]
252246
TabOrder = 0
253247
OnChange = EditExeFileChange
254-
ExplicitWidth = 351
255248
end
256249
object EditMapFile: TEdit
257250
Left = 8
@@ -261,7 +254,6 @@ object FormMain: TFormMain
261254
Anchors = [akLeft, akTop, akRight]
262255
TabOrder = 1
263256
OnChange = EditMapFileChange
264-
ExplicitWidth = 351
265257
end
266258
object ButtonOpenExe: TButton
267259
Left = 369
@@ -275,7 +267,6 @@ object FormMain: TFormMain
275267
Images = VirtualImageListButtons16
276268
TabOrder = 2
277269
OnClick = ButtonOpenExeClick
278-
ExplicitLeft = 365
279270
end
280271
object ButtonOpenMap: TButton
281272
Left = 369
@@ -289,7 +280,6 @@ object FormMain: TFormMain
289280
Images = VirtualImageListButtons16
290281
TabOrder = 3
291282
OnClick = ButtonOpenMapClick
292-
ExplicitLeft = 365
293283
end
294284
object EditCodeCoverageExe: TEdit
295285
Left = 8
@@ -299,7 +289,6 @@ object FormMain: TFormMain
299289
Anchors = [akLeft, akTop, akRight]
300290
TabOrder = 4
301291
OnChange = EditCodeCoverageExeChange
302-
ExplicitWidth = 351
303292
end
304293
object ButtonOpenCodeCoverage: TButton
305294
Left = 369
@@ -313,7 +302,6 @@ object FormMain: TFormMain
313302
Images = VirtualImageListButtons16
314303
TabOrder = 5
315304
OnClick = ButtonOpenCodeCoverageClick
316-
ExplicitLeft = 365
317305
end
318306
end
319307
object crd_Source: TCard
@@ -649,7 +637,7 @@ object FormMain: TFormMain
649637
Top = 194
650638
Width = 95
651639
Height = 73
652-
Hint = 'Open an existing project and run it'
640+
Hint = 'Go back to main/start screen'
653641
Caption = '&Home'
654642
ImageAlignment = iaTop
655643
ImageIndex = 13
@@ -669,7 +657,6 @@ object FormMain: TFormMain
669657
Align = alLeft
670658
BevelEdges = [beRight]
671659
TabOrder = 1
672-
ExplicitHeight = 399
673660
object ButtonGroup1: TButtonGroup
674661
Left = 1
675662
Top = 1
@@ -707,7 +694,6 @@ object FormMain: TFormMain
707694
TabOrder = 0
708695
TabStop = False
709696
OnButtonClicked = ButtonGroup1ButtonClicked
710-
ExplicitHeight = 397
711697
end
712698
end
713699
object PanelHeader: TPanel
@@ -723,7 +709,6 @@ object FormMain: TFormMain
723709
ShowCaption = False
724710
TabOrder = 2
725711
StyleElements = [seFont, seBorder]
726-
ExplicitWidth = 420
727712
object LabelTop: TLabel
728713
AlignWithMargins = True
729714
Left = 4
@@ -747,8 +732,6 @@ object FormMain: TFormMain
747732
Caption = 'PanelBottomNavigation'
748733
ShowCaption = False
749734
TabOrder = 3
750-
ExplicitTop = 348
751-
ExplicitWidth = 419
752735
object ButtonPrevious: TButton
753736
Left = 0
754737
Top = 5
@@ -831,6 +814,8 @@ object FormMain: TFormMain
831814
Caption = 'crd_Finished'
832815
CardIndex = 3
833816
TabOrder = 3
817+
ExplicitWidth = 618
818+
ExplicitHeight = 391
834819
DesignSize = (
835820
624
836821
400)
@@ -851,15 +836,17 @@ object FormMain: TFormMain
851836
object WebBrowser: TWebBrowser
852837
Left = 0
853838
Top = 48
854-
Width = 624
855-
Height = 352
839+
Width = 774
840+
Height = 431
856841
Anchors = [akLeft, akTop, akRight, akBottom]
857842
TabOrder = 1
858843
SelectedEngine = EdgeIfAvailable
844+
ExplicitWidth = 768
845+
ExplicitHeight = 422
859846
ControlData = {
860-
4C0000007E400000612400000000000000000000000000000000000000000000
847+
4C000000FF3F0000A32300000000000000000000000000000000000000000000
861848
000000004C000000000000000000000001000000E0D057007335CF11AE690800
862-
2B2E126200000000000000004C0000000114020000000000C000000000000046
849+
2B2E126208000000000000004C0000000114020000000000C000000000000046
863850
8000000000000000000000000000000000000000000000000000000000000000
864851
00000000000000000100000000000000000000000000000000000000}
865852
end

Source/MainForm.pas

+50-1
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,26 @@ TFormMain = class(TForm)
268268
/// Event which is being called when a coverage test run has been finished
269269
/// </summary>
270270
procedure OnTestRunFinished(Sender: TObject);
271+
/// <summary>
272+
/// At least the version of TWebbrowser shipping out of the box with 11.2
273+
/// doesn't handle anchors right and bottom properly, so this sets the size
274+
/// of the WebBrowser control used to show HTML output of a coverage run
275+
/// based on card size it is on.
276+
/// </summary>
271277
procedure AdjustWebBrowserSize;
278+
/// <summary>
279+
/// Displays the paths used in the generated script in the memo
280+
/// </summary>
281+
procedure DisplayScriptOutputPaths;
282+
/// <summary>
283+
/// Prepare display of all dynamic contents on the misc. settings page
284+
/// </summary>
285+
procedure PrepareScriptOutputPathDisplay;
286+
/// <summary>
287+
/// Preinitializes the path to the code coverage command line tool with the
288+
/// one shipping with this wizard.
289+
/// </summary>
290+
procedure PreInitCodeCoverageExe;
272291
public
273292
end;
274293

@@ -451,7 +470,7 @@ procedure TFormMain.ButtonGroup1ButtonClicked(Sender: TObject; Index: Integer);
451470
3 : begin
452471
cp_Wizard.ActiveCard := crd_MiscSettings;
453472
crd_MiscSettings.Tag := cImgCompletedPage;
454-
LabelPath.Caption := FProject.ScriptsOutputPath;
473+
PrepareScriptOutputPathDisplay;
455474
end;
456475
4 : cp_Wizard.ActiveCard := crd_SaveAndRun;
457476
else
@@ -473,6 +492,7 @@ procedure TFormMain.ButtonNewClick(Sender: TObject);
473492
ButtonPrevious.Enabled := false;
474493
ButtonNext.Enabled := true;
475494
ButtonPrevious.Enabled := true;
495+
PreInitCodeCoverageExe;
476496

477497
for var Item in ButtonGroup1.Items do
478498
(Item as TGrpButtonItem).ImageIndex := -1;
@@ -493,11 +513,35 @@ procedure TFormMain.ButtonNextClick(Sender: TObject);
493513
if (cp_Wizard.ActiveCardIndex = cp_Wizard.CardCount-1) then
494514
ButtonNext.Enabled := false;
495515

516+
if cp_Wizard.ActiveCard = crd_MiscSettings then
517+
PrepareScriptOutputPathDisplay;
518+
496519
SetMiscSettingsCheckIfActive;
497520
SetFocusToFirstProjectCardControl;
498521
end;
499522
end;
500523

524+
procedure TFormMain.PreInitCodeCoverageExe;
525+
var
526+
Path : string;
527+
begin
528+
if (EditCodeCoverageExe.Text = '') then
529+
begin
530+
Path := TPath.GetDirectoryName(Application.ExeName);
531+
// go up 2 directories
532+
Path := Path.Remove(Path.LastIndexOf(TPath.DirectorySeparatorChar));
533+
Path := Path.Remove(Path.LastIndexOf(TPath.DirectorySeparatorChar));
534+
EditCodeCoverageExe.Text := TPath.Combine(Path, 'CodeCoverage.exe');
535+
end;
536+
end;
537+
538+
procedure TFormMain.PrepareScriptOutputPathDisplay;
539+
begin
540+
LabelPath.Caption := FProject.ScriptsOutputPath;
541+
MemoScriptPreview.Lines.Clear;
542+
DisplayScriptOutputPaths;
543+
end;
544+
501545
procedure TFormMain.SetMiscSettingsCheckIfActive;
502546
begin
503547
if cp_Wizard.ActiveCard = crd_MiscSettings then
@@ -853,6 +897,11 @@ procedure TFormMain.CheckBoxRelativePathsClick(Sender: TObject);
853897

854898
MemoScriptPreview.Clear;
855899

900+
DisplayScriptOutputPaths;
901+
end;
902+
903+
procedure TFormMain.DisplayScriptOutputPaths;
904+
begin
856905
if FProject.RelativeToScriptPath then
857906
begin
858907
MemoScriptPreview.Lines.Add('DelphiCoverage.exe: ' +

0 commit comments

Comments
 (0)