Re: SCU and FTC via Contextual Menu Click

Bob Keeney wrote:
I just purchased the Spell Check Utility and I'd like to implement a contextual menu with ignore/spelling suggestions when the user right clicks on a misspelled word. So there are a couple of questions:

1) Is there way to determine the word that was selected in the right click and then automagically select it?

1) If you want to determine if the cursor was within the selected
word when the user right clicks, you can use the recently
implemented findSelectionRectangle to get the selection rectangle
and then compare the X, Y coordinates and see if it is within the
word. If it then then falls within the rectangle, then you can get
the selected text and do any further processing as needed.

2) Now when there is no selected text and the user clicks on a
word, you need to call...

FTDocument.findWordBoundaryAtInsertion

This looks at the current insertion point and gives you the
boundary of the word the user just clicked on.

If you run into problems, let me know. I can then add more support
for this type of activity in the FTC because this will be a common
task for a lot of people including myself.

2)  Have you done anything like this between SCU and FTC?

I personally have not done this yet.

FTC Website: 
http://www.truenorthsoftware.com/FormattedTextControl/FormattedTextControl.html
Set List Options (digest and vacation modes): www.freelists.org/list/ftcdev
List Archive: www.freelists.org/archives/ftcdev
Unsubscribe: Send email to ftcdev-request@xxxxxxxxxxxxx with "unsubscribe" in 
the subject field.



Other related posts: