Links
EControl Syntax Editor SDK
TCodeTemplate Class

Code templates allows insert any predefined text using shortcut.

TCodeTemplate = class(TCollectionItem);

ecSyntAnal

While working in the Syntax editor, input shortcut name (which is defined by the Name property) and press Ctrl+J to insert template (which is defined by the Code property). 

But all this will be available only if you have linked TTemplatePopup to TCustomSyntaxMemo. All templates operations are controlled by TTemplatePopup component. 

There are two types of template syntax: advanced - like in CodeRush, simple - like in Borland's IDE. To specify template syntax use property Advanced

In advanced templates you may use: <caret> - specifies caret position (must be single), <paste> - inserts clipboard text, <marker> - drops stack-based marker. 

In simple templates you may specify only caret position using "|" character.

Topic 
Description 
The methods of the TCodeTemplate class are listed here. 
The properties of the TCodeTemplate class are listed here. 
 
Constructor 
 
virtual 
 
Property 
TCodeTemplate Methods 
Description 
Creates and initializes a TCodeTemplate instance. 
Destroys an instance of TCodeTemplate. 
TCodeTemplate Properties 
Description 
Specifies kind of the template syntax. 
Code 
Text that will be inserted in the text. 
Description of the code template. 
Name 
Shortcut name. 
Copyright (c) 2004-2011. All rights reserved.
What do you think about this topic? Send feedback!