RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TBasePropertyEditor.Initialize Method

Initializes the property editor after it is created but before it is used.

Pascal
procedure Initialize; virtual; abstract;
C++
virtual __fastcall Initialize() = 0;

Do not call the Initialize method. It is called automatically by the Object Inspector to allow property editors to perform any necessary initialization before they are used.  

In TBasePropertyEditor, Initialize is abstract (pure virtual). Descendant classes must override the Initialize method to provide an implementation. This method can be used to perform any special initialization, such as the creation of helper objects. 

Property editors are often created and discarded without being used because they do not represent a common property across all selected components. Since Initialize is called only after it is determined that the property editor will be used, it is more efficient to initialize property values and create helper objects in the Initialize method rather than the constructor. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!