使用 Inno Set Up 编译器,是否可以在最终页面上混合使用复选框和单选按钮?
With Inno Set Up compiler, is it possible to mix both Checkbox and Radio button on the finalise page?
我想在我的安装完成页面上有 2 个复选框和两个单选按钮。我从这个 中看到您可以将所有复选框更改为单选按钮,但我怎样才能将两者混合使用。
我用过这样的东西:
type
TRunEntry = record
Caption: string;
Checked: Boolean;
Object: TObject;
end;
procedure RebuildRunList;
var
RunEntries: array of TRunEntry;
I: Integer;
begin
{ Save run list ... }
SetArrayLength(RunEntries, WizardForm.RunList.Items.Count);
for I := 0 to WizardForm.RunList.Items.Count - 1 do
begin
RunEntries[I].Caption := WizardForm.RunList.ItemCaption[I];
RunEntries[I].Checked := WizardForm.RunList.Checked[I];
RunEntries[I].Object := WizardForm.RunList.ItemObject[I];
end;
{ ... clear it ... }
WizardForm.RunList.Items.Clear;
{ ... and re-create }
for I := 0 to GetArrayLength(RunEntries) - 1 do
begin
{ the first three entries are radio buttons }
if (I = 0) or (I = 1) or (I = 2) then
begin
WizardForm.RunList.AddRadioButton(
RunEntries[I].Caption, '', 0, RunEntries[I].Checked, True, RunEntries[I].Object);
end
else
begin
WizardForm.RunList.AddCheckBox(
RunEntries[I].Caption, '', 0, RunEntries[I].Checked, True, True, True,
RunEntries[I].Object);
end;
end;
end;
它的名字是这样的:
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpFinished then
begin
RebuildRunList;
end;
end;
@MartinPrikryl 或许可以找到他在讨论此问题时提供给我的原始答案。
我想在我的安装完成页面上有 2 个复选框和两个单选按钮。我从这个
我用过这样的东西:
type
TRunEntry = record
Caption: string;
Checked: Boolean;
Object: TObject;
end;
procedure RebuildRunList;
var
RunEntries: array of TRunEntry;
I: Integer;
begin
{ Save run list ... }
SetArrayLength(RunEntries, WizardForm.RunList.Items.Count);
for I := 0 to WizardForm.RunList.Items.Count - 1 do
begin
RunEntries[I].Caption := WizardForm.RunList.ItemCaption[I];
RunEntries[I].Checked := WizardForm.RunList.Checked[I];
RunEntries[I].Object := WizardForm.RunList.ItemObject[I];
end;
{ ... clear it ... }
WizardForm.RunList.Items.Clear;
{ ... and re-create }
for I := 0 to GetArrayLength(RunEntries) - 1 do
begin
{ the first three entries are radio buttons }
if (I = 0) or (I = 1) or (I = 2) then
begin
WizardForm.RunList.AddRadioButton(
RunEntries[I].Caption, '', 0, RunEntries[I].Checked, True, RunEntries[I].Object);
end
else
begin
WizardForm.RunList.AddCheckBox(
RunEntries[I].Caption, '', 0, RunEntries[I].Checked, True, True, True,
RunEntries[I].Object);
end;
end;
end;
它的名字是这样的:
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpFinished then
begin
RebuildRunList;
end;
end;
@MartinPrikryl 或许可以找到他在讨论此问题时提供给我的原始答案。