Inno Setup entry (24) -- Inno Setup class reference (10)

Source: Internet
Author: User
Here we will introduce foldertreeview Class. Tfoldertreeview = Class (tcustomfoldertreeview) Property onchange: tyyevent; read write; property onrename: tfolderrenameevent; read write; end; tcustomfoldertreeview inherits from twincontrol, so there are many similar properties like other basic controls, which are not repeated here.
Post Code Section:

[Code]

Varmypage: twizardpage; FTV: tfoldertreeview; Procedure initializewizard (); begin mypage: = createcustompage (wpwelcome, 'title: Custom page', 'description: this is my custom page '); FTV: = tfoldertreeview. create (mypage); FTV. width: = mypage. surfacewidth; FTV. height: = mypage. surfaceheight; FTV. parent: = mypage. surface; FTV. directory: = expandconstant ('{win}'); end;
It is necessary to explain expandconstant. The function is prototype:
Function expandconstant (const S: string): string;
Description: changes all constants in S to their values. for example, expandconstant ('{srcexe}') is changed to the filename of setup. an exception will be raised if there was an error expanding the constants.
Expands a String constant as the path string. Common constants include {app}, {win}, {sys}, {SRC}, and {dotnet20}, avoiding the trouble of manual input.
The running effect is as follows:

 

In addition, this class supports an onchange event, which is triggered when the folder is modified. [Code] varmypage: twizardpage; FTV: tfoldertreeview; LBL: tlabel; Procedure changedir (Sender: tobject); begin LBL. caption: = FTV. directory; end; Procedure initializewizard (); begin mypage: = createcustompage (wpwelcome, 'title: Custom page', 'description: This is my custom page'); LBL: = tlabel. create (mypage); LBL. parent: = mypage. surface; FTV: = tfoldertreeview. create (mypage); FTV. top: = LBL. height + 5; FTV. width: = mypage. surfacewidth; FTV. height: = mypage. surfaceHeight-20; FTV. parent: = mypage. surface; FTV. directory: = expandconstant ('{win}'); FTV. onchange: = @ changedir; LBL. caption: = FTV. directory; end;
The running result is as follows:

The visible tag value is consistent with the folder value.

 

 

 

from: http://www.360doc.com/content/13/0327/14/4221543_274238588.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.