Welcome Guest Search | Active Topics | Sign In | Register

WebBrowser spell checker implementation Options
Apex Networks Ltd.
Posted: Monday, February 1, 2016 7:10:36 AM

Rank: Advanced Member
Groups: Member

Joined: 5/8/2015
Posts: 46
Hi,

I noticed you've added the spellchecker switch in the latest version, thank you.

I'm trying to implement a spell checker and it seems to be clashing with other parts of my code.

In the WebView we handle the BeforeContextMenu event then clear all menu items and add our own (cut, copy, paste etc.) based on an attribute in the field. If I comment out the code to clear the menu and add our own custom items then we get all the usual ones with spelling suggestions at the bottom, all good. But - each spelling suggestion has a shortcut key by the looks of it (F1-Fx), we also handle the WebView.Command event to handle our own F key shortcuts for various things, which are getting triggered when the spelling suggestion is clicked.

Is there a way to add the spelling suggestions without the F key command? I've tried clearing the menu and then adding the suggestions using e.Menu.Items.AddSpellCheckSuggstions(e.MenuInfo.Suggestions) but this still adds the F key commands?

Regards,
Andy.
Apex Networks Ltd.
Posted: Monday, February 1, 2016 7:40:30 AM

Rank: Advanced Member
Groups: Member

Joined: 5/8/2015
Posts: 46
I've just worked out that I can check for the presence of MenuInfo in my OnCommand event handler of the WebView:

if (e.MenuInfo == null) {
// Carry on to handle the command
}
else {
// Command must be from the context menu so ignore it...
}

This works fine but is a bit of a bodge?

Regards,
Andy
Apex Networks Ltd.
Posted: Monday, February 1, 2016 9:19:13 AM

Rank: Advanced Member
Groups: Member

Joined: 5/8/2015
Posts: 46
Ok, I've dug a little deeper and got to the root of it. Our web browser registers shortcuts for F keys, we had registered commandIDs that are part of the CommandIDs enum in error. this is why some of the spelling check suggestions had F key items next to them, the browser thought that because that key was registered as a shortcut with the same command ID it should put them there.

I've moved our custom command IDs up into the 1000 range so as not to clash with the pre-registered command IDs and this seems to work OK now.

Thanks,.
Andy.
eo_support
Posted: Monday, February 1, 2016 9:57:11 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
Glad to hear that you worked it out. Please feel free to let us know if you still have any questions.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.