Delphi Components - Writing Help Files - More Tips

Well, the other pages are large enough, miscellaneous ideas are included here.

Adding New Methods | Linking Derived Classes | Internal Protected Functions
Actions | MS Word hints | Bulleted Lists

Related pages
Writing Help Files | Style_Guide | Table of Contents | MS Help Workshop | Checklist | More Tips


Adding New Methods

When developing a component, you are always adding new Properties, Methods, and Events. I have not automated the process of including those into an existing *.rtf file. Instead, I follow this procedure This procedure picks up all the formatting, footnotes, styles, and the like.

Be sure to save often.

Any overloaded method needs a SeeAlso link to the parent method.


Description / Actions / Overview sections

Besides the rather dry help explaining each property and method, your help should contain additional sections that describe how to use the components.

Be sure to add links to these via the components "SeeAlso" option.

This is particularly true if it is associated with actions. Be sure to provide an example of how to use these.


Add derived classes to the parents "SeeAlso" link

Many classes are written just to derive other classes. This is a way to produce a SeeAlso link that lists all the derived classes.

For the parent class, provide a hot link like this.

In each of the derived classes, add an A-Link that matches the hot link.

When done like this, additional derived classes are automatically linked without having to change the help file of the parent class. Because A-Links of the form TComponent_Child are not predefined in the Delphi 5 help, I have included this functionality in the Delphi Help Template Generator (specifically, it is defined in the Classes.txt template).


Internal protected functions

I sometimes provide help on internal protected methods. This is not required, but it allows me to better comment my code with hyperlinks to related items. (The Help Generator automatically generates the pages and links.)

Basically, there are 2 types of methods

Since these routines are never meant to be published


Actions

Actions are one of the more powerful constructs in Delphi ... and one of the worst documented.

There are 2 types of pme (properties, methods, events) pages associated with actions (these are gray and yellow)

On the pme pages associated with the classes the actions operate on (a link called Actions displays this page)

On the Property and Method pme pages associated with the definition of the action class On the Event pme pages associated with the definition of the action class Delete the Action pme pages associated with the definition of the action class, and the links to them - actions don't call actions.

For the classes called by actions, on the methods pme page indicate which methods are called by actions.


MS Word hints

Start by configuring MS Word.

Help Generator.zip. contains several MS Word template files (*.dot) - you should copy these to the MS Office template directory - the default is

Among other things, these files contain 2 toolbars and several styles

These toolbars are dockable - this means that they can be ripped off the section at the top of the screen and placed near the section you are working on. As delivered, the DelphiHelp toolbar is floating (to make it stand out for first time users) and the Documents toolbar is docked.


How to use the Templates

The supplied templates contain If you use the menu to select File / New... / DelphiHelp-Classes.dot you will get all 3. DelphiHelp-Properties.dot contains the same Toolbars and Styles, but different text.

To add the Toolbars and Styles to an existing document, select Tools / Templates and Add-Ins... change the Document template and check Automatically update document styles.

To add just the Toolbars to an existing document, select Tools / Templates and Add-Ins... and check one of the templates listed under Global templates and add-ins. (All the *.dot files in the templates directory should already be listed there.)

Using Tools / Templates and Add-Ins... / Organizer, it is possible to copy Toolbars and Styles from one *.dot file to another. (You might want to use this to copy the Documents toolbar to normal.dot so that it is available every time you use MS Word.)

If you select a template, then the template name (path) is stored with the document. The style definitions that are used in a document are also stored in that document. (The toolbars are NOT stored with the document.)

My Delphi Help Template Generator sets the default template to

It is interesting that this works fine even if Word is actually in another directory on on another drive.


Custom Toolbars

To make your own toolbars To modify how a button is displayed

The Documents toolbar has 3 buttons - the glyphs are from the MS Word palette.


Style Problems

Opening the same rtf document in MS Word 97 and MS Word XP shows different "styles".

Actually, this is good, it allows me to debug and fix various problems that are very hard to find in MS Word 97. However, I still do all my editing (and saving) in Word 97.


Bulleted Lists

In MS Word 97, Bulleted lists can be formatted so that they start indented and wrap properly. On the tab control, set the top slider to the first tic and the bottom 2 sliders to the second tic.

If you try to indent too far, the help does not align the wrapped lines the same way Word does - which makes it more difficult to edit the files.


Warning

There is a major design problem related to lists - I had a situation where text in the final help file started with numbers, just like a numbered list. I am referring to regular text, not the text in an obvious list. Of course, the numbers did not show in MS Word 97.

I was able to track it down to a bulleted list - the "solution" was to turn off the bullets, save the file, and then reenable the bullets.

Though this took me several days to "fix", I do not know how to reproduce it - it appears to be a bug in MS Word.

This appears to be the bad rtf code

At any rate, it is present on each failing line and not there when the file formats correctly.

The following is from the Microsoft RTF Spec.

From this analysis, it appears that I got this problem by copying text from one document to another.


Misc

Be sure to place all classes in your *.toc file.


Author: Robert Clemenzi - clemenzi@cpcug.org
URL: http:// cpcug.org / user / clemenzi / technical / Languages / Delphi / ComponentHelp_More.html