You are currently viewing a snapshot of www.mozilla.org taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to www.mozilla.org, please file a bug.



Spelling Dialogs

Last updated 1/21/99 by Charles Manske
(cmanske@netscape.com)

1. Spell Checker Dialog

The new layout of spell checking controls was implemented in the Windows version of MozillaClassic, but only the dialog layout, not any changes in underlying behavior necessary to match this layout. This was redesigned to be more like other word processors, such as Microsoft Word(®), and should be considered the starting point for designing a new version for Mozilla/Communicator 5.0.
 
Windows: Mac: UNIX:

Invoke

Menu: Tools | Check Spelling (should also have an accelerator key, which we currently have trouble agreeing on among the different platforms.)

Initialization

  1. Fill the list of Languages by querying the spellcheck module for available languages.
  2. Start the spell check module using the current language (obtained from the preferences "editor.")
    • If text is selected, do spell checking only within the selected text. After checking the selected text, ask the user if they want to check the rest of the document.
    • If text is not selected, start searching for the first misspelled work starting from the top of the document.
  3. Search for the first misspelled word (this is what I call the "search and suggest" action):
    • If a word is found, put it in the "Word" editbox, get the list of suggested replacements from the spell checker and display them in the "Suggestions" listbox. The "Ignore" button should be the default action (what happens when the user presses the Enter key.)
    • If no misspelled word is found:
      1. The "Word" editbox is empty and disabled.
      2. Disable all buttons except for "Close," "Edit," and the "Language" combobox.
      3. Set the focus the "Close" button so that is the default action and the user can simply press the Enter key to dismiss the dialog.
  4. This dialog is nonmodal, so the user can click into the document and edit it while the spell check dialog is still active.

Dialog Rules

When the "Word" editbox is empty:
  1. Disable the "Suggest" and "Add" buttons
  2. Change the text on the "Replace" button to "Delete"
  3. Change the text on the "Replace All" button to "Delete All"
After user types something into this editbox, the button enabling and text should change back to the normal state.

Actions

 
Click Button Response
Suggest Rebuild the "Suggest" list using current text in the "Word" editbox as the text to lookup.
Ignore
  1. Do not replace the currently-selected text.
  2. Repeat the "search and suggest" action to find the next misspelled word.
Ignore All
  1. Do not replace the currently-selected text
  2. Save the text ignored and don't match to it during subsequent "search and suggest" actions
  3. Repeat the "search and suggest" action
Replace / Delete
  1. Get the "Word text" from the "Word" editbox and strip spaces
  2. Replace the last-found misspelled word with the "word text".
  3. Repeat the "search and suggest" action
Replace All / Delete All
  1. Get the "Word text" from the "Word" editbox and strip spaces
  2. Replace all occurences of the last found misspelled word with the "Word text"
  3. Repeat the "search and suggest" action
Add
  1. Get the "Word text" from the "Word" editbox and strip spaces
  2. If the "word text" from the editbox is different from the last-found misspelled word, replace the misspelled word with the "word text"
  3. Add the "word text" from to the current user dictionary (obtained from the "SpellChecker.PersonalDictionary" preference.)
  4. Repeat the "search and suggest" action
Edit Popup the Personal Dictionary Dialog. Remain in the main spell check dialog after returning from the Personal Dictionary dialog.
User Action
Select a word in the "Suggest" listbox Place the text from the selected "Suggest" list into the "Word" editbox. This will be the text to use to replace a misspelled word.
Selected a language in the "Language" popup list Restart the initial "search and suggest" actions using the newly-selected language for the dictionary.

Enhancements

While this new version is much closer to spell checkers in other word processors, there are still some differences that we should consider for our new dialog:
  1. Microsoft Word has separate editboxes called "Not in dictionary" and "Change to" instead of our single "Word" editbox. The reason that might be desirable is to show explicitly what text is being replaced with what. In our implementation, what I refer to above as the "last-found misspelled word" must be saved and is separate from the "Word" editbox value, which may be changed by the user. This is confusing to the user when the user edits the text in the "Word" editbox or deletes it entirely. In that state, the text that is being replaced is not visible in our implementation.
  2. Consider using the term "Learn" instead of "Add" (to the the personal dictionary.) "Learn" is used in Communicator 4.x and earlier implementations.
  3. Consider using the terms "Change" and "Change All" (used by MS Word) instead of "Replace" and "Replace All" (which are more compatable with the Find/Replace dialog.)
  4. Start spell checking from the current insert point (caret location) rather than the top of the document. After reaching the end of the document, spell checking should continue from the top until the original insert point is reached.


2. Personal Dictionary Dialog

Windows: Mac: UNIX:

Invoke

Click on the "Edit" button in the Spell Checker Dialog.

Initialization

  1. The "New Word" editbox is initially empty
  2. The "Words" list is filled with the words from the current user dictionary, but no item is initially selected.
  3. All buttons are initially disabled except for

Dialog Rules

 
User Action Result
Change the text in the "New Word" editbox Enable the "Add" button if the text is not empty, disable if empty.
Select an item in the "Words" listbox
  1. Copy the text of the selected item into the "New Word" editbox
  2. Enable the Remove and Replace buttons

Actions

OK, Cancel, and Help work in the usual fashion (Only OK saves the changes to the personal dictionary file.)