Delphi Clinic C++Builder Gate Training & Consultancy Delphi Notes Weblog Dr.Bob's Webshop
Bob Swart (aka Drs.Bob) Dr.Bob's Delphi Clinics Dr.Bob's Delphi Courseware Manuals
View Bob Swart's profile on LinkedIn Drs.Bob's Delphi Notes
These are the voyages using Delphi Enterprise (and Architect). Its mission: to explore strange, new worlds. To design and build new applications. To boldly go...
Title:

Delphi 2006 Live Template for MessageDlg

Author: Bob Swart
Posted: 1/7/2006 8:56:31 AM (GMT+1)
Content:

There are a number of blog posts that explain how to create your own custom Live Templates for Delphi 2006, and I had to create a few of my own recently. One Live Template was called "log" and expanded to a call to my logging routines (I can imagine something like that to exist - now or shortly - for CodeSite as well).
Another perhaps useful one is for the MessageDlg, as is defining the points for the Message, MessageType and MessageButtons. The XML is as follows (just copy and paste into an .xml file placed somewhere in your BDS\4.0\Objrepos\code_templates\delphi directory):

<?xml version="1.0" encoding="utf-8" ?>
<codetemplate xmlns="http://schemas.borland.com/Delphi/2005/codetemplates" version="1.0.0">
<template name="md" invoke="auto">
<description>MessageDlg live template</description>
<author>Bob Swart</author>
<point name="Message">
<text>Hello</text>
<hint>Message</hint>
</point>
<point name="MessageType">
<text>mtInformation</text>
<hint>Message Type</hint>
</point>
<point name="MessageButtons">
<text>mbOK</text>
<hint>Message Buttons</hint>
</point>
<code language="Delphi" delimiter="|">
<![CDATA[MessageDlg('|Message|', |MessageType|, [|MessageButtons|], 0);|end|]]>
</code>
</template>
</codetemplate>
The effect of this code template in action is as follows:

Back  


5 Comments

AuthorPostedComments
Bob Swart06/01/08 15:03:03For more details about the inner workings of this Live Template, I've written a Dutch article at http://www.eBob42.com/papers/livetemplates
Ritsaert Hornstra06/01/09 14:45:59I searched the helpfile but could not find anything. Do you know an overview of all possibilities? Seeing the examples within Delphi it seems that there is plenty to discover...
Bob Swart06/01/09 23:48:59Ritsaert, I'm afraid you just have to "use the source" to figure it all out - there's no documentation as far as I know, except from a number of blog posts here and there...
Guest06/01/23 20:55:51I think that should read "Delphi 2006 Live templates" (not Delphi 2005)
Bob Swart06/01/24 09:06:13Good Point - I've fixed it. Thanks!


New Comment (max. 2048 characters, no HTML):

Name:
Comment:



This webpage © 2005-2017 by Bob Swart (aka Dr.Bob - www.drbob42.com). All Rights Reserved.