Source Templates Wizard

Source Templates Wizard

Source Templates Wizard is designed to extend code editor. It includes a group of code templates. Both Delphi and C++Builder are supported.

After defining code templates, you can insert them into source code. You can use pre-defined macro or user-defined macro in code template, when inserting they will be replaced by actual text.

Code Template Settings

This dialog lists all code templates, which shows as below:

- Add: Add a new code template.

- Delete: Delete selected code template.

- Clear: Delete all code templates.

- Edit: Edit selected code template.

- Move Up: Move selected code template up.

- Move Down: Move selected code template down.

- Import: Import code templates from data file. If you select append mode, the new templates will append to the last of current list.

- Export: Export code templates to data file.

Template Editor

When user adds or edits a code template, the Template Editor shows as below:

Template Options

- Title: Input the title for menu item.

- Icon: Select the icon for menu item.

- ShortCut: Set the shortcut to call template.

- Desc: Input the description of template, it used in button hint.

- Location: Select the location of inserting template.

- Disable this Template: Whether display this template in menu.

- Restore Cursor Position after Insert: For templates which are inserted to unit header or other positions, whether restore cursor position after insert. This switch will override the position defined by %Cursor% macro.

- For Pascal File: This template is for Pascal file and can be shown in Delphi.

- For C/C++ File: This template is for C/C++ file and can be shown in C++Builder.

You can use pre-defined and user-defined macro in code template.

Select a macro and click Insert button, then the pre-defined macro will be insert to current position.

User-defined macro need wrapped by two "%", macro name may any characters.

When a template executed, pre-defined macros will replaced automatically, but user-defined macros will show a dialog to require user inputting actual text.

The macro is the name of user-defined macro, and the value is actual text to be replaced.

Enter key to set the focus to next macro. When finished, actual context will be inserted to current code.

Links

Basic Operation

CnWizards Settings

About CnWizards

Copyrights 2001-2025 CnPack Team