TDBWPRichText/TWPToolbar and Spell Check not work - EDSSPELL

  • Hello,

    We have Delphi 6 (updated) and WPTools 5.23.6.

    We have a TDBWPRichText that is connected to a TWPToolbar.

    The WPToolbar has the sel_EditIcon SelSpellCheck enabled.

    Today a user told me the spell check no longer works. You just click it an it does nothing.

    It has been a long time since I looked at this code and I can't remember if we have to do something other then setting SelSpellCheck to true. I don't see any code referencing spell checking so I don't remember if it was a built in feature and should work or if somehow some code was removed by accident.

    I am going to do some further research, but would appreciate any guidance you may have.

    Thanks.

  • Further information... from what it looks like you MUST have a spell checking package like WPSpell, EDSSpell, or the AddictSpell to do any spell checking. The only package we own is EDSSpell and according to what I find you have to have the eds_wptools unit included in the uses clause.

    I added this and it does do a spell check BUT, BUT, BUT

    I have compared the source code with the code in sourcesafe and it has NEVER had the eds_wptools in the uses clause which makes me wonder how the heck spell checking use to work.

    So is there another way to get spell checking to work without the eds_wptools unit in the uses clause... or is there a built in one that somehow we have broken???

  • There looks like another way to handle the spell check is assigning a method to the OnStartSpellCheck event, but we have NEVER used this event so I know that is not how it was going.

    We are absolutely stumped on how the spell checking could have been working without the eds_tools in the uses clause... but multiple users say they have definitely been using that feature prior to our last update.

    Our last update didn't have anything to do with wptools or edsspell and the fact we can compare code from this release and the last has us baffled.

    So... is there another way for edsspell to be used with wptools without having eds_wptools in the uses clause (other than the OnStartSpellCheck)???

    If we decide to not solve the mystery, but simply do the needed steps to get it active again it looks like I have two options:

    1) add eds_wptools to the uses clause and let the default action take place. The problem here is we never see that the text has been modified so our save button never activates... I don't believe the WPRichTextChange event ever fires here.

    2) I see from an older post back in 2007 we could control the spell check by assigning a method to the OnStartSpellCheck event. That way we can control our status if a change has been made. I am assuming we some how call the spell check and then after the spell check we can somehow mark the modified property as true.

    If we do option 2 what needs to be in the event to initiate the spell check? I tried putting the standard SpellDlg.SpellCheck (used for standard controls with EDSSpell) and it fails miserably with various errors. I can't find any examples on how to initiate this properly for the wptools controls.

    • Offizieller Beitrag

    Hi,

    EDSSPell can only work if the unit eds_wptools is used.

    Intern it initializes an object which inherits from
    TWPSpellCheckInterface
    and implements SpellEngine_OnStartSpellcheck, DoSpellCheckWord etc.

    It is not required to use OnStartSpellCheck.

    I would first recommend to place breakpoints into eds_wptools to see if the methods are called.

    You can of course add a OnIconSelection event and react on the button click BEFORE the internal code takes place. There you can switch the dataset into edit mode.

    Julian

  • Zitat

    EDSSPell can only work if the unit eds_wptools is used.

    That is what I thought... we just can't find any of our source code that ever had it in there... but I can't see how it didn't

    Either way we have to get it going so I know I can add it and it runs. BUT if we want to use the OnStartSpellcheck so we can have control over setting our enabled flag for our save button how do we correctly do it?

    The only reason we are looking at this is because in the past (looking at old posts and old notes) I see we had the problem where we had no way of knowing if the text changed after the standard spell check process took place. You had suggested using the OnStartSpellCheck, but I am unsure how to implement it. I have a method created now that is assigned to the event, but don't know what code needs to be used to initiate the spell check properly with the wptools RichText component.

    Any guidance would be appreciated. And if there is a way to tell if the text did change then maybe we can avoid the OnStartSpellCheck.

    Ok... I just re-read your post and see you mentioned using the OnIconSelection... I'll play with that in the meantime as well.

    Greg

  • Zitat von wpsupport

    Hi,

    You can of course add a OnIconSelection event and react on the button click BEFORE the internal code takes place. There you can switch the dataset into edit mode.

    Julian

    Putting the eds_wptools in uses clause causes the default spell check action to take place which I noted previously.

    Now to solve the need to know an actual change took place... I tried your OnIconSelection event and I can indeed force our save button enabled property to true, but that means the save button will be made active even if the user didn't change anything with the spell checker. So for example...

    The user creates letter, saves it, then does a spell check, using OnIconSelction I make the save button enabled, the user doesn't change anything. Now he is wondering why the save button is enabled when he didn't change anything. I can live with this for now, but it would have been good to be able to utilize the OnStartSpellCheck event, manually initiate the spell check and if something changed then enable the save button, but I can't find any documentation on how to utilize the event or how to successfully have edsspell do its thing outside of the default action.

    Any further feedback would be appreciated.

    • Offizieller Beitrag

    The DBWPRichText would have the problem that unless the dataset is in edit mode
    any call to Changing would issue a reload.

    The EDS unit WPBuff calls InputString

    ( ParentControl as TWPCustomRtfEdit).InputString(WithWord);
    WeModified := TRUE;

    it also sets WeModified, which is private. You can make this public.

    InputString however does not call "Changing" because it is meant to be used
    under program control only.

    You can add a

    Zitat

    if ( ParentControl as TWPCustomRtfEdit).Changing then
    begin
    ( ParentControl as TWPCustomRtfEdit).InputString(WithWord);
    ( ParentControl as TWPCustomRtfEdit).ChangeApplied;
    end;

    EDS should then work as expected.