Skip to content

Commit fcd88d6

Browse files
committed
Draw the breadcrumbs manually, removed static bitmaps, cleaned up code
1 parent a755fc5 commit fcd88d6

5 files changed

Lines changed: 89 additions & 18 deletions

File tree

bc1.bmp

-44 KB
Binary file not shown.

bc2.bmp

-38.1 KB
Binary file not shown.

bc3.bmp

-38.4 KB
Binary file not shown.

bg.bmp

66.1 KB
Binary file not shown.

developer_platform_installer.iss

Lines changed: 89 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ BackSolid=yes
3232
DisableWelcomePage=yes
3333

3434
[Files]
35-
Source: "bc1.bmp"; Flags: dontcopy
36-
Source: "bc2.bmp"; Flags: dontcopy
37-
Source: "bc3.bmp"; Flags: dontcopy
35+
Source: "bg.bmp"; Flags: dontcopy
3836

3937
[Languages]
4038
Name: "english"; MessagesFile: "compiler:Default.isl"
@@ -51,13 +49,24 @@ type
5149
Container: TPanel;
5250
Content: TPanel;
5351
end;
52+
BcLabelArray = array[1..4] of TLabel;
5453
5554
var
56-
AuthPageID: Integer;
57-
ComponentPageID: Integer;
55+
// Page IDs
56+
AuthPageID, ComponentPageID, DownloadPageID : Integer;
57+
5858
AuthLabel: TNewStaticText;
59-
StdColor: TColor;
6059
60+
// "Standard" blue color used throughout the installer
61+
StdColor: TColor;
62+
63+
// Breadcrumb image
64+
Breadcrumbs: TBitmapImage;
65+
66+
// Breadcrumb labels, we store references to these in an array for convenience
67+
BreadcrumbLabel: BcLabelArray;
68+
69+
// Converts a color String in the format '$rrggbb' to a TColor value
6170
function StringToColor(Color: String): TColor;
6271
var
6372
RR, GG, BB: String;
@@ -533,20 +542,68 @@ begin
533542
Result := IDPForm.Page.ID;
534543
end;
535544
545+
procedure SelectBreadcrumb(Index: Integer);
546+
var
547+
I: Integer;
548+
ItemColor: TColor;
549+
begin
550+
for I := 1 to 4 do
551+
begin
552+
if (I = Index) then
553+
begin
554+
ItemColor := StdColor;
555+
BreadcrumbLabel[I].Font.Style := BreadcrumbLabel[I].Font.Style + [fsBold];
556+
end
557+
else
558+
begin
559+
ItemColor := StringToColor('$cccccc');
560+
BreadcrumbLabel[I].Font.Style := BreadcrumbLabel[I].Font.Style - [fsBold];
561+
end;
562+
563+
BreadcrumbLabel[I].Font.Color := ItemColor;
564+
BreadcrumbLabel[I].Width := 120;
565+
BreadcrumbLabel[I].Alignment := taCenter;
566+
567+
with Breadcrumbs.Bitmap.Canvas do
568+
begin
569+
Brush.Color := ItemColor;
570+
Brush.Style := bsSolid;
571+
Pen.Color := ItemColor;;
572+
Ellipse(BreadcrumbLabel[I].Left + 54, 22, BreadcrumbLabel[I].Left + 64, 12);
573+
end;
574+
end;
575+
end;
576+
536577
procedure CurPageChanged(CurPageID: Integer);
537578
begin
538579
if (CurPageID = AuthPageID) then
539580
begin
540581
Wizardform.NextButton.Enabled := False;
582+
SelectBreadcrumb(1);
583+
end else if (CurPageID = ComponentPageID) then
584+
begin
585+
SelectBreadcrumb(2);
541586
end;
542587
end;
543588
589+
procedure CreateBreadcrumbLabel(Index: Integer; Caption: String);
590+
begin
591+
BreadcrumbLabel[Index] := TLabel.Create(WizardForm.MainPanel);
592+
BreadcrumbLabel[Index].Caption := Caption;
593+
BreadcrumbLabel[Index].Parent := WizardForm.MainPanel;
594+
BreadcrumbLabel[Index].Font.Color := StringToColor('$cccccc');
595+
BreadcrumbLabel[Index].Font.Size := 8;
596+
BreadcrumbLabel[Index].Top := 24;
597+
BreadcrumbLabel[Index].Left := 36 + ((Index - 1) * 120);
598+
BreadcrumbLabel[Index].Width := 120;
599+
BreadcrumbLabel[Index].Alignment := taCenter;
600+
end;
601+
544602
procedure InitializeWizard();
545603
var
546604
BackgroundBitmapImage: TBitmapImage;
547605
BackgroundBitmapText: TNewStaticText;
548606
BitmapFileName: String;
549-
BitmapImage: TBitmapImage;
550607
begin
551608
StdColor := StringToColor('$0093d9');
552609
@@ -563,21 +620,34 @@ begin
563620
564621
// Set the width of the top panel
565622
WizardForm.MainPanel.Width := 920;
566-
//WizardForm.MainPanel.Color := clGreen;
567-
568623
569624
WizardForm.WizardSmallBitmapImage.Visible := false;
570625
571-
BitmapFileName := ExpandConstant('{tmp}\bc1.bmp');
626+
Breadcrumbs := TBitmapImage.Create(WizardForm.MainPanel);
627+
Breadcrumbs.Parent := WizardForm.MainPanel;
628+
Breadcrumbs.Top := 0;
629+
Breadcrumbs.Left := 0;
630+
Breadcrumbs.Width := 600;
631+
Breadcrumbs.Height := 50;
632+
Breadcrumbs.AutoSize := True;
633+
634+
BitmapFileName := ExpandConstant('{tmp}\bg.bmp');
572635
ExtractTemporaryFile(ExtractFileName(BitmapFileName));
573636
574-
BitmapImage := TBitmapImage.Create(WizardForm.MainPanel);
575-
BitmapImage.AutoSize := False;
576-
BitmapImage.Bitmap.LoadFromFile(BitmapFileName);
577-
BitmapImage.Parent := WizardForm.MainPanel;
578-
BitmapImage.Width := 535;
579-
BitmapImage.Height := 28;
580-
BitmapImage.Top := 18;
637+
Breadcrumbs.Bitmap.LoadFromFile(BitmapFileName);
638+
639+
with Breadcrumbs.Bitmap.Canvas do
640+
begin
641+
Pen.Color := StringToColor('$cccccc');
642+
MoveTo(1, 16);
643+
LineTo(460,16);
644+
end;
645+
646+
// Create the breadcrumb labels
647+
CreateBreadcrumbLabel(1, 'Install Setup');
648+
CreateBreadcrumbLabel(2, 'Confirmation');
649+
CreateBreadcrumbLabel(3, 'Download && Install');
650+
CreateBreadcrumbLabel(4, 'Get Started');
581651
582652
WizardForm.BorderStyle := bsSingle;
583653
WizardForm.Color := clWhite;
@@ -618,7 +688,8 @@ begin
618688
619689
//idpDownloadAfter(wpWelcome);
620690
621-
createDownloadForm(wpReady);
691+
DownloadPageID := createDownloadForm(ComponentPageID);
692+
622693
idpConnectControls;
623694
idpInitMessages;
624695
end;

0 commit comments

Comments
 (0)