code_template_source

所属分类:编辑器/阅读器
开发工具:Visual C++
文件大小:20KB
下载次数:132
上传日期:2006-04-11 10:50:22
上 传 者peter_yu
说明:  一个VC IDE环境下的addin程序,能帮助你在代码编辑器中插入一段文本
(a VC IDE environment of addin procedures that will help you in your code editor insertion of a text)

文件列表:
bigbar.bmp (1142, 1998-03-23)
CodeTmpl.cpp (1881, 1998-03-23)
CodeTmpl.def (224, 1998-03-23)
CodeTmpl.dsp (16031, 1998-03-23)
CodeTmpl.h (6009, 1998-03-24)
CodeTmpl.idl (1295, 1998-03-23)
CodeTmpl.opt (49664, 1998-03-24)
CodeTmpl.rc (3472, 1998-03-23)
CodeTmpl.txt (1672, 1998-03-24)
CodeTmplps.def (250, 1998-03-23)
CodeTmplps.mk (455, 1998-03-23)
code_template.shtml (4621, 1998-05-25)
CTAddIn.cpp (8981, 1998-03-24)
CTAddIn.h (2489, 1998-03-24)
CTAddIn.rgs (466, 1998-03-23)
medbar.bmp (374, 1998-03-23)
PopMenu.cpp (1876, 1998-03-24)
PopMenu.h (875, 1998-03-24)
resource.h (636, 1998-03-23)
StdAfx.cpp (128, 1998-03-23)
StdAfx.h (765, 1998-03-23)

CodeTmpl - Code Template add-in for Visual C++ 5.0 -------------------------------------------------- * Introduction The CodeTmpl add-in provides a simple mechanism for inserting commonly used text blocks into your source code. * Install Build the CodeTmpl project using the Win32 MinDependency build configuration, and copy the CodeTmpl.txt file into your DevStudio\SharedIDE directory. Install the CodeTmpl add-in by selecting Customize from the Tools Menu and browsing for the DLL on the 'Add-ins and Macro files' tab. The add-in should appear as 'CTAddIn Class' in the list of active add-ins. Once installed a new toolbar with a single button should appear for the CodeTmpl add-in. * Overview So what does this thing do for me you're wondering. Well the CodeTmpl.txt that you copied into your SharedIDE directory contains chunks of source code delimited into named blocks. When you click on the CodeTmpl toolbar button you'll see those same names appear on a popup menu, and should you select one, then the appropriate chunk of source code will be glued into your current source code document at the insertion point. * Configuration Clearly my idea of useful bits of code is probably not yours, so the CodeTmpl add-in is completely configurable, by simply editting the CodeTmpl.txt file. The format of the CodeTmpl.txt file is extremely simple. Basically you paste your favourite blocks of source code into the file and put a pair of 'tags' at the beginning and end of each block. The tag '#{' goes at the beginning of the block and the tag '#}' goes at the end. The '#{' tag should be followed by a name for that block that will appear on the popup menu. The tags must appear at the beginning of a new line. Any text outside of the tags is ignored, with the exception of a string of 2 or more hashes which cause a separator to appear on the pop up menu. For example : #{Hello World - Console #include int main() { puts("Hello, World"); } #} ########################## #{Hello World - GUI #include int PASCAL WinMain(HANDLE hInstance, HANDLE hPrevInstance, LPSTR lpszCommandLine, int cmdShow) { MessageBox(NULL, "Hello, World", "Example", MB_OK); } #} If your CodeTmpl.txt contained the above text then clicking the CodeTmpl toolbar button would display a popup menu containing the options 'Hello World - Console' and 'Hello World - GUI', with a separator between them. Selecting 'Hello World - Console' would paste the text shown between the '#{' and '#}' tags into your source. * Tips If you click the CodeTmpl toolbar button with the key down, then the CodeTmpl.txt is re-read by the add-in before the popup menu is displayed. This is to allow for on the fly configuration changes. When editting the CodeTmpl.txt file in DevStudio, right hand mouse click the window in which it is open, select Properties from the context menu and set Language to C/C++ from the property dialog. This will give you color coding and make the tab key do what is ought to. * Contact me I hope you will find this add-in useful either for its intended purpose or just as a source code example. Either way feel free to e-mail me with any comments, suggestions etc. Darren Richards. darrenr@gissing-consulting.co.uk

近期下载者

相关文件


收藏者