http://379910987.blog.163.com/blog/static/3352379720126693742406/

今天说说TNewCheckListBox类。
该类和ListBox差不多,只是下面的项可以用CheckBox或者RadioButton选择,是一种比较复杂的类型。

该类继承自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将动态地根据所选项进行自动调整。

Inno Setup入门(二十五)——Inno Setup类参考(11)的更多相关文章

  1. Inno Setup入门(十五)——Inno Setup类参考(1)

    分类: Install Setup 2013-02-02 11:27 536人阅读 评论(0) 收藏 举报 nno setup脚本能够支持许多的类,这些类使得安装程序的功能得到很大的加强,通过对这些类 ...

  2. (转)Inno Setup入门(十五)——Inno Setup类参考(1)

    本文转载自:http://blog.csdn.net/yushanddddfenghailin/article/details/17250955 nno setup脚本能够支持许多的类,这些类使得安装 ...

  3. Inno Setup入门(十五)——Inno Setup类参考(1)

    Inno setup脚本能够支持许多的类,这些类使得安装程序的功能得到很大的加强,通过对这些类的使用,将会创建出许多让人惊奇的安装程序,下面开始类的学习. 创建自定义向导页 自定义向导页需要在Init ...

  4. [WebGL入门]二十五,点光源的光照

    注:文章译自http://wgld.org/,原作者杉本雅広(doxas),文章中假设有我的额外说明.我会加上[lufy:].另外,鄙人webgl研究还不够深入,一些专业词语.假设翻译有误,欢迎大家指 ...

  5. Inno Setup入门(十六)——Inno Setup类参考(2)

    Inno Setup入门(十六)——Inno Setup类参考(2) http://379910987.blog.163.com/blog/static/33523797201112755641236 ...

  6. Bootstrap入门(二十五)JS插件2:过渡效果

    Bootstrap入门(二十五)JS插件2:过渡效果 对于简单的过渡效果,只需将 transition.js 和其它 JS 文件一起引入即可.如果你使用的是编译(或压缩)版的bootstrap.js  ...

  7. FreeSql (二十五)延时加载

    FreeSql 支持导航属性延时加载,即当我们需要用到的时候才进行加载(读取),支持1对1.多对1.1对多.多对多关系的导航属性. 当我们希望浏览某条订单信息的时候,才显示其对应的订单详细记录时,我们 ...

  8. Bootstrap <基础二十五>警告(Alerts)

    警告(Alerts)以及 Bootstrap 所提供的用于警告的 class.警告(Alerts)向用户提供了一种定义消息样式的方式.它们为典型的用户操作提供了上下文信息反馈. 您可以为警告框添加一个 ...

  9. 无废话ExtJs 入门教程十五[员工信息表Demo:AddUser]

    无废话ExtJs 入门教程十五[员工信息表Demo:AddUser] extjs技术交流,欢迎加群(201926085) 前面我们共介绍过10种表单组件,这些组件是我们在开发过程中最经常用到的,所以一 ...

  10. VMware vSphere 服务器虚拟化之二十五 桌面虚拟化之终端服务池

    VMware vSphere 服务器虚拟化之二十五 桌面虚拟化之终端服务池 终端服务池是指由一台或多台微软终端服务器提供服务的桌面源组成的池.终端服务器桌面源可交付多个桌面.它具有以下特征: 1.终端 ...

随机推荐

  1. An unhandled exception of type 'System.TypeInitializationException' occurred in System.ServiceModel.dll

    异常“ An unhandled exception of type 'System.TypeInitializationException' occurred in System.ServiceMo ...

  2. PHP设计模式二-------单例模式

    1.单例模式的介绍 意图:保证一个类仅有一个实例,并提供一个访问它的全局访问点: 主要解决:一个全局使用的类频繁地创建与销毁. 关键代码:构造函数是私有的,克隆方法也是私有的. 1.1 懒汉式//1 ...

  3. linux的rpm教程

    1.rmp查询 1.1 软件包详细信息 rpm -qpi  httpd-2.4.25-9.fc27.x86_64.rpm 系统将会列出这个软件包的详细资料,包括含有多少个文件.各文件名称.文件大小.创 ...

  4. JS将日期转换为yyyy-MM-dd HH:mm:ss

    //格式化后日期为:yyyy-MM-dd HH:mm:ss function FormatAllDate(sDate) { var date = new Date(sDate); var sepera ...

  5. .net core 2.0学习记录(四):Middleware使用以及模拟构建Middleware(RequestDelegate)管道

    .net Core中没有继续沿用以前asp.net中的管道事件,而是开发了一个新的管道(Middleware): public class MiddlewareDemo { private reado ...

  6. UVALive - 7042 The Problem to Make You Happy 博弈

    题目大意:给你一个有向图, Bob 和 Alice 在做游戏,每轮他们走一步,当Bob 和 Alice在同一个点或者 Bob无路可走,Bob输,否则Alice输. 思路:因为在Bob赢的时候存在有环的 ...

  7. mangeto 清除分类 产品 客户

    分类: SET FOREIGN_KEY_CHECKS=0; TRUNCATE TABLE `catalog_category_entity`; TRUNCATE TABLE `catalog_cate ...

  8. VMware8安装配置Win7、CentOS-7向导

    1.宿主电脑配置情况 Windows 8.1 中文版 Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz 2.4GHz RAM: 8G Type: 64 bit 2.软件 ...

  9. (5) go 控制台输入输出、进制转换、原反补码、位运算

    一.控制台接受输入 二.原反补码 三.位运算 四.移位运算

  10. ZOJ 3781 Paint the Grid Reloaded

    枚举,$BFS$,连通块缩点. 可以枚举一开始染哪个位置,然后逐层往外染色,看最多需要多少操作次数,也就是算最短距离.连通块缩点之后可以保证是一个黑白相间的图,且每条边的费用均为$1$,$BFS$即可 ...