Spelling Dialogs
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
-
Fill the list of Languages by querying the spellcheck module for available
languages.
-
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.
-
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:
-
The "Word" editbox is empty and disabled.
-
Disable all buttons except for "Close," "Edit," and the "Language" combobox.
-
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.
-
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:
-
Disable the "Suggest" and "Add" buttons
-
Change the text on the "Replace" button to "Delete"
-
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 |
-
Do not replace the currently-selected text.
-
Repeat the "search and suggest" action to find the next misspelled word.
|
Ignore All |
-
Do not replace the currently-selected text
-
Save the text ignored and don't match to it during subsequent "search and
suggest" actions
-
Repeat the "search and suggest" action
|
Replace / Delete |
-
Get the "Word text" from the "Word" editbox and strip spaces
-
Replace the last-found misspelled word with the "word text".
-
Repeat the "search and suggest" action
|
Replace All / Delete All |
-
Get the "Word text" from the "Word" editbox and strip spaces
-
Replace all occurences of the last found misspelled word with the "Word
text"
-
Repeat the "search and suggest" action
|
Add |
-
Get the "Word text" from the "Word" editbox and strip spaces
-
If the "word text" from the editbox is different from the last-found misspelled
word, replace the misspelled word with the "word text"
-
Add the "word text" from to the current user dictionary (obtained from
the "SpellChecker.PersonalDictionary" preference.)
-
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:
-
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.
-
Consider using the term "Learn" instead of "Add" (to the the personal dictionary.)
"Learn" is used in Communicator 4.x and earlier implementations.
-
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.)
-
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
-
The "New Word" editbox is initially empty
-
The "Words" list is filled with the words from the current user dictionary,
but no item is initially selected.
-
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 |
-
Copy the text of the selected item into the "New Word" editbox
-
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.)