RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TDefaultEditor Class

TDefaultEditor is the component editor for components that do not explicitly register a component editor.

Pascal
TDefaultEditor = class(TComponentEditor, IDefaultEditor);
C++
class TDefaultEditor : public TComponentEditor, public IDefaultEditor;

When a component class does not have a registered property editor, TDefaultEditor controls its response to right clicks, double clicks, and clipboard commands.  

TDefaultEditor does not add any custom menu items to the context menu that appears when the user right-clicks a component in the designer, nor does it add any clipboard formats to the standard component format. However, TDefaultEditor does override the Edit method to supply a default response when the user double clicks a component.  

The Edit method in TDefaultEditor searches the component for events. If it finds an OnCreate event, it brings up the code editor for the OnCreate event handler. If there is no OnCreate event, it brings up the code editor for the OnChange event handler. If there is no OnChange event, it brings up the code editor for the OnClick event handler. If it finds none of these events, it brings up the code editor for the first event it finds. 

Use TDefaultEditor as a base class when creating component editors that bring up the code editor as the default response to a double click. 

 

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