今天说说TNewCheckListBox类。
该类和ListBox差不多,只是下面的项可以用CheckBox或者RadioButton选择,是一种比较复杂的类型。
该类继承自TCustomListBox,自身具有以下属性和函数:
TNewCheckListBox = class(TCustomListBox)
TNewCheckListBox = class(TCustomListBox)
function AddCheckBox(const ACaption, ASubItem: String; ALevel: Byte; AChecked, AEnabled, AHasInternalChildren, ACheckWhenParentChecked: Boolean; AObject: TObject): Integer;
function AddGroup(ACaption, ASubItem: String; ALevel: Byte; AObject: TObject): Integer;
function AddRadioButton(const ACaption, ASubItem: String; ALevel: Byte; AChecked, AEnabled: Boolean; AObject: TObject): Integer;
function CheckItem(const Index: Integer; const AOperation: TCheckItemOperation): Boolean;
property Checked[Index: Integer]: Boolean; read write;
property State[Index: Integer]: TCheckBoxState; read write;
property ItemCaption[Index: Integer]: String; read write;
property ItemEnabled[Index: Integer]: Boolean; read write;
property ItemLevel[Index: Integer]: Byte; read;
property ItemObject[Index: Integer]: TObject; read write;
property ItemSubItem[Index: Integer]: String; read write;
property AllowGrayed: Boolean; read write;
property Flat: Boolean; read write;
property MinItemHeight: Integer; read write;
property Offset: Integer; read write;
property OnClickCheck: TNotifyEvent; read write;
property BorderStyle: TBorderStyle; read write;
property Color: TColor; read write;
property Font: TFont; read write;
property Sorted: Boolean; read write;
property OnClick: TNotifyEvent; read write;
property OnDblClick: TNotifyEvent; read write;
property OnKeyDown: TKeyEvent; read write;
property OnKeyPress: TKeyPressEvent; read write;
property OnKeyUp: TKeyEvent; read write;
property ShowLines: Boolean; read write;
property WantTabs: Boolean; read write;
property RequireRadioSelection: Boolean; read write;
end
测试例子:
[code]
var
myPage:TWizardPage;
clb1, clb2: TNewCheckListBox;
lbl: TLabel;
i,index:Integer;
procedure clbClickCheck(Sender: TObject);
begin
lbl.Caption:='';
for i:=1 to 3 do
if clb1.Checked[i] then
lbl.Caption:=clb1.ItemCaption[i]+' ';
for i:=5 to 7 do
if clb1.Checked[i] then
lbl.Caption:=lbl.Caption+clb1.ItemCaption[i]+' ';
end;
procedure InitializeWizard();
begin
myPage:=CreateCustomPage(wpWelcome, '标题:自定义页面', '描述:这是我的自定义页面');
lbl:=TLabel.Create(myPage);
lbl.Parent:=myPage.Surface;
clb1 := TNewCheckListBox.Create(mypage);
clb1.Width := mypage.SurfaceWidth;
clb1.Top:=20;
clb1.Height := ScaleY(200);
clb1.Flat := True;
clb1.Parent := mypage.Surface;
clb1.AddCheckBox('操作系统', '', 0, True, True, False, True, nil);
clb1.AddRadioButton('Windows 2000', '', 1, False, True, nil);
clb1.AddRadioButton('Windows XP', '', 1, True, True, nil);
clb1.AddRadioButton('Windows 7', '', 1, False, True, nil);
clb1.AddCheckBox('可安装组件', '', 0, True, True, False, True, nil);
clb1.AddCheckBox('组件1', '', 1, True, True, False, True, nil);
clb1.AddCheckBox('组件2', '', 1, True, True, False, True, nil);
clb1.AddCheckBox('组件3', '', 1, False, True, False, True, nil);
clb1.OnClickCheck:=@clbClickCheck;
end;
运行效果如下:
其中的 procedure clbClickCheck将动态地根据所选项进行自动调整。
相关推荐
很好的安装程序打包软件innoSetup的入门教程。
Inno Setup是一个为Microsoft Windows应用程序创建安装程序的工具。innoextract允许在非Windows系统下提取此类安装程序,而无需使用wine运行实际的安装程序。innoextract 目前支持由 Inno Setup 1.2.10 到 6.2.1 ...
innosetup安装界面美化: 解压压缩包中的 Inno Setup 5.5.zip,运行Inno Setup 5.5\Inno Setup 5\Compil32.exe,右上角可以改变语言。 打开build.iss文件,一些自定义字段请按需修改,点击Inno Setup工具栏中的 ...
超详细系统讲解Inno安装包制作的全过程
使用inno setup将python exe制作安装包详细教程(csdn)————程序
Inno Setup 是一款免费的安装包制作软件,操作简单、功能稳定,能够快速制作出标准Windows风格的安装界面,足以完成一般安装任务。使用Inno Setup打包可执行的exe软件,可在任何电脑中运行。
Inno Setup支持以下函数和过程。 function InitializeSetup(): Boolean; 该函数在安装程序初始化时调用,返回False 将中断安装,True则继续安装,测试代码如下: function InitializeSetup(): Boolean; begin ...
Inno Setup 打包软件中文教程
可解加密的inno setup安装程序,可解加密的inno setup安装程序
InnoSetup 多安装目录
Inno setup是一款简便安装包工具,支持pascal脚本,几分钟就能生成标准Windows安装包。资源包括加密dll以及中文语言包
InnoSetup 获取本机IP地址的方法
inno setup 中文语言包,放在安装文件夹的languages文件夹下。 [Languages] Name: "chinese"; MessagesFile: "compiler:Languages\Chinese.isl
inno setup 入门学习的官方demo+网上案例+自己的案例
Inno Setup + 各国的语言包
自己替换app目录下的...注意:必须要用inno setup增强版封装,该资源包包含对.net FormWork 4 的封装。{code} 文件夹下的 Code.iss 是界面代码,version.h 是配置文件 可以在里面修改应用名称,公司 、版本号等信息。
Inno Setup是一款免费的安装程序制作工具,用于创建Windows平台下的安装程序。它具有易于使用、功能强大、灵活性高等特点,是Windows安装程序制作的首选工具之一。 Inno Setup使用Pascal脚本语言编写,因此对于...
innosetup安装界面美化、卸载界面美化资源文件包,附带psd文件,脚本文件;可灵活diy;注:图片的尺寸不可更改,更改的话iss文件也需要做处理!
inno setup中文帮助文档,PDF 版本,中文版 Inno Setup用Delphi写成,其官方网站同时也提供源程序免费下载。它虽不能与Installshield这类恐龙级的安装制作软件相比,但也当之无愧算是后起之秀。Inno Setup是一个免费的...
Inno Setup 5.5.1 汉化增强版 安装制作