Inno Setup the setup wizard size is fixed, but I want to change wizard setup size and change a few items including image and ...
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
There's no magic way to make the wizard pages larger. They are designed for a specific size. If you want to make them larger, you have to go page-by-page, control-by-control and carefully decide how to layout them for your new size.
The following code is just an example, you may want to choose another change in layout.
procedure ShiftDown(Control: TControl; DeltaY: Integer);
begin
Control.Top := Control.Top + DeltaY;
end;
procedure ShiftRight(Control: TControl; DeltaX: Integer);
begin
Control.Left := Control.Left + DeltaX;
end;
procedure ShiftDownAndRight(Control: TControl; DeltaX, DeltaY: Integer);
begin
ShiftDown(Control, DeltaY);
ShiftRight(Control, DeltaX);
end;
procedure GrowDown(Control: TControl; DeltaY: Integer);
begin
Control.Height := Control.Height + DeltaY;
end;
procedure GrowRight(Control: TControl; DeltaX: Integer);
begin
Control.Width := Control.Width + DeltaX;
end;
procedure GrowRightAndDown(Control: TControl; DeltaX, DeltaY: Integer);
begin
GrowRight(Control, DeltaX);
GrowDown(Control, DeltaY);
end;
procedure GrowRightAndShiftDown(Control: TControl; DeltaX, DeltaY: Integer);
begin
GrowRight(Control, DeltaX);
ShiftDown(Control, DeltaY);
end;
procedure GrowWizard(DeltaX, DeltaY: Integer);
begin
GrowRightAndDown(WizardForm, DeltaX, DeltaY);
with WizardForm do
begin
GrowRightAndShiftDown(Bevel, DeltaX, DeltaY);
ShiftDownAndRight(CancelButton, DeltaX, DeltaY);
ShiftDownAndRight(NextButton, DeltaX, DeltaY);
ShiftDownAndRight(BackButton, DeltaX, DeltaY);
GrowRightAndDown(OuterNotebook, DeltaX, DeltaY);
GrowRight(BeveledLabel, DeltaX);
{ WelcomePage }
GrowDown(WizardBitmapImage, DeltaY);
GrowRight(WelcomeLabel2, DeltaX);
GrowRight(WelcomeLabel1, DeltaX);
{ InnerPage }
GrowRight(Bevel1, DeltaX);
GrowRightAndDown(InnerNotebook, DeltaX, DeltaY);
{ LicensePage }
ShiftDown(LicenseNotAcceptedRadio, DeltaY);
ShiftDown(LicenseAcceptedRadio, DeltaY);
GrowRightAndDown(LicenseMemo, DeltaX, DeltaY);
GrowRight(LicenseLabel1, DeltaX);
{ SelectDirPage }
GrowRightAndShiftDown(DiskSpaceLabel, DeltaX, DeltaY);
ShiftRight(DirBrowseButton, DeltaX);
GrowRight(DirEdit, DeltaX);
GrowRight(SelectDirBrowseLabel, DeltaX);
GrowRight(SelectDirLabel, DeltaX);
{ SelectComponentsPage }
GrowRightAndShiftDown(ComponentsDiskSpaceLabel, DeltaX, DeltaY);
GrowRightAndDown(ComponentsList, DeltaX, DeltaY);
GrowRight(TypesCombo, DeltaX);
GrowRight(SelectComponentsLabel, DeltaX);
{ SelectTasksPage }
GrowRightAndDown(TasksList, DeltaX, DeltaY);
GrowRight(SelectTasksLabel, DeltaX);
{ ReadyPage }
GrowRightAndDown(ReadyMemo, DeltaX, DeltaY);
GrowRight(ReadyLabel, DeltaX);
{ InstallingPage }
GrowRight(FilenameLabel, DeltaX);
GrowRight(StatusLabel, DeltaX);
GrowRight(ProgressGauge, DeltaX);
{ MainPanel }
GrowRight(MainPanel, DeltaX);
ShiftRight(WizardSmallBitmapImage, DeltaX);
GrowRight(PageDescriptionLabel, DeltaX);
GrowRight(PageNameLabel, DeltaX);
{ FinishedPage }
GrowDown(WizardBitmapImage2, DeltaY);
GrowRight(RunList, DeltaX);
GrowRight(FinishedLabel, DeltaX);
GrowRight(FinishedHeadingLabel, DeltaX);
end;
end;
Use the GrowWizard
function from the InitializeWizard
event function (or elsewhere), giving it a change in width and height as parameters:
procedure InitializeWizard();
begin
GrowWizard(ScaleX(100), ScaleY(80));
end;
The code takes care of the following pages:
WelcomePage
LicensePage
SelectDirPage
SelectComponentsPage
SelectTasksPage
ReadyPage
InstallingPage
FinishedPage
Other, less common, pages are left as an exercise to the readers:
- PasswordPage
- InfoBeforePage (same as LicensePage)
- UserInfoPage
- SelectProgramGroupPage
- PreparingPage
- InfoAfterPage (same as LicensePage)
Similar questions:
- How to display a larger license box in an InnoSetup installer?
- Larger "Select Components" page in Inno Setup
- How to change wizard size (Width and height) in an InnoSetup installer?
- Inno Setup: Resize uninstall progress form with all its components
标签:
inno-setup