Tracking the generation and execution of Cm_controlchange messages, you can better understand the idea of VCL (that is, the information is everywhere, but the coupling is very weak)

Source: Internet
Author: User

Tracking the flow of cm_controlchange messages can be better

Test code:

Procedure Tform1.button1click (Sender:tobject);
Var
Image2:timage;
Begin
Image2: = Timage.create (self);
Image2.left: = 100;
Image2.top: = 50;
Image2.Picture.LoadFromFile (' c:\pic.jpg ');
Image2.parent: = Form1;
End

Procedure Twincontrol.insertcontrol (Acontrol:tcontrol);
Begin
Acontrol.validatecontainer (self);
Perform (Cm_controllistchange, Integer (acontrol), Integer (True));
Insert (Acontrol);
If not (csreading in acontrol.componentstate) then
Begin
Acontrol.perform (cm_parentcolorchanged, 0, 0);
Acontrol.perform (cm_parentfontchanged, 0, 0);
Acontrol.perform (cm_parentshowhintchanged, 0, 0);
Acontrol.perform (cm_parentbidimodechanged, 0, 0);
If Acontrol is Twincontrol then
Begin
Acontrol.perform (cm_parentctl3dchanged, 0, 0);
Updatecontrolstate;
End Else
If handleallocated then acontrol.invalidate;
Aligncontrol (Acontrol);
End
Perform (Cm_controlchange, Integer (acontrol), Integer (True));
End

Tracking the generation and execution of Cm_controlchange messages, you can better understand the idea of VCL (that is, the information is everywhere, but the coupling is very weak)

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.