tags:

views:

126

answers:

2

Are there examples and resources (source code and documentation) available which show how a 'New xyz Application' or 'New xyz Document' wizard can be created with Delphi which then will appear in the new project / new file dialog of the Delphi IDE?

What I want to do: for some of my libraries I would like to add a new project type and a new file type to the IDE dialogs, which will guide the developer through a wizard and then create some customized auto-generated source code.

So far I found this short overview:

Experts and Wizards in Delphi

And this article OTA: Visual design of Wizards

Note that this question is not about wizard or GUI creation in general but on how the Delphi IDE can be extended to include my own new project / file type dialogs. The new project and file types should appear in the new file or new project type dialog in the matching category (or even a new one).

+1  A: 

You can try the JvWizard from the JVCL Components.

you can check an example of use here (translated page)

alt text

Bye.

RRUZ
+1  A: 

The source code for the "Visual design of Wizards" article is here. That code in itself is an example of what you're asking for, but it can also be used to create your "creators" by writing less code and designing more in the IDE object inspector.

Basically, to have a new source file item for Delphi's "New Items" dialog you need to implement IOTAModuleCreator ; for a new project item you need to implement IOTAProjectCreator. You can even implement IOTAProjectGroupCreator to add an item which will create a whole project group with several projects at once.

Your implementors of these interfaces should generate the source code and return it to the IDE via an implementation of IOTAFile interface. ToolsAPI already contains TOTAFile class which you can easily use by passing it a string of the whole contents of the new file. This will create an unnamed file in memory which the user can then save to hard disk and give it a file name.

You can also find more information by following the links in Zarko's article.

Also see the ToolsAPI unit where the interfaces are declared. There are also some explanations in the comments.

TOndrej