Inno Setup中更大的“选择组件”页面

时间:2013-12-14 14:47:18

标签: inno-setup

我已经尝试了一段时间使“选择组件”页面变大,如下图所示,包括内部窗口组件(白色组件),因为我有很多组件......并且它变得更容易当它是更大的窗口时选择。如果有人能说出这是否可能,请给我一个提示或指出我的方向。

enter image description here

值得庆幸的是, BEGIN

2 个答案:

答案 0 :(得分:5)

根据您的original script我做了以下更改。为了存储原始位置(顶部和高度值),我使用了一个整数数组,并制作了两个通用程序来存储当前位置和恢复它们。

恢复过程具有HeightOffset参数,您可以在其中指定值,通过该值,输入整数数组中的所有值在传递到向导表单组件属性之前将会增加。除此之外,我已经声明了一个单独的标志,表明向导形式已经修改了大小。

我使用了所有这些,因为它提高了脚本的可读性,并且可以轻松扩展到其他页面:

[Code]

type
  TPositionStorage = array of Integer;

var
  CompPageModified: Boolean;
  CompPagePositions: TPositionStorage;

procedure SaveComponentsPage(out Storage: TPositionStorage);
begin
  SetArrayLength(Storage, 10);

  Storage[0] := WizardForm.Height;
  Storage[1] := WizardForm.NextButton.Top;
  Storage[2] := WizardForm.BackButton.Top;
  Storage[3] := WizardForm.CancelButton.Top;
  Storage[4] := WizardForm.ComponentsList.Height;
  Storage[5] := WizardForm.OuterNotebook.Height;
  Storage[6] := WizardForm.InnerNotebook.Height;
  Storage[7] := WizardForm.Bevel.Top;
  Storage[8] := WizardForm.BeveledLabel.Top;
  Storage[9] := WizardForm.ComponentsDiskSpaceLabel.Top;
end;

procedure LoadComponentsPage(const Storage: TPositionStorage;
  HeightOffset: Integer);
begin
  if GetArrayLength(Storage) <> 10 then
    RaiseException('Invalid storage array length.');

  WizardForm.Height := Storage[0] + HeightOffset;
  WizardForm.NextButton.Top := Storage[1] + HeightOffset;
  WizardForm.BackButton.Top := Storage[2] + HeightOffset;
  WizardForm.CancelButton.Top := Storage[3] + HeightOffset;
  WizardForm.ComponentsList.Height := Storage[4] + HeightOffset;
  WizardForm.OuterNotebook.Height := Storage[5] + HeightOffset;
  WizardForm.InnerNotebook.Height := Storage[6] + HeightOffset;
  WizardForm.Bevel.Top := Storage[7] + HeightOffset;
  WizardForm.BeveledLabel.Top := Storage[8] + HeightOffset;
  WizardForm.ComponentsDiskSpaceLabel.Top := Storage[9] + HeightOffset;
end;

procedure InitializeWizard;
begin
  CompPageModified := False;
end;

procedure CurPageChanged(CurPageID: Integer);
begin
  if CurpageID = wpSelectComponents then
  begin
    SaveComponentsPage(CompPagePositions);
    LoadComponentsPage(CompPagePositions, ScaleY(200));
    CompPageModified := True;
  end
  else
  if CompPageModified then
  begin
    LoadComponentsPage(CompPagePositions, 0);
    CompPageModified := False;
  end;
end;

答案 1 :(得分:0)

Inno Setup 6正确设置了组件对齐方式。因此,您要做的就是将向导表单设置为更大。

感谢TLama的代码减少为:

var
  CompPageModified: Boolean;

procedure CurPageChanged(CurPageID: Integer);
begin
  if CurpageID = wpSelectComponents then
  begin
    WizardForm.Height := WizardForm.Height + ScaleY(200);
    CompPageModified := True;
  end
    else
  if CompPageModified then
  begin
    WizardForm.Height := WizardForm.Height - ScaleY(200);
    CompPageModified := False;
  end;
end;