如何在Inno Setup安装程序中更改向导大小(宽度和高度)? [英] How to change wizard size (width and height) in an Inno Setup installer?

查看:358
本文介绍了如何在Inno Setup安装程序中更改向导大小(宽度和高度)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Inno Setup设置向导的大小是固定的,但是我想更改向导设置的大小并更改一些项目,包括图像和...

Inno Setup the setup wizard size is fixed, but I want to change wizard setup size and change a few items including image and ...

推荐答案

Inno Setup 6

Inno Setup 6支持更改向导窗口的大小.

Inno Setup 6

Inno Setup 6 supports changing a size of the wizard window.

您可以使用 WizardSizePercent 来更改向导的大小窗口.

You can use WizardSizePercent to change a size of the wizard window.

您还可以使用 WizardResizable 来允许用户调整大小向导(这是默认行为,如果您使用modern WizardStyle ).

You can also use WizardResizable to allow the user to resize the wizard (this is default behaviour, if you use the modern WizardStyle).

没有什么神奇的方法可以使向导页面变大.它们是为特定尺寸设计的.如果要使其变大,则必须逐页逐个控制,并仔细决定如何按照新的尺寸来布局它们.

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;


使用InitializeWizard事件函数(或其他函数)中的GrowWizard函数,将其宽度和高度作为参数进行更改:


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

LicensePage

SelectDirPage

SelectDirPage

SelectComponentsPage

SelectComponentsPage

SelectTasksPage

SelectTasksPage

ReadyPage

ReadyPage

InstallingPage

InstallingPage

FinishedPage

FinishedPage

其他一些不太常见的页面留给读者练习:

Other, less common, pages are left as an exercise to the readers:

  • PasswordPage
  • InfoBeforePage(与LicensePage相同)
  • UserInfoPage
  • SelectProgramGroupPage
  • PreparingPage
  • InfoAfterPage(与LicensePage相同)

类似的问题:

  • 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 Inno Setup installer?
  • Inno Setup: Resize uninstall progress form with all its components
  • How to reduce the line spacing between two input boxes on Inno Setup TInputQueryWizardPage (CreateInputQueryPage)

这篇关于如何在Inno Setup安装程序中更改向导大小(宽度和高度)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆