() Inno Setup entry (17th) -- Inno Setup class reference (3)

Source: Internet
Author: User

This article Reprinted from: http://blog.csdn.net/yushanddddfenghailin/article/details/17250993

Label is one of the main components used to display text. It is also one of the most common components in window applications. By using labels, You can provide more detailed information.

The labels in the Pascal script are implemented by the tllabel class, which is defined as follows:

Tlabel = Class (tcustomlabel)

Property alignment: talignment; read write;

Property autosize: Boolean; read write;

Property caption: string; read write;

Property color: tcolor; read write;

Property focuscontrol: twincontrol; read write;

Property Font: tfont; read write;

Property wordwrap: Boolean; read write;

Property onclick: tpolicyevent; read write;

Property ondblclick: tpolicyevent; read write;

End;

Unlike the tbutton hierarchy model, the hierarchy model of this class is as follows:

 

Next, we will add a tag based on the previous section, and the TAG content changes after clicking the button:

[Setup]

Appname = test

Appvername = test

Defaultdirname = "E: \ test"

Appversion = 1.0

[Files]

Source: "F: \ Desktop \ test \ ipmsg.exe"; flags: dontcopy

[Code]

VaR

Mypage: twizardpage;

Mybtn: tbutton;

Mylbl: tlabel;

Procedure clickmybtn (Sender: tobject );

Begin

Mylbl. Caption: = 'you clicked the button ~ ';

Mylbl. Color: = clred;

End;

Procedure initializewizard ();

Begin

Mypage: = createcustompage (wpwelcome, 'title: Custom page', 'description: This is my custom page ');

Mybtn: = tbutton. Create (mypage );

Mybtn. Parent: = mypage. surface;

Mybtn. Caption: = 'click me ~ ';

Mybtn. onclick: [email protected];

Mylbl: = tlabel. Create (mypage );

Mylbl. Parent: = mypage. surface;

Mylbl. Top: = mybtn. Top + 50;

Mylbl. Caption: = 'I am a tag ~ ';

End;

This code mainly uses the caption attribute of the label, which determines the text to be displayed for the label. Attribute color is used to set the background color of the tag, mylbl. color: = clred; the background color of the tag is set to Red. There is a special tcolor class to process the color attributes. For more predefined colors, see the relevant documents of Delphi, the following colors are supported:

Clsystemcolor = $ ff000000;

Clscrollbar = tcolor (clsystemcolor or color_scrollbar );

Clbackground = tcolor (clsystemcolor or color_background );

Clactivecaption = tcolor (clsystemcolor or color_activecaption );

Clinactivecaption = tcolor (clsystemcolor or color_inactivecaption );

Clmenu = tcolor (clsystemcolor or color_menu );

Clwindow = tcolor (clsystemcolor or color_window );

Clwindowframe = tcolor (clsystemcolor or color_windowframe );

Clmenutext = tcolor (clsystemcolor or color_menutext );

Clwindowtext = tcolor (clsystemcolor or color_windowtext );

Clcaptiontext = tcolor (clsystemcolor or color_captiontext );

Clactiveborder = tcolor (clsystemcolor or color_activeborder );

Clinactiveborder = tcolor (clsystemcolor or color_inactiveborder );

Clappworkspace = tcolor (clsystemcolor or color_appworkspace );

Clhighlight = tcolor (clsystemcolor or color_highlight );

Clhighlighttext = tcolor (clsystemcolor or color_highlighttext );

Clbtnface = tcolor (clsystemcolor or color_btnface );

Clbtnshadow = tcolor (clsystemcolor or color_btnshadow );

Clgraytext = tcolor (clsystemcolor or color_graytext );

Clbtntext = tcolor (clsystemcolor or color_btntext );

Clinactivecaptiontext = tcolor (clsystemcolor or color_inactivecaptiontext );

Clbtnhighlight = tcolor (clsystemcolor or color_btnhighlight );

Cl3ddkshadow = tcolor (clsystemcolor or color_3ddkshadow );

Cl3dlight = tcolor (clsystemcolor or color_3dlight );

Clinfotext = tcolor (clsystemcolor or color_infotext );

Clinfobk = tcolor (clsystemcolor or color_infobk );

Clhotlight = tcolor (clsystemcolor or color_hotlight );

Clgradientactivecaption = tcolor (clsystemcolor or color_gradientactivecaption );

Clgradientinactivecaption = tcolor (clsystemcolor or color_gradientinactivecaption );

Clmenuhighlight = tcolor (clsystemcolor or color_menuhilight );

Clmenubar = tcolor (clsystemcolor or color_menubar );

Clblack = tcolor ($000000 );

Clmaroon = tcolor ($000080 );

Clgreen = tcolor ($008000 );

Clolive = tcolor ($008080 );

Clnavy = tcolor ($800000 );

Clpurple = tcolor ($800080 );

Clteal = tcolor ($808000 );

Clgray = tcolor ($808080 );

Clsilver = tcolor ($ c0c0c0 );

Clred = tcolor ($ 0000ff );

Cllime = tcolor ($00ff00 );

Clyellow = tcolor ($00 FFFF );

Clblue = tcolor ($ ff0000 );

Clfuchsia = tcolor ($ ff00ff );

Claqua = tcolor ($ FFFF00 );

Clltgray = tcolor ($ c0c0c0 );

Cldkgray = tcolor ($808080 );

Clwhite = tcolor ($ ffffff );

Standardcolorscount = 16;

Clmoneygreen = tcolor ($ c0dcc0 );

Clskyblue = tcolor ($ f0caa6 );

Clcream = tcolor ($ f0fbff );

Clmedgray = tcolor ($ a4a0a0 );

Extendedcolorscount = 4;

Clnone = tcolor ($1 fffffff );

Cldefault = tcolor ($20000000 );

After the above Code is run, the effect is as follows:

Before clicking

After clicking

Note: To modify the label text color, you must use the font attribute of the label. In addition, the tag can also respond to mouse clicks and execute corresponding functions. The tag supports double-clicking and mouse-clicking events, but note that these two events cannot coexist. The test code is as follows:

[Code]

VaR

Mypage: twizardpage;

Mybtn: tbutton;

Mylbl: tlabel;

Procedure clickmybtn (Sender: tobject );

Begin

Mylbl. Caption: = 'you clicked the button ~ ';

Mylbl. Color: = clred;

End;

Procedure clickmylbl (Sender: tobject );

Begin

Msgbox ('you have clicked the tag', mbinformation, mb_ OK );

End;

Procedure dbclickmylbl (Sender: tobject );

Begin

Msgbox ('you have double-clicked the label', mbinformation, mb_ OK );

End;

Procedure initializewizard ();

Begin

Mypage: = createcustompage (wpwelcome, 'title: Custom page', 'description: This is my custom page ');

Mybtn: = tbutton. Create (mypage );

Mybtn. Parent: = mypage. surface;

Mybtn. Caption: = 'click me ~ ';

Mybtn. onclick: [email protected];

Mylbl: = tlabel. Create (mypage );

Mylbl. Parent: = mypage. surface;

Mylbl. Top: = mybtn. Top + 50;

Mylbl. Caption: = 'I am a tag ~ ';

Mylbl. ondblclick: [email protected];

// Mylbl. onclick: [email protected];

End;

The above code will pop up a dialog box when you double-click the tag. If we cancel the comment of the last and second lines, the double-click event cannot be captured by the installer, because when you click the left mouse button once, once you release the mouse, the click event will be captured, rather than waiting for the arrival of the double-click, this must be noted, but usually the label is mainly used to display text, instead of responding to some events, the caption attribute of a tag is the most important.

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.