When I spell check a TWPRichEdit and click the Change button on the spellcheck dialog to change a misspelling, the WPRichText.OnChange method does not get fired. So how do I know that the user clicked the Change button? I've looked at the WPTools demo but found nothing there that helps.
Post subject: Re: Addict 4.1 and WPTools6 TWPRichEdit
Posted: Mon Jan 25, 2010 6:01 pm
Joined: Mon Jan 05, 2009 2:50 am Posts: 131 Location: Kalgoorlie, Western Australia
Hi,
The WPTools Author generously helped design the Addict / WPTools parser - and so there may be a reason that event doesn't fire - I tried just quickly to add something to the ReplaceWord Method of the Parser but couldn't get that event to fire - he may be able to suggest a better event in WPRichEdit to watch.
Post subject: Re: Addict 4.1 and WPTools6 TWPRichEdit
Posted: Tue Jan 26, 2010 1:35 pm
Joined: Mon Jan 25, 2010 3:06 pm Posts: 6
I asked him first. He told me to ask you. Is there some property in the TAddictSpell component that contains a list of all corrections made while the dialog box is in use? Some flag that gets set if the user clicks the Change button maybe?
Post subject: Re: Addict 4.1 and WPTools6 TWPRichEdit
Posted: Tue Jan 26, 2010 6:30 pm
Joined: Mon Jan 05, 2009 2:50 am Posts: 131 Location: Kalgoorlie, Western Australia
We can't really control whether a 3rd Party Control fires the OnChange Event when a Spelling Correction occurs - if WPRichEdit had a method like DoChange then we could call it in the parser, but I can't seem to find one.
If you have a look at the Addict Demo, and connect a message to the OnChange event of the TRichEdits you will see it dioes get called with both Dialog based Spell Checking and Live Spell Checking - and a similar thing happens in other 3rd party controls, so Addict doesn't normally need an OnChange event - and I must admit till you reported this I didn't realise that WPRichEdit didn't work this way.
I'll check with the Author, but if you could give a bit more info about what you are trying to achieve from the OnChange Event I may be able to advise better - and are you concerned with Dialog-based Spelling or Live Spelling or both.
Also I could perhaps add a OnReplaceWord Event to the WPTools/Addict Parser - but you would have to connect to that at Runtime since it is not a component. Let me know...
Post subject: Re: Addict 4.1 and WPTools6 TWPRichEdit
Posted: Thu Jan 28, 2010 10:26 pm
Joined: Mon Jan 25, 2010 3:06 pm Posts: 6
What I'm trying to do is simply enable my Save button when a user clicks the Change button on the spell check dialog so when they close the rich edit page they get a prompt to save their changes. I haven't turned on the Live Spelling yet but I'm certainly planning on doing that soon so I'll be wanting that functionality with both spell-checking methods.
The OnReplaceWord event sounds pretty good and attaching it at runtime is no problem.
Post subject: Re: Addict 4.1 and WPTools6 TWPRichEdit
Posted: Fri Jan 29, 2010 1:41 am
Site Admin
Joined: Wed Dec 31, 2008 2:55 pm Posts: 74
This should be the event you want. It fires before a change is about to be made in the edit control when you're using dialog-based spell checking.
(* Summary This event fires in response to the first change to an edit control being checked.
Description Use this event to be notified before the first change is made to the edit control being checked. This could be an ideal place to place a data aware control's dataset into edit mode. *)
Users browsing this forum: No registered users and 2 guests
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum