[Setup]
AppName=My Application
AppVersion=1.5
DefaultDirName={sd}\My Application
[Code]
var
OneGroup, TwoGroup: TButton;
ButtonGroup: array [1..6] of TButton;
procedure HideOrShowButtons(aCount: Integer);
var
i: Integer;
begin
case aCount of
1: begin
for i:=1 to 3 do begin ButtonGroup[i].Visible:=True;
end;
for i:=4 to 6 do begin ButtonGroup[i].Visible:=False;
end;
end;
2: begin
for i:=1 to 3 do begin ButtonGroup[i].Visible:=False;
end;
for i:=4 to 6 do begin ButtonGroup[i].Visible:=True;
end;
end;
end;
end;
procedure OnClick(Sender: TObject);
begin
case Sender of
OneGroup: HideOrShowButtons(1);
TwoGroup: HideOrShowButtons(2);
end;
end;
procedure InitializeWizard;
var
i: Integer;
begin
with WizardForm do
begin
Position:=poScreenCenter;
NextButton.Width:=0; OuterNotebook.Hide;
InnerNotebook.Hide; Bevel1.Hide; Bevel.Hide;
end;
for i:=1 to 3 do begin
ButtonGroup[i]:=TButton.Create(WizardForm);
ButtonGroup[i].Parent:=WizardForm;
ButtonGroup[i].SetBounds(ScaleX(10), ScaleY(i*30-20), ScaleX(100), ScaleY(25));
ButtonGroup[i].Caption:='Button '+IntToStr(i);
end;
for i:=4 to 6 do begin
ButtonGroup[i]:=TButton.Create(WizardForm);
ButtonGroup[i].Parent:=WizardForm;
ButtonGroup[i].SetBounds(ScaleX(120), ScaleY(ButtonGroup[i-3].Top), ScaleX(100), ScaleY(25));
ButtonGroup[i].Caption:='Button '+IntToStr(i);
end;
OneGroup:=TButton.Create(WizardForm);
with OneGroup do
begin
Parent:=WizardForm;
SetBounds(ScaleX(10), ScaleY(120), ScaleX(100), ScaleY(25));
Caption:='Button A';
OnClick:=@OnClick;
end;
TwoGroup:=TButton.Create(WizardForm);
with TwoGroup do
begin
Parent:=WizardForm;
SetBounds(ScaleX(120), ScaleY(120), ScaleX(100), ScaleY(25));
Caption:='Button B';
OnClick:=@OnClick;
end;
HideOrShowButtons(1)
end;