Links
EControl Syntax Editor SDK
TTemplatePopup Class

Code templates plug-in.

TTemplatePopup = class(TSyntMemoPopupList);

ecPopupCtrl

Code templates include commonly used statements (such as if, while, and for statements) that you can insert into your text. 

There are three sources of code templates:

  1. Active syntax analyzer (analyzer at the current caret position, AnalyzerAtPos) in the syntax memo (SyntMemo).
  2. Own templates specified by the Templates.
  3. Templates from external syntax analyzer specified by the ExternSource.

 

While working in the editor, press keystroke to execute command CommandID (default - Ctrl+J) to display the code templates list. Select a code template to be entered in your text in one of two ways:

  • Use the scroll bar as necessary and double-click the template to insert it into your code.
  • Type the name of the template until the characters entered refer to the entry in the list you want to include. Press Enter.

 

Each line of the code template is inserted at the same X position in the text line to keep same indent of all code template lines. 

 

If the word at the left side of the caret position is equal to the short-cut (case insensitive) of any code template in the list, TTemplatePopup removes this word and inserts found code template (by using InsertTemplate method). 

Otherwise Execute displays pop-up list box with templates list. User can select code template to be inserted at caret position.

Topic 
Description 
The methods of the TPopupControl class are listed here. 
The properties of the TPopupControl class are listed here. 
The events of the TPopupControl class are listed here. 
IecCommandHook Interface
Topic 
Description 
The methods of the IecCommandHook class are listed here. 
TSyntMemoPopup Class
Topic 
Description 
The methods of the TSyntMemoPopup class are listed here. 
The properties of the TSyntMemoPopup class are listed here. 
TSyntMemoPopupList Class
Topic 
Description 
The methods of the TSyntMemoPopupList class are listed here. 
The properties of the TSyntMemoPopupList class are listed here. 
TTemplatePopup Class
Topic 
Description 
The methods of the TTemplatePopup class are listed here. 
The properties of the TTemplatePopup class are listed here. 
The events of the TTemplatePopup class are listed here. 
 
Method 
 
protected 
 
virtual 
 
abstract 
 
Property 
 
read only 
 
Event 
TPopupControl Events 
Description 
Occurs when popup control is closing. 
Occurs when selection in popup control is changed. 
Occurs immediately after showing popup control. 
Occurs before showing popup control after calculating popup layout. 
Occurs before showing popup control. 
TTemplatePopup Class
TTemplatePopup Class 
Description 
Occurs before inserting template. 
TPopupControl Methods 
Description 
Calculates size and position of popup control. 
Returns True if the popup control can be shown. 
Closes popup window. 
Creates and initializes a TPopupControl instance. 
Destroys an instance of TPopupControl. 
Called when closing popup control. Accept specifies whether user selection in popup control should be accepted. 
Called immediately after showing popup control. 
Returns actual position of popup window. 
Calculates size of popup control. 
Called when selection in popup control is changed. 
Window procedure of the parent form. 
Window procedure of the parent window. 
Window procedure of the popup window. 
Posts internal message which will call ItemChanged method in some time. 
Recalculates size and position of popup control. 
Shows popup control around selected rectangle area. 
IecCommandHook Interface
IecCommandHook Interface 
Description 
Called after execution in syntax memo. 
Called before execution in syntax memo. 
Called to test wether command is enabled. 
TSyntMemoPopup Class
TSyntMemoPopup Class 
Description 
Executes syntax memo plug-in. 
Shows popup window under character at specified position in the syntax memo. 
TSyntMemoPopupList Class
TSyntMemoPopupList Class 
Description 
Called when list item is selected in popup list box. 
Creates and initializes a TSyntMemoPopupList instance. 
Called when closing popup control. Accept specifies whether user selection in popup control should be accepted. 
Window procedure of the parent window. 
TTemplatePopup Class
TTemplatePopup Class 
Description 
Creates and initializes a TTemplatePopup instance. 
Returns currently selected template. 
Destroys an instance of TTemplatePopup. 
Inserts templates or displays pop-up list box to select template from the list. 
Calculates size of popup control. 
Inserts template in the current caret position. 
Called when selection in popup control is changed. 
Window procedure of the parent window. 
TPopupControl Properties 
Description 
Specifies rectangle area around which popup control was shown. 
Specifies whether popup control is closing. 
Specifies the size constraints for the popup control. 
Specifies popup container control. 
Collection of additional controls added to popup container. 
Specifies height of popup control. 
Specifies conditional position of popup control. 
Specifies the minimal preferable width of the popup control. 
Parent window. 
Specifies popup control. 
Specifies whether popup control should drop shadow (XP and higher). 
Specifies whether user may change size of the popup control. 
Specifies tool hint window. 
Indicates whether popup window is visible. 
Specifies width of popup control. 
TSyntMemoPopup Class
TSyntMemoPopup Class 
Description 
Specifies identifier of the syntax memo command which will fire popup tool execution. 
Specifies editor to which popup control is linked. 
TSyntMemoPopupList Class
TSyntMemoPopupList Class 
Description 
Specifies whether list item should be automatically selected when mouse moving over it. 
Specifies background color of popup list box. 
Specifies the maximum number of items displayed in the pop-up list. 
Font 
Specifies font of popup list box. 
Determines whether the list box displays the partial items. 
Specifies the height in pixels of an item in an owner-draw list box. 
Popup list box reference. 
Determines whether the list box is standard or owner-draw and whether it is virtual. 
Specifies whether item in popup list box should be accepted on double mouse click. 
TTemplatePopup Class
TTemplatePopup Class 
Description 
Specifies whether list item should be automatically selected when mouse moving over it. 
Specifies background color of popup list box. 
Specifies identifier of the syntax memo command which will fire popup tool execution. 
Specifies the size constraints for the popup control. 
Collection of additional controls added to popup container. 
Specifies the maximum number of items displayed in the pop-up list. 
Provides external source of templates. 
Font 
Specifies font of popup list box. 
Specifies height of popup control. 
Specifies conditional position of popup control. 
Popup list box reference. 
Specifies the minimal preferable width of the popup control. 
Occurs before showing popup control after calculating popup layout. 
Occurs before showing popup control. 
Occurs when selection in popup control is changed. 
Occurs when popup control is closing. 
Specifies whether item in popup list box should be accepted on double mouse click. 
Occurs immediately after showing popup control. 
Specifies options of the code template plug-in. 
Specifies whether popup control should drop shadow (XP and higher). 
Specifies whether user may change size of the popup control. 
Specifies template items sort type. 
Specifies editor to which popup control is linked. 
Collection of code templates. 
Specifies tool hint window. 
Specifies width of popup control. 
Copyright (c) 2004-2011. All rights reserved.
What do you think about this topic? Send feedback!