Code Completion Demo
Folder: Demos\CompletionProposalDemo. Projects: CompletionProposalDemo.dpr and ParamCompletionDemo.dpr.
Shows the use of TSynCompletionProposal in its two modes.
Code list (ctCode)
The form FormMain_ctCode fills the list with the members of a class, with an image, the kind of member in a column and the name in bold, and lets you change at run time the options of the popup: title, number of lines, shadow, gripper and the width of the biggest word.
The items use the formatting codes of the proposal:
| Code | Effect |
|---|---|
\image{n} | Shows the image number n of the Images list. |
\hspace{n} | A horizontal space of n pixels. |
\column{} | Starts the next column. |
\style{+B} ... \style{-B} | Turns on and off the bold style (also I, U). |
SynCompletionProposal1.ItemList.Add(
'\image{4}\hspace{2}procedure \column{}\style{+B}Delete\style{-B}(Index: Integer)');Parameter hints (ctParams)
The form FormMain_ctParams (project ParamCompletionDemo) shows the parameters of a routine while they are typed. In the OnExecute event the list is filled with one item for each overload, written as a sequence of quoted parameters:
TSynCompletionProposal(Sender).ItemList.Add('"A: integer", "B: integer"');The folder contains also two screenshots of the proposal and the page tsyncompletionproposal.html with the original description of the component.
