Inno Setup entry (21) -- Inno Setup class reference (7)

Source: Internet
Author: User

Check box

Check box (Checkbox) Is used to make one or more choices among multiple options that are not mutually exclusive. For example, the font can have bold, italic, and underline, and the three statuses can be combined at will, you can use check boxes for such options.PascalThe corresponding class in the script isTcheckbox, Which is defined as follows:<Xmlnamespace prefix = "O" NS = "urn: Schemas-Microsoft-com: Office: office"/>

Tcheckbox = Class (tcustomcheckbox)

Property alignment: talignment; read write;

Property allowgrayed: Boolean; read write;

Property caption: string; read write;

Property checked: Boolean; read write;

Property color: tcolor; read write;

Property Font: tfont; read write;

<Xmlnamespace prefix = "ST1" NS = "urn: Schemas-Microsoft-com: Office: smarttags"/> property state: tcheckboxstate; read write;

Property onclick: tpolicyevent; read write;

End;

The hierarchical model is as follows:

This analogyRadioboxOne moreTcustomcheckboxIn this way, more functions are available. The followingCodeTo demonstrate the usage of the check box:

 

[Setup]

Appname = test

Appvername = test

Defaultdirname = "E: \ test"

Appversion = 1.0

 

[Files]

Source: zzz. ISS; flags: dontcopy

 

[Code]

VaR

Mypage: twizardpage;

LBL: tlabel;

Chk1, CHK2, chk3: tcheckbox;

Procedure clickchk1 (Sender: tobject );

Begin

If chk1.checked then

LBL. Font. Style: = LBL. Font. Style + [fsbold]

Else

LBL. Font. Style: = LBL. Font. Style-[fsbold];

End;

Procedure clickchk2 (Sender: tobject );

Begin

If chk2.checked then

LBL. Font. Style: = LBL. Font. Style + [fsitalic]

Else

LBL. Font. Style: = LBL. Font. Style-[fsitalic];

End;

Procedure clickchk3 (Sender: tobject );

Begin

If chk3.checked then

LBL. Font. Style: = LBL. Font. Style + [fsunderline]

Else

LBL. Font. Style: = LBL. Font. Style-[fsunderline];

End;

Procedure initializewizard ();

Begin

Mypage: = createcustompage (wpwelcome ,'Title: Custom page','Description: This is my custom page.');

LBL: = tlabel. Create (mypage );

LBL. Parent: = mypage. surface;

LBL. Caption: ='Select the check box and pay attention to text changes';

Chk1: = tcheckbox. Create (mypage );

Chk1.parent: = mypage. surface;

Chk1.caption: ='Bold';

Chk1.top: = LBL. Top + 20;

Chk1.onclick :=@ clickchk1;

CHK2: = tcheckbox. Create (mypage );

Chk2.parent: = mypage. surface;

Chk2.caption: ='Italics';

Chk2.top: = chk1.top + 20;

Chk2.onclick :=@ clickchk2;

Chk3: = tcheckbox. Create (mypage );

Chk3.parent: = mypage. surface;

Chk3.caption: ='Underline';

Chk3.top: = chk2.top + 20;

Chk3.onclick :=@ clickchk3;

End;

 

ProgramThe running effect is as follows:

Another important attribute of the check box isStateThis attribute specifies the appearance of the check box, which can have three values:Cbunchecked,CbcheckedAndCbgrayedYou can use the following code to set it:

 

Chk1.state: = cbunchecked;

Chk2.state: = cbchecked;

Chk3.state: = cbgrayed;

 

The effect is as follows:

 

From: http://www.360doc.com/content/13/0327/14/4221543_274240143.shtml

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.