Links
EControl Syntax Editor SDK
TAutoCompletePopup Class

In the editor, auto-completion displays a resizable pop-up list box that lists elements which can be selected and added to the text.

TAutoCompletePopup = class(TCustomAutoCompletePopup);

ecPopupCtrl

Auto-completion pop-up list box may be shown automatically after user input specified string StartString or after user press key combination associated with the linked command (property CommandID). 

Auto-completion pop-up list box is sizable. To control size use Width and Height properties. 

When auto-completion pop-up list box is displayed user may input text during which list box filters out all items that does not match user text input (matches start of item with ignoring case). 

 

Auto-completion items are defined by the Items property. Text displayed in the pop-up list box may be defined by the DisplayItems. Display items may contain format information like images, columns and text styles. See DisplayItems topic to get more information about items formatting. 

 

You may set Items and DisplayItems dynamically before pop-up list box will be displayed in OnGetAutoCompleteList event handler. 

 

Auto-complete pop-up list box will be displayed only if Items is not empty. 

 

To select an item to be entered in your text: 

Scroll through the list, choose one or more items using Ctrl or Shift, and press Enter. 

Type until the characters entered refer to the entry in the list you want to include and press Enter. The list filters as you type. The text is automatically removed when you select an item. 

Also to enter auto-completion item in the text you can input non word character (instead Enter), for example, Space, Comma, Dot ...; In that case this character will be inserted in the text after auto-completion item. 

 

Managing performance of auto-completion. 

There several properties which effects on performance of auto-completion showing: 

1. Option aoFormatted - specifies whether display items are formatted. 

2. Option aoWithColumns - specifies whether all items should be parsed before showing to define column widths. 

3. Property AutoSize - specifies whether all items should be parsed before showing to define size of the auto-completion popup. 

4. Property FixedItemHeight - specifies whether virtual list box items may be used. 

 

Performance (from fast to slow): 

1. aoFormatted := False; AutoSize := False; 

2. aoFormatted := False; AutoSize := True; 

3. aoFormatted := True; AutoSize := False; aoWithColumns := False; 

4. aoFormatted := True; AutoSize := True; aoWithColumns := False; 

5. aoFormatted := True; AutoSize := True; aoWithColumns := True; 

 

The best choice is 3, i.e. formatted items, but without pre-parsing. 

It is recommended to use fixed items heights, because using virtual list box items is more faster (in Delphi 5 virtual list box items are not available). 

 

Filtration 

Filtration used to remove items from list which do not match text input in editor. There are several predefined types of filtration which you may select using FilterType property

To define custom filter use OnFilter event

 

See demo application in .\Demos\AutoComplete. Also you can see ecPropListDlg.pas in design package as an example of dynamically filled auto-completion list.

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. 
TFormattedSyntMemoPopupList Class
Topic 
Description 
The methods of the TFormattedSyntMemoPopupList class are listed here. 
The properties of the TFormattedSyntMemoPopupList class are listed here. 
The events of the TFormattedSyntMemoPopupList class are listed here. 
IecSyntMemoClient Interface
Topic 
Description 
The methods of the IecSyntMemoClient class are listed here. 
IecTextClient Interface
Topic 
Description 
The methods of the IecTextClient class are listed here. 
TCustomAutoCompletePopup Class
Topic 
Description 
The methods of the TCustomAutoCompletePopup class are listed here. 
The properties of the TCustomAutoCompletePopup class are listed here. 
The events of the TCustomAutoCompletePopup class are listed here. 
TAutoCompletePopup Class
Topic 
Description 
The properties of the TAutoCompletePopup 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. 
TFormattedSyntMemoPopupList Class
TFormattedSyntMemoPopupList Class 
Description 
Called after user selected item in popup list. 
Occurs when sorting items. 
TCustomAutoCompletePopup Class
TCustomAutoCompletePopup Class 
Description 
Occurs after inserting auto-complete item in the editor's text. 
Occurs before inserting auto-complete item in the editor's text. 
Occurs after checking some character whether it is a word character. 
Occurs before showing auto-complete list. 
Called for each item in completion list when filtering. 
Occurs before auto-complete list box is displayed. 
Occurs when getting filter from editor text. 
Occurs when users press a single character key when auto-complete list is active. 
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. 
TFormattedSyntMemoPopupList Class
TFormattedSyntMemoPopupList Class 
Description 
Called when list item is selected in popup list box. 
Creates and initializes a TFormattedSyntMemoPopupList instance. 
Destroys an instance of TFormattedSyntMemoPopupList. 
Prepares and fill list box items. 
Filters items. 
Returns Item text associated with the list item 
Calculates size of popup control. 
Returns completion item index, i.e. index in Items array, by specified index of item in the popup list box. 
Forwards notification messages to all owned components. 
IecSyntMemoClient Interface
IecSyntMemoClient Interface 
Description 
Is called when caret position is changed. 
IecTextClient Interface
IecTextClient Interface 
Description 
Called after text have been changed. 
TCustomAutoCompletePopup Class
TCustomAutoCompletePopup Class 
Description 
Called when list item is selected in popup list box. 
Creates and initializes a TCustomAutoCompletePopup instance. 
Destroys an instance of TCustomAutoCompletePopup. 
Updates completion items before showing popup. 
Immediately displays auto-complete pop-up list box. 
Defines whether item with index Item has to be removed from list. 
Filters items. 
Detects completion start position. 
Detects whether character is part of completion string. 
Window procedure of the parent window. 
Shows auto-complete popup control. 
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. 
TFormattedSyntMemoPopupList Class
TFormattedSyntMemoPopupList Class 
Description 
Specifies whether width of the popup list box should fit list items. 
Specifies additional space between columns. 
Strings that used to draw pop-up list box items. 
Specifies whether item heights are fixed. 
Enable horizontal scroll bar in list control. 
Specifies image list which is used to format display items. 
Specifies the ordinal number of the selected item in the list box’s item list. 
Specifies a list of auto-completion items. 
Specifies items sort type in auto-completion list. 
Specifies styles holder. 
TCustomAutoCompletePopup Class
TCustomAutoCompletePopup Class 
Description 
Specifies duration of the pause between input of StartString and execution of autocompletion. 
Specifies whether autocompletion has to be automatically executed on user input. 
Specifies type of filtration. 
Specifies options of auto-complete popup control. 
Specifies regular expression to test user input to activate code completion. 
Specifies start position for the completion. Start position is the caret position of word start or the current position where auto-completion result will be inserted. 
User text input string that starts auto-completion. 
TAutoCompletePopup Class
TAutoCompletePopup Class 
Description 
Specifies whether list item should be automatically selected when mouse moving over it. 
Occurs after inserting auto-complete item in the editor's text. 
Specifies whether width of the popup list box should fit list items. 
Occurs before inserting auto-complete item in the editor's text. 
Specifies background color of popup list box. 
Occurs after checking some character whether it is a word character. 
Specifies additional space between columns. 
Occurs before showing auto-complete list. 
Called for each item in completion list when filtering. 
Specifies identifier of the syntax memo command which will fire popup tool execution. 
Specifies the size constraints for the popup control. 
Occurs before auto-complete list box is displayed. 
Collection of additional controls added to popup container. 
Occurs when getting filter from editor text. 
Specifies duration of the pause between input of StartString and execution of autocompletion. 
Occurs when users press a single character key when auto-complete list is active. 
Strings that used to draw pop-up list box items. 
Occurs when sorting items. 
Specifies the maximum number of items displayed in the pop-up list. 
Specifies whether autocompletion has to be automatically executed on user input. 
Specifies type of filtration. 
Specifies whether item heights are fixed. 
Font 
Specifies font of popup list box. 
Specifies height of popup control. 
Enable horizontal scroll bar in list control. 
Specifies image list which is used to format display items. 
Determines whether the list box displays the partial items. 
Specifies the height in pixels of an item in an owner-draw list box. 
Specifies a list of auto-completion items. 
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 auto-complete popup control. 
Specifies whether popup control should drop shadow (XP and higher). 
Specifies items sort type in auto-completion list. 
Specifies regular expression to test user input to activate code completion. 
User text input string that starts auto-completion. 
Specifies styles holder. 
Specifies editor to which popup control is linked. 
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!