Saturday, 9 March 2013

Changing Placeholder Strings


Changing Placeholder Strings

To change the placeholder strings left behind by AppWizard in the boilerplate Help
files, open afxcore.rtf in Word if it isn't already open. (It's in the hlp folder of the
ShowString project folder.) Then follow these steps:
1. Position the cursor at the very beginning of the document and choose Edit,

Replace.
2. Enter <<YourApp>> in the Find What box and ShowString in the Replace With
box.
3. Click Replace All.
Open afxprint.rtf and repeat these steps.
Switch back to afxcore.rtf and look through the text for << characters (use Edit, Find
and remember that Shift+F4 is the shortcut to repeat your previous Find). These identify
places where you must make a change or a decision. For ShowString, the changes in
afxcore.rtf are these:
1. The first section in the file is the ShowString Help Index. Remove the How To
section and the reminder to add some How To topics. In a real application, you add
topics here.
2. The next section, after the page break, is a table describing the items on the File
menu. Because there is no Send item on ShowString's File menu, remove the Send
row of the File menu table.
3. The third section is a table listing the items on the Edit menu. Remove the Paste
Link, Insert New Object, and Links rows.
4. The fourth section is for the View menu and does not need any changes.
5. The fifth section is for the Window menu. Remove the Split row from the
Window menu table.
6. The sixth section is for the Help menu and does not need any changes.
7. The seventh section is for the New command (File menu). Remove the sentence
about choosing a file type and the reminder to remove it.
8. Entirely delete the eighth section, the File New dialog box topic, including the
page break before or after it, but not both. Whenever you remove a section,
remove one of the breaks so that the file does not contain two consecutive page
breaks.
9. The next topic is for the File, Open command and does not need any changes.
10. Moving on to the File Open dialog box topic, edit the text to mention that the
List Files of Type list box contains only All Files.

11. Continue down the file until you find the File, Send topic and remove it
entirely, including one page break either before or after it.
12. In the File Save As topic, remove the suggestion to describe other options
because there are none.
13. When you reach the Edit Undo topic, you start to see why programs written
after their manuals are better programs. The way ShowString was written in
Chapter 8, the Undo item will never be enabled, nor will Cut, Copy, or Paste. You
could remove the Help topics about these unsupported menu items, but it's
probably better to plan on adding support for the menu items to a later version of
ShowString. Add some text to all these topics, explaining that they aren't
implemented in this version of the product. Leave the shortcuts sections there so
that users can find out why Ctrl+Z does nothing.
14. Continue down through the file to the Toolbar topic, where you find this
reminder: << Add or remove toolbar buttons from the list below according to
which ones your application offers. >> Remove the reminder and delete the
references to the Cut, Copy, Paste, Undo, First Record, Previous Record, Next
Record, and Last Record buttons.
15. About halfway down the file is a topic for the Split command (Window menu).
Remove the entire topic.
16. Move down to the Index command (Help menu) topic and remove it. Also remove
the Using Help command (Help menu) and About command (Help menu) topics.
17. In the Title Bar topic, remove the directive to insert a graphic. If you would
rather follow the directive, create a bitmap in a .bmp file of the title bar with
screen shot software, cropping the shot down to just the title bar, and insert the
graphic with the bmc directive, just as the bullet.bmp graphic is inserted a few
lines lower in the file.
18. Because the ShowString view does not inherit from CScrollView, it does not
scroll. Remove the Scrollbars Help topic and its page break.
19. In the Close command topic (not the File Close topic, which was much earlier in
the file) the shortcut for Alt+F4 should be described like this: closes ShowString.
20. Remove the Ruler, Choose Font, Choose Color, Edit Find, Find Dialog, Edit
Replace, Replace Dialog Box, Edit Repeat, Edit Clear, Edit Clear All, Next Pane,
and Previous Pane topics.
21. Skip the How To Modify Text topic for now and leave it unchanged.

22. Remove the final directive about tailoring the No Help Available messages to
each message box (don't remove the two No Help Available topics).
That completes the extensive changes required to the boilerplate afxcore.rtf file
generated by AppWizard. In the other boilerplate file, afxprint.rtf, scroll to the
bottom and remove the Page Setup topic.
Would you like to test all this work? Save afxcore.rtf and afxprint.rtf within Word.
Switch to Developer Studio and choose Build, Build to bring the project up to date.
Then open ShowString.hpj and choose Build, Compile. This pulls all the .rtf files
together into ShowString.hlp. Choose Build, Execute to run ShowString, and choose
Help, Help Topics from the ShowString menus. As you can see in Figure 11.8, the Window
menu topic is now substantially shorter. You can check that your other changes have
been made, as well.
FIG. 11.8 After saving the .rtf files and compiling the Help project, you can test to see that your
changes have been made successfully.



No comments:

Post a Comment