The spelling dialog is lonely. :-(
Justin implemented it under the Edit menu, because even though it belongs
under the Tools menu, we didn't have anything else to put there. Having it
all by itself there looks silly, and we didn't have any other working
dialogs to go under the Tools menu.
So as a quick and easy POW, we're looking for someone to create and hook up
a Word Count dialog, and stick it under a new Tools menu along with the
Justin's Spelling dialog and the Options dialog that Stephen Hack is
currently working on.
To complete this POW, you need to go through the same steps as you would for
adding any new dialog. Shaw's already given an in-depth overview of this
process for a previous POW:
Specific steps for this dialog:
1. Unlike the other unimplemented dialogs in AbiWord, this one doesn't even
have a placeholder menu item, so you'll need to do that first. Begin by
stubbing a new dlgWordCount edit method:
See the current stub for another unimplemented dialog, such as dlgOptions,
for ideas on how to do this.
Then add a new top-level Tools menu between the Format and Window menus, with
three submenus as follows (forgive the ASCII art):
To do so, you'll need to update the usual set of menu files:
While you're at it, you may want to rename the AP_MENU_ID_EDIT_ constants
for the spelling and options menu items. If so, be sure to locate all
instances across the tree.
2. Do the dialog work for both XP code and the platform of your choice.
A screenshot of Microsoft Word 97's dialog can be found at
This is a very simple dialog, with a minimal amount of platform-specific
logic. If you do your job right in XP code, and stub out the other platform
implementations, it should be trivial for the other platforms to add
3. Add an API call into FV_View to perform the relevant counts. You'll
need to walk through the document counting various kinds of data, with the
- header and footer sections should never be counted
- don't count UCS_TAB, UCS_LF, UCS_VTAB, UCS_FF, UCS_CR as characters
- spaces include UCS_SPACE, UCS_NBSP, UCS_EN_SPACE, UCS_EM_SPACE
There may be other characters to skip. If so, make sure you add definitions
for the appropriate constants to:
One final hint -- make sure that you only count a paragraph once, even if it
gets divided across multiple columns or pages.
4. Update your dlgWordCount edit method to hook everything together and
PS: For more background on the whole POW / ZAP / SHAZAM concept, see the