Translation Event Handler Description Events Handling Description

Source: Internet
Author: User

Event Handler Description Events Handling Description (custom control)

How should a new event handler is defined if it does not already belong to the base class? Let's look at this using the "Tfrxeditcontrol" common control as an example:

How should a new event handler be defined if it does not belong to the base class? Let's take a look at using the "Tfrxeditcontrol" control as an example:

Tfrxeditcontrol = Class (Tfrxdialogcontrol)

Private

Fedit:tedit;

{New Event}

Fonchange:tfrxnotifyevent; Defines the event, registration type.

Procedure Doonchange (Sender:tobject); Event-handling procedures

...

Public

Constructor Create (aowner:tcomponent); Override

...

Published

{New Event}

Property Onchange:tfrxnotifyevent read Fonchange write Fonchange; Defining events

...

End

Constructor Tfrxeditcontrol.create (aowner:tcomponent);

Begin

...

{Connect Our Handler}

Fedit.onchange: = Doonchange; Associating an event in Create (associating an event of a Tedit control to its own process)

Initcontrol (Fedit);

...

End

Procedure Tfrxeditcontrol.doonchange (Sender:tobject);

Begin

{Call event handler}

If report <> Nil Then

Report.donotifyevent (Sender, Fonchange); Handling events (invoking scripts in the report in the process)

End

It is important to note that the event handler in Fastreport are a procedure defined in the report script. The tfrxnotifyevent type is declared as string[63] and in Fastreport the link to the handler are a String containing its NA Me. This was unlike the Delphi tnotifyevent type, in which it was a method address.

It is important to note that an event handler is a procedure that is defined in a report script. The tfrxnotifyevent type is declared as string[63], and the event-handling process linked in Fastreport is a string (containing its name). This is not like the Tnotifyevent type in Delphi, it is the address of a method.

Translation Event Handler Description Events Handling Description

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.