Skip to content

Commit 37d91af

Browse files
committed
Updated look and feel
1 parent 9302334 commit 37d91af

5 files changed

Lines changed: 212 additions & 15 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.

blank.bmp

526 Bytes
Binary file not shown.

developer_platform_installer.iss

Lines changed: 212 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,15 @@ DefaultGroupName={#AppName}
2626
OutputBaseFilename=developer_platform
2727
Compression=lzma
2828
SolidCompression=yes
29-
WizardSmallImageFile=redhat.bmp
29+
WizardSmallImageFile=blank.bmp
3030
BackColor=clWhite
3131
BackSolid=yes
32+
DisableWelcomePage=yes
3233

33-
;[Files]
34-
34+
[Files]
35+
Source: "bc1.bmp"; Flags: dontcopy
36+
Source: "bc2.bmp"; Flags: dontcopy
37+
Source: "bc3.bmp"; Flags: dontcopy
3538

3639
[Languages]
3740
Name: "english"; MessagesFile: "compiler:Default.isl"
@@ -42,9 +45,111 @@ Root: HKLM; Subkey: "Software\Red Hat\{#AppName}"; Flags: uninsdeletekey
4245
Root: HKLM; Subkey: "Software\Red Hat\{#AppName}"; ValueType: string; ValueName: "InstallDir"; ValueData: "{app}"
4346

4447
[Code]
48+
49+
var
50+
AuthPageID: Integer;
51+
52+
function StringToColor(Color: String): TColor;
53+
var
54+
RR, GG, BB: String;
55+
Dec: Integer;
56+
begin
57+
{ Change string Color from $RRGGBB to $BBGGRR and then convert to TColor }
58+
if((Length(Color) <> 7) or (Color[1] <> '$')) then
59+
Result := $000000
60+
else
61+
begin
62+
RR := Color[2] + Color[3];
63+
GG := Color[4] + Color[5];
64+
BB := Color[6] + Color[7];
65+
Dec := StrToInt('$' + BB + GG + RR);
66+
Result := TColor(Dec);
67+
end;
68+
end;
69+
70+
procedure FormButtonOnClick(Sender: TObject);
71+
var
72+
Form: TSetupForm;
73+
Edit: TNewEdit;
74+
OKButton, CancelButton: TNewButton;
75+
begin
76+
Form := CreateCustomForm();
77+
try
78+
Form.ClientWidth := ScaleX(256);
79+
Form.ClientHeight := ScaleY(128);
80+
Form.Caption := 'TSetupForm';
81+
Form.CenterInsideControl(WizardForm, False);
82+
83+
Edit := TNewEdit.Create(Form);
84+
Edit.Top := ScaleY(10);
85+
Edit.Left := ScaleX(10);
86+
Edit.Width := Form.ClientWidth - ScaleX(2 * 10);
87+
Edit.Height := ScaleY(23);
88+
Edit.Text := 'TNewEdit';
89+
Edit.Parent := Form;
90+
91+
OKButton := TNewButton.Create(Form);
92+
OKButton.Parent := Form;
93+
OKButton.Width := ScaleX(75);
94+
OKButton.Height := ScaleY(23);
95+
OKButton.Left := Form.ClientWidth - ScaleX(75 + 6 + 75 + 10);
96+
OKButton.Top := Form.ClientHeight - ScaleY(23 + 10);
97+
OKButton.Caption := 'OK';
98+
OKButton.ModalResult := mrOk;
99+
OKButton.Default := True;
100+
101+
CancelButton := TNewButton.Create(Form);
102+
CancelButton.Parent := Form;
103+
CancelButton.Width := ScaleX(75);
104+
CancelButton.Height := ScaleY(23);
105+
CancelButton.Left := Form.ClientWidth - ScaleX(75 + 10);
106+
CancelButton.Top := Form.ClientHeight - ScaleY(23 + 10);
107+
CancelButton.Caption := 'Cancel';
108+
CancelButton.ModalResult := mrCancel;
109+
CancelButton.Cancel := True;
110+
111+
Form.ActiveControl := Edit;
112+
113+
if Form.ShowModal() = mrOk then
114+
MsgBox('You clicked OK.', mbInformation, MB_OK);
115+
finally
116+
Form.Free();
117+
end;
118+
119+
end;
120+
121+
procedure LoginButtonOnClick(Sender: TObject);
122+
var
123+
AuthLabel: TNewStaticText;
124+
Page: TWizardPage;
125+
Button: TNewButton;
126+
begin
127+
Page := PageFromID(AuthPageID);
128+
129+
AuthLabel := TNewStaticText.Create(Page);
130+
AuthLabel.Caption := 'Authentication Successful';
131+
AuthLabel.Parent := Page.Surface;
132+
AuthLabel.Color := clWhite;
133+
AuthLabel.Font.Color := clGreen;
134+
Button := TNewButton(Sender);
135+
AuthLabel.Top := Button.Top + Button.Height + ScaleY(8);
136+
137+
Wizardform.NextButton.Enabled := True;
138+
end;
139+
140+
procedure ForgotLabelOnClick(Sender: TObject);
141+
var
142+
ErrorCode: Integer;
143+
begin
144+
ShellExecAsOriginalUser('open', 'http://www.redhat.com/', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
145+
end;
146+
45147
procedure CreateWizardPages;
46148
var
149+
StdColor: TColor;
47150
Page: TWizardPage;
151+
LoginLabel: TNewStaticText;
152+
ForgotLabel: TNewStaticText;
48153
Button, FormButton: TNewButton;
49154
Panel: TPanel;
50155
CheckBox: TNewCheckBox;
@@ -60,13 +165,31 @@ var
60165
BitmapImage, BitmapImage2, BitmapImage3: TBitmapImage;
61166
BitmapFileName: String;
62167
RichEditViewer: TRichEditViewer;
168+
URLLabel: TNewStaticText;
63169
begin
64-
{ TButton and others }
65-
66-
Page := CreateCustomPage(wpWelcome, 'Log in to your Red Hat account', 'Foo');
170+
StdColor := StringToColor('$0093d9');
171+
172+
Page := CreateCustomPage(wpWelcome, '', '');
173+
AuthPageID := Page.ID;
174+
175+
LoginLabel := TNewStaticText.Create(Page);
176+
LoginLabel.Caption := 'Log in to your Red Hat account';
177+
LoginLabel.Parent := Page.Surface;
178+
LoginLabel.Color := clWhite;
179+
LoginLabel.Font.Style := LoginLabel.Font.Style + [fsBold];
180+
LoginLabel.Font.Size := 10;
181+
182+
{ Alter Font *after* setting Parent so the correct defaults are inherited first }
183+
// URLLabel.Font.Style := URLLabel.Font.Style + [fsUnderline];
184+
// if GetWindowsVersion >= $040A0000 then { Windows 98 or later? }
185+
// URLLabel.Font.Color := clHotLight
186+
// else
187+
// URLLabel.Font.Color := clBlue;
188+
// URLLabel.Top := Button.Top + Button.Height + ScaleY(20);
189+
// URLLabel.Left := Button.Left + Button.Width + ScaleX(20);
67190
68191
Edit := TNewEdit.Create(Page);
69-
Edit.Top := ScaleY(8);
192+
Edit.Top := LoginLabel.Top + LoginLabel.Height + ScaleY(8);
70193
Edit.Width := Page.SurfaceWidth div 2 - ScaleX(8);
71194
Edit.Text := 'Red Hat Login';
72195
Edit.Parent := Page.Surface;
@@ -82,9 +205,36 @@ begin
82205
Button.Height := ScaleY(23);
83206
Button.Caption := 'LOG IN';
84207
Button.Top := PasswordEdit.Top + PasswordEdit.Height + ScaleY(8);
85-
//Button.OnClick := @ButtonOnClick;
208+
Button.OnClick := @LoginButtonOnClick;
86209
Button.Parent := Page.Surface;
87210
211+
{FormButton := TNewButton.Create(Page);
212+
FormButton.Top := Button.Top + Button.Height + ScaleY(8);
213+
FormButton.Width := ScaleX(75);
214+
FormButton.Height := ScaleY(23);
215+
FormButton.Caption := 'TSetupForm';
216+
FormButton.OnClick := @FormButtonOnClick;
217+
FormButton.Parent := Page.Surface; }
218+
219+
ForgotLabel := TNewStaticText.Create(Page);
220+
ForgotLabel.Caption := 'Forgot your login or password?';
221+
ForgotLabel.Cursor := crHand;
222+
ForgotLabel.OnClick := @ForgotLabelOnClick;
223+
ForgotLabel.Parent := Page.Surface;
224+
ForgotLabel.Color := clWhite;
225+
{ Alter Font *after* setting Parent so the correct defaults are inherited first }
226+
//ForgotLabel.Font.Style := URLLabel.Font.Style + [fsUnderline];
227+
ForgotLabel.Font.Style := ForgotLabel.Font.Style + [fsBold];
228+
ForgotLabel.Font.Color := StdColor;
229+
// if GetWindowsVersion >= $040A0000 then { Windows 98 or later? }
230+
// ForgotLabel.Font.Color := clHotLight
231+
// else
232+
// ForgotLabel.Font.Color := clBlue;
233+
ForgotLabel.Top := Button.Top + ((Button.Height - ForgotLabel.Height) / 2) + ScaleY(0);
234+
ForgotLabel.Left := Button.Left + Button.Width + ScaleX(20);
235+
236+
//WizardForm.NextButton.Enabled := false;
237+
88238
{Panel := TPanel.Create(Page);
89239
Panel.Width := Page.SurfaceWidth div 2 - ScaleX(8);
90240
Panel.Left := Page.SurfaceWidth - Panel.Width;
@@ -122,9 +272,9 @@ begin
122272
123273
{ TComboBox and others }
124274
125-
{Page := CreateCustomPage(Page.ID, 'Custom wizard page controls', 'TComboBox and others');
275+
Page := CreateInputDirPage(Page.ID, 'Custom wizard page controls', 'TComboBox and others', '', true, 'test');
126276
127-
ComboBox := TNewComboBox.Create(Page);
277+
{ComboBox := TNewComboBox.Create(Page);
128278
ComboBox.Width := Page.SurfaceWidth;
129279
ComboBox.Parent := Page.Surface;
130280
ComboBox.Style := csDropDownList;
@@ -530,16 +680,62 @@ begin
530680
MsgBox('Installing', mbInformation, MB_OK);
531681
end;}
532682
683+
procedure CurPageChanged(CurPageID: Integer);
684+
begin
685+
if (CurPageID = AuthPageID) then
686+
begin
687+
Wizardform.NextButton.Enabled := False;
688+
end;
689+
end;
690+
533691
procedure InitializeWizard();
534692
var
535693
BackgroundBitmapImage: TBitmapImage;
536694
BackgroundBitmapText: TNewStaticText;
695+
BitmapFileName: String;
696+
BitmapImage: TBitmapImage;
537697
begin
538698
{ Custom wizard pages }
539699
700+
WizardForm.PageNameLabel.Visible := False;
701+
WizardForm.PageDescriptionLabel.Visible := False;
702+
703+
WizardForm.OuterNotebook.Width := 800;
704+
WizardForm.InnerPage.Width := 800;
705+
706+
WizardForm.MainPanel.Width := 800;
707+
WizardForm.WizardSmallBitmapImage.Visible := false;
708+
709+
BitmapFileName := ExpandConstant('{tmp}\bc1.bmp');
710+
ExtractTemporaryFile(ExtractFileName(BitmapFileName));
711+
712+
BitmapImage := TBitmapImage.Create(WizardForm.MainPanel);
713+
BitmapImage.AutoSize := False;
714+
BitmapImage.Bitmap.LoadFromFile(BitmapFileName);
715+
BitmapImage.Parent := WizardForm.MainPanel;
716+
BitmapImage.Width := 535;
717+
BitmapImage.Height := 28;
718+
BitmapImage.Top := 18;
719+
720+
WizardForm.BorderStyle := bsSingle;
721+
WizardForm.Color := clWhite;
722+
540723
// These lines change the width and height of the wizard window, but components need to be repositioned
541-
//WizardForm.Width := 800;
542-
//WizardForm.Height := 600;
724+
WizardForm.Width := 940;
725+
WizardForm.Height := 565;
726+
WizardForm.Position := poScreenCenter;
727+
728+
WizardForm.CancelButton.Top := 500;
729+
WizardForm.CancelButton.Left := 840;
730+
731+
WizardForm.NextButton.Top := 500;
732+
WizardForm.NextButton.Left := 760;
733+
734+
WizardForm.BackButton.Top := 500;
735+
WizardForm.BackButton.Left := 680;
736+
737+
WizardForm.Bevel.Visible := False;
738+
WizardForm.Bevel1.Visible := False;
543739
544740
// Sets the background color of the inner panel to white
545741
WizardForm.InnerPage.Color := clWhite;
@@ -552,10 +748,10 @@ begin
552748
// Hide the 'Details' button
553749
idpSetOption('DetailsButton', '0');
554750
555-
//idpSetOption('Referer', 'http://www.azulsystems.com/products/zulu/downloads');
556-
//idpAddFile('http://cdn.azulsystems.com/zulu/2015-07-8.8-bin/zulu1.8.0_51-8.8.0.3-win64.msi', 'Zulu OpenJDK');
751+
idpSetOption('Referer', 'http://www.azulsystems.com/products/zulu/downloads');
752+
idpAddFile('http://cdn.azulsystems.com/zulu/2015-07-8.8-bin/zulu1.8.0_51-8.8.0.3-win64.msi', 'Zulu OpenJDK');
557753
558-
idpAddFile('http://download.virtualbox.org/virtualbox/5.0.2/VirtualBox-5.0.2-102096-Win.exe', 'VirtualBox');
754+
//idpAddFile('http://download.virtualbox.org/virtualbox/5.0.2/VirtualBox-5.0.2-102096-Win.exe', 'VirtualBox');
559755
//idpAddFile('https://dl.bintray.com/mitchellh/vagrant/vagrant_1.7.4.msi', 'Vagrant');
560756
561757
//idpDownloadAfter(wpWelcome);
@@ -565,3 +761,4 @@ begin
565761
idpInitMessages;
566762
end;
567763
764+

0 commit comments

Comments
 (0)