Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

Commit 00fac83

Browse files
committed
Use TInputOptionWizardPage for release selection page
1 parent 727c611 commit 00fac83

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

ElixirWeb.iss

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ type
6161
TStringTable = array of TStringList;
6262
6363
var
64+
PSelRelease: TInputOptionWizardPage;
6465
PSelInstallType: TInputOptionWizardPage;
66+
6567
itypeLatestRelease: Integer;
6668
itypeLatestPrerelease: Integer;
6769
itypeCustom: Integer;
68-
PSelRelease: TWizardPage;
69-
PSelReleaseListBox: TNewCheckListBox;
70-
70+
7171
TargetRelease: TStrings;
7272
7373
i: Integer;
@@ -137,7 +137,7 @@ var
137137
SelectFirst: Boolean;
138138
ReleaseDesc: String;
139139
begin
140-
PSelReleaseListBox.Items.Clear;
140+
PSelRelease.CheckListBox.Items.Clear;
141141
SelectFirst := True;
142142
for i := 0 to GetArrayLength(StringTable) - 1 do begin
143143
if IsCompatibleForInstall(StringTable[i]) then begin
@@ -146,27 +146,27 @@ begin
146146
end else begin
147147
ReleaseDesc := 'Release';
148148
end;
149-
PSelReleaseListBox.AddRadioButton('Elixir version ' + GetVersion(StringTable[i]), ReleaseDesc, 0, SelectFirst, True, StringTable[i]);
149+
PSelRelease.CheckListBox.AddRadioButton('Elixir version ' + GetVersion(StringTable[i]), ReleaseDesc, 0, SelectFirst, True, StringTable[i]);
150150
SelectFirst := False;
151151
end;
152152
end;
153153
end;
154154
155155
function GetListBoxSelectedRelease(): TStrings;
156156
begin
157-
for i := 0 to PSelReleaseListBox.Items.Count - 1 do begin
158-
if PSelReleaseListBox.Checked[i] then begin
159-
Result := TStrings(PSelReleaseListBox.ItemObject[i]);
157+
for i := 0 to PSelRelease.CheckListBox.Items.Count - 1 do begin
158+
if PSelRelease.CheckListBox.Checked[i] then begin
159+
Result := TStrings(PSelRelease.CheckListBox.ItemObject[i]);
160160
break;
161161
end;
162162
end;
163163
end;
164164
165165
function GetListBoxLatestRelease(Prerelease: Boolean): TStrings;
166166
begin
167-
for i := 0 to PSelReleaseListBox.Items.Count - 1 do begin
168-
if Prerelease = IsPrerelease(TStrings(PSelReleaseListBox.ItemObject[i])) then begin
169-
Result := TStrings(PSelReleaseListBox.ItemObject[i]);
167+
for i := 0 to PSelRelease.CheckListBox.Items.Count - 1 do begin
168+
if Prerelease = IsPrerelease(TStrings(PSelRelease.CheckListBox.ItemObject[i])) then begin
169+
Result := TStrings(PSelRelease.CheckListBox.ItemObject[i]);
170170
break;
171171
end;
172172
end;
@@ -224,11 +224,7 @@ begin
224224
225225
PSelInstallType := CreateInputOptionPage(wpWelcome, 'Select Elixir installation type', 'Select which installation type you want to perform, then click Next.', 'I want to:', True, False);
226226
227-
PSelRelease := CreateCustomPage(PSelInstallType.ID, 'Select Elixir release', 'Setup will download and install the Elixir release you select.');
228-
PSelReleaseListBox := TNewCheckListBox.Create(PSelRelease);
229-
PSelReleaseListBox.Width := PSelRelease.SurfaceWidth;
230-
PSelReleaseListBox.Height := PSelRelease.SurfaceHeight - 10;
231-
PSelReleaseListBox.Parent := PSelRelease.Surface;
227+
PSelRelease := CreateInputOptionPage(PSelInstallType.ID, 'Select Elixir release', 'Setup will download and install the Elixir release you select.', 'All releases available to install are listed below, from newest to oldest.', True, True);
232228
233229
PopulatePSelReleaseListBox(CSVToStringTable(ExpandConstant('{tmp}\releases.csv')));
234230

0 commit comments

Comments
 (0)