Installation
--------------
To install this VC add-in, copy CodeTmpl.dll and CodeTmpl.txt to
the X\SharedIDE\AddIn directory, where X is your DevStudio directory.
Restart DevStudio and the add-in will automatically be added. Goto
the Tools/Customize menu item and click on the Add-Ins and Macro Files
tab. Check the Code Template option and a new toolbar button will
be added to DevStudio. The add-in will now be reloaded whenever
DevStudio starts.
Usage
-------
To use the code template add-in, click on the add-in button and
select one of the menu options. The add-in will then place the
associated code fragment in the current active document. To force
the add-in to re-read the template file, press the Ctrl key while
clicking on the menu.
CodeTmpl.Txt
--------------
This file defines what options will appear on the add-in menu and
what code fragment will be generated for each option. The add-in
supports general code fragments, keyword expansion, format specifiers,
and submenu definitions.
To define a new menu item with an associated code fragment, use the
following format :
#{Menu name
Code-fragment
...
}#
<Code-fragment> will be copied verbatim to the current document.
To add a new submenu to the current menu, or sub-menu, use the
following format :
#[Submenu name
Menu-submenu
]#
<Menu-submenu> are new menu and submenu declarations. They
will be placed under the current sub-menu.
To add a separator to the menu, use the following format :
##
A <Code-fragment> may contain keywords. Keywords have the
following format :
#%keyword%#
<keyword> can be one of the following values :
DATE - Inserts the date using the default format
EXT_ONLY - Inserts only the file's extension, not the name
FILE - Inserts the current file's name, excluding path
FILENAME_ONLY - Inserts only the file's name, not the extension
PATH - Inserts the current file's path, excluding filename
PROJECT - Inserts the current project's name
TIME - Inserts the current time using the default format
A <Code-fragment> may also contain format specifiers. Format
specifiers have the following format :
#specifier enclosed-text #
<specifier> can be one of the following values :
U - Uppercase <enclosed-text>
L - Lowercase <enclosed-text>
W - Force the <enclosed-text> to be the specified width. The
specifier must be followed by a width value, i.e. 10 and then
the enclosing text. e.g. #<W 10 This is a string>#
A space must separate each specifier and its enclosed text.
Keywords and specifiers are case-sensitive. They are always uppercase.
Keywords are handled first, then format specifiers. Embedding format
specifiers within other format specifiers may produce undesireable results.