我想用我的设置中的组件页面交换SelectDir页面。如何更改InnoSetup页面的顺序?
我找到了一个解决方案,将其他页面的内容分配给当前页面。
Procedure CurPageChanged(CurPageID: Integer);
Begin
Case CurPageID of
wpSelectDir:
begin
WizardForm.SelectDirPage.Notebook.ActivePage:= WizardForm.SelectComponentsPage;
WizardForm.PageNameLabel.Caption:= SetupMessage(msgWizardSelectComponents)
WizardForm.Hint:= WizardForm.PageDescriptionLabel.Caption;
WizardForm.PageDescriptionLabel.Caption:= SetupMessage(msgSelectComponentsDesc)
end;
wpSelectComponents:
begin
WizardForm.SelectComponentsPage.Notebook.ActivePage:= WizardForm.SelectDirPage;
WizardForm.DiskSpaceLabel.Caption:= WzardForm.ComponentsDiskSpaceLabel.Caption;
WizardForm.PageNameLabel.Caption:= SetupMessage(msgWizardSelectDir)
WizardForm.PageDescriptionLabel.Caption:= WizardForm.Hint
end;
end;
End;
使用此方法的问题是只有内容而不是实际页面发生更改。消息框和错误消息不受影响。我写了许多代码行来解决这些问题,但我遇到了越来越多的问题...
有没有更好的解决方案?我希望你可以帮助我!
编辑:尝试了一下后,我想出了这个:
procedure RedesignWizard;
var
Page: TWizardPage;
begin
Page := CreateCustomPage(wpWelcome, 'bla', 'bla');
WizardForm.ComponentsList.Parent := Page.Surface;
//Here I am changing the layout of the pages...
end;
procedure InitializeWizard;
begin
RedesignWizard;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if (CurPageID = Page.ID) then
begin
//perform your actions specific to the Custom page here.
end;
end;
这样的组件列表中SelctDirPage出庭时,我没有任何更多的问题与这些消息框。
总之,不要那样做。有检查绑定到* Next *按钮点击,并且这些检查由您不能覆盖的页面ID常量驱动。想象一下,当你点击* Next *按钮的用户以及(在某些情况下)目录编辑框中的默认目录已经存在时,会发生什么情况。是的,*“文件夹:c:\东西已存在,您是否想要安装到该文件夹?”消息对话框从组件页面弹出,什么是废话。 – TLama
我知道这一点,因此写了一些检查以在页面上使用TLabel显示消息,并在上面的解决方案中禁用“下一步”按钮。我真的需要交换这些页面,如果有更简单的解决方案,我想知道。我可以自己处理剩下的东西。 – user1662035
如果我们误解了彼此......您提到的问题发生在使用上面显示的方法时。我禁用了所有的消息框,并尝试解决错误页面上的消息框的问题,但我遇到了越来越多的问题。这就是为什么我想使用另一种方法,因为我真的需要交换这些页面。是否可以创建自定义页面并将SelectComponentsPage的值分配给它?甚至还有其他一些方式?否则,我将不得不摆脱每个问题。 – user1662035