Live Spell Check Problem
Posted: Mon Jul 31, 2006 11:27 pm
Hello All:
I have a live spell check problem that I have been unable to figure out.
Using the RichViewEdit, and an RVAPopupMenu. Also using EDDSSpell and the TrvSpellDialog to make that work. I can spell check OK when doing the whole document. The live spell check works OK - a misspelled word gets a wavy line under it correctly (through the use of the OnSpellingCheck event). My problem is trying to allow the user to change the word through the right-click popup menu when it is spelled wrong or not found. I can force suggestions to be added to the standard right popup menu by physically adding items to the string list in the RvaPopupMenu.OnLiveSpellGetSuggestions() event (see below:)
procedure TfrmEditor.RVAPopupMenu1LiveSpellGetSuggestions(
Sender: TRVAPopupMenu; Edit: TCustomRichViewEdit; const Word: String;
StyleNo: Integer; Suggestions: TStrings);
Var
SList: TStrings;
begin
Suggestions.Add('Froop');
Suggestions.Add('Gleep');
end;
What I cannot do, however, is to get the RVEDSSSpell dialog to give me suggestions from the dictionary. I mean, It works fine if I just put a button on the dialog and press it - then I get all of the correct suggestions. Inside the method called in the OnLiveSpellGetSuggestions event, the call to RVEDSSPell.SuggestWords() just does not work - it always returns a NIL string list.
Is this caused by the spelling thread working at a lower priority?
Ideally, I would like to be able to put up the same spelling dialog that it uses when spell checking the entire control when a word is incorrect; allowing add / ignore / etc. If it puts up this dialog, I would like to avoid the standard pop up with the cut, copy, paste, etc on it. I am not sure how to do this.
Ideas?
Thanks
jamie
I have a live spell check problem that I have been unable to figure out.
Using the RichViewEdit, and an RVAPopupMenu. Also using EDDSSpell and the TrvSpellDialog to make that work. I can spell check OK when doing the whole document. The live spell check works OK - a misspelled word gets a wavy line under it correctly (through the use of the OnSpellingCheck event). My problem is trying to allow the user to change the word through the right-click popup menu when it is spelled wrong or not found. I can force suggestions to be added to the standard right popup menu by physically adding items to the string list in the RvaPopupMenu.OnLiveSpellGetSuggestions() event (see below:)
procedure TfrmEditor.RVAPopupMenu1LiveSpellGetSuggestions(
Sender: TRVAPopupMenu; Edit: TCustomRichViewEdit; const Word: String;
StyleNo: Integer; Suggestions: TStrings);
Var
SList: TStrings;
begin
Suggestions.Add('Froop');
Suggestions.Add('Gleep');
end;
What I cannot do, however, is to get the RVEDSSSpell dialog to give me suggestions from the dictionary. I mean, It works fine if I just put a button on the dialog and press it - then I get all of the correct suggestions. Inside the method called in the OnLiveSpellGetSuggestions event, the call to RVEDSSPell.SuggestWords() just does not work - it always returns a NIL string list.
Is this caused by the spelling thread working at a lower priority?
Ideally, I would like to be able to put up the same spelling dialog that it uses when spell checking the entire control when a word is incorrect; allowing add / ignore / etc. If it puts up this dialog, I would like to avoid the standard pop up with the cut, copy, paste, etc on it. I am not sure how to do this.
Ideas?
Thanks
jamie