I have written a wizard in Delphi XE, and it is working fine. However, I have not figured out yet how to access the generated default unit name (or form name or project name) that Delphi's OTA can create.
In my old-style wizard I was able to call ToolServices.GetNewModuleName to discover an available unit and form name that I could use when generating the associated source files. What is the equivalent in today's open tools API?
According to the ToolsAPI unit comments, I should return a blank from the IOTAModuleCreator.GetImplFileName method to have Delphi generate the file name. I am returning an empty string from this method, but still cannot see where I can access the file name that Delphi is generating.
There is a specific method for getting a new form and unit name:
(BorlandIDEServices as IOTAModuleServices).GetNewModuleAndClassName( '', UnitIdent, FormName, FileName);
I've used in a few examples and it seems to work fine.
The method IOTAModuleCreator.NewImplSource have a "ModuleIdent" parametter, it is the unit name.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With