2

Attempting to place some text on wpSelectComponents form.

I can display a button on this WizardForm and I can display a panel (by declaring surface as WizardForm and visible=False until CurrPageId = wpSelectComponents) but I cannot seem to display a text message.

I can display text inside of the panel (as a caption) but I cannot use chr(13) to create a newline.

Is it possible to display text on a predefined wizard page? (two short paragraphs).

4

2 回答 2

3

如果您要仅在某个页面的内容下(在本例中为“选择组件”页面)显示带有按钮和标签的面板,其中包含多行文本,您可能会从以下脚本中获得灵感:

[Setup]
AppName=My Program
AppVersion=1.5
DefaultDirName={pf}\My Program
OutputDir=userdocs:Inno Setup Examples Output

[Components]
Name: "main"; Description: "Main Files"; Types: full compact custom; Flags: fixed
Name: "help"; Description: "Help Files"; Types: full
Name: "help\english"; Description: "English"; Types: full
Name: "help\dutch"; Description: "Dutch"; Types: full

[Code]
var
  Panel: TPanel;

procedure FuncButtonClick(Sender: TObject);
begin
  MsgBox('You did it!', mbInformation, MB_OK);
end;

procedure InitializeWizard;
var  
  DescLabel: TLabel;
  FuncButton: TNewButton;
  ContentHeight: Integer;
begin
  ContentHeight := WizardForm.OuterNotebook.Top + 
    WizardForm.OuterNotebook.Height;

  Panel := TPanel.Create(WizardForm);
  Panel.Parent := WizardForm;
  Panel.Left := 4;
  Panel.Top := ContentHeight + 4;
  Panel.Width := WizardForm.BackButton.Left - 8;
  Panel.Height := WizardForm.ClientHeight - ContentHeight - 8;
  Panel.Visible := False;

  FuncButton := TNewButton.Create(WizardForm);
  FuncButton.Parent := Panel;
  FuncButton.Left := (Panel.Height - FuncButton.Height) div 2;
  FuncButton.Top := (Panel.Height - FuncButton.Height) div 2;
  FuncButton.Caption := 'Click me!';
  FuncButton.OnClick := @FuncButtonClick; 

  DescLabel := TLabel.Create(WizardForm);
  DescLabel.Parent := Panel;
  DescLabel.AutoSize := True;
  DescLabel.Caption := 'Hello,' #13#10 + 'I''m your label! :-)';
  DescLabel.Left := FuncButton.Left + FuncButton.Width + 8;
  DescLabel.Top := (Panel.Height - DescLabel.Height) div 2;
end;

procedure CurPageChanged(CurPageID: Integer);
begin
  Panel.Visible := CurPageID = wpSelectComponents;
end;

结果如下:

在此处输入图像描述

于 2013-05-11T18:13:18.530 回答
2

您可能想看看DescriptiveTypes 脚本;它在此页面上处理一些控件以显示当前所选类型的详细描述。带边框。

于 2013-05-12T21:35:27.857 回答