尝试在wpSelectComponents表单上放置一些文本。
我可以在这个WizardForm上显示一个按钮,我可以显示一个面板(通过将表面声明为WizardForm并visible=False
直到CurrPageId = wpSelectComponents
),但我似乎无法显示短信。
我可以在面板内部显示文字(作为标题),但我无法使用chr(13)
来创建换行符。
是否可以在预定义的向导页面上显示文本? (两个短段)。
答案 0 :(得分: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;
结果如下:
答案 1 :(得分:2)
您可能想查看DescriptiveTypes script;它在这个页面上调整了一些控件,以显示当前所选类型的详细描述。带边框。