首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Inno-setup:基于现有页面类型的自定义向导页面

Inno-setup:基于现有页面类型的自定义向导页面
EN

Stack Overflow用户
提问于 2012-01-18 22:52:12
回答 1查看 4.2K关注 0票数 6

我决定在基于inno-setup的安装程序中创建自定义向导页面。但我不想从头开始创建它。我想使用TInputDirWizardPage并对其进行修改,例如添加一个组合框。有可能吗?该怎么做呢?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-01-19 16:42:49

我自己想出来的。因此,我将回答我自己的问题。以下是示例代码:

代码语言:javascript
复制
[Code]
const DB_PAGE_CAPTION='Select Application Database Folder';
  DB_PAGE_DESCRIPTION='Where should application database files be installed or where     your database files already are?';
  DB_PAGE_SUBCAPTION='In case of new installation select the folder in which Setup should install application database files, then click Next. Or select folder where previous version of application stored database files, then click Next';

var databasePage : TInputDirWizardPage;//this is predefined form declaration
    CheckListBox : TNewCheckListBox;  //this is new element i'm about to add to page

procedure createDatabaseWizardPage; //creating page
begin
databasePage :=CreateInputDirPage(wpSelectDir,
DB_PAGE_CAPTION,
DB_PAGE_DESCRIPTION,
DB_PAGE_SUBCAPTION,
False, '');
databasePage.Add('');

databasePage.buttons[0].Top:=databasePage.buttons[0].Top+ScaleY(70);//moving predefined 
databasePage.edits[0].Top:=databasePage.edits[0].Top+ScaleY(70);    //elements down.
databasePage.edits[0].Text:=ExpandConstant('{commonappdata}\my app');//default value

CheckListBox := TNewCheckListBox.Create(databasePage);//creating and modifying new checklistbox
CheckListBox.Top := 40 + ScaleY(8);
CheckListBox.Width := databasePage.SurfaceWidth;
CheckListBox.Height := ScaleY(50);
CheckListBox.BorderStyle := bsNone;
CheckListBox.ParentColor := True;
CheckListBox.MinItemHeight := WizardForm.TasksList.MinItemHeight;
CheckListBox.ShowLines := False;
CheckListBox.WantTabs := True;
CheckListBox.Parent := databasePage.Surface;//setting control's parent element
CheckListBox.AddRadioButton('New Installation', '', 0, True, True, nil);
CheckListBox.AddRadioButton('Update existing copy', '', 0, False, True, nil);
end;


procedure InitializeWizard;
begin
createDatabaseWizardPage(); 
end;

谢谢大家!:-)

票数 6
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8912167

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档