Beiträge von gsaunders

    Zitat von wpsupport

    1) - no, not required

    2) AsANSIString is a function and takes several parameters. The most important parameter is the "format string" which latest you select RTF, HTML or WPTOOLS and also additional options:
    https://www.wpcubed.com/manuals/formatstrings.htm

    Julian

    So when would one want to use AsANSIString verses AsString?

    For me I would guess we would always us AsString if the WPRichText component is doing all the editing loading and saving of data and not retrieving from any other external sources. I wouldn't see a reason to use AsANSIString since the WPRichText is handling the original creation and all editing of the content.

    Anyway... just wanting to understand when it would come into play where I would need it.

    Zitat von wpsupport

    My version of the WPCtrMemo does this:


    ChangeApplied is called after a change has made to the text.

    v5.23.6 is a bit old version, there is a much newer in your download account.

    Ok... here was the problem in this situation. We had always used the TDBWPRichText which wasn't firing the onChange. I just switched everything over to the TWPRichText and now I see it firing. My WPCtrMemo has the same code.

    I am definitely going to like using the TWPRichText since the OnChange works. We will be abandoning the TDBWPRichText since we are always using a SQL database and usually with a middle tier.

    Zitat von wpsupport

    Hi,
    ReformatAll must be called when you changed the character attributes directly (mdoify CharAttr index in paragraphs) or indirectly by changing a style. It is not required if you used the toolbar, CurrAttr and similar, because then the engine knows which lines have to be initialized.

    ReformatAll always have to be called if you change the text (load, MergeText ..) and do a Print or PDF output after that whithout giving the editor a chance to refresh itself.
    Julian

    1) So... if I populate the TWPRichText using the wprichtext.asString := afield.asString do I need to call ReformatAll?

    2) And should one be using the .asString or the .asAnsiString. Could you give a description of the differences and when one should be used verses the other.

    Thanks

    Using v5.23.6

    Here are some properties I have not always been sure when they should be used.

    When using the TWPRichText or the TDBWPRichText when should one be using the refresh, reformatall, and changing methods?

    And where is the best place to find answers like this. The help file doesn't always let you know when you should be using something.

    Greg

    Using v5.23.6.

    I know I can tell when the contents of the twpRichText has been modified by checking the modified property.

    BUT how do I detect a change as it happens so I can update the enabled status of a save / cancel button?

    I had the type of question in the past related to using spell check and we had a work around using an event of the icon press of the spell check button.

    BUT... no one is clicking a button here... just typing text.

    I would think the OnChange event would be the natural thing, but no go.

    1) So what is the OnChange good for?

    2) How do I detect any changes to the content by the user.

    3) How do I detect any changes to the content when done by code and not the user.

    Again... not intersted in the modified property... but a way to have an event fire as it happened.

    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.

    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

    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.

    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???

    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.

    WPTools 5... why does this not print the pages specified by the user?

    Code
    DBWPRTAppendix.PrintParameter.PageRange := wprPageList;
    DBWPRTAppendix.PrintParameter.PageList := frmConPrintDialog.edFrom.Text + '-' + frmConPrintDialog.edTo.Text;
    DBWPRTAppendix.Print;

    It is very important we get this working.

    Also there use to be a PrintParameter.NumberOfCopies. What is the proper way of getting multiple page copies? Is it using Printer.Copies;?

    Currently when a user edits the text withing the TWPRichText component it fires off the onchange event which we use as our way of knowing things were modified and therefore give the user a save option.

    When we use EDSSpell, the user clicks on spell check, and then the user allows EDSSpell to do some corrections the OnChange event is never fired. I need to have a way to know when a change takes place as it takes place so I can update the save and cancel actions.

    Thanks in advance for you help.

    Ok... the strange issues we were seeing after the fix you gave us dealt with the fact another copy of the dcp and bpl was on the system within the search path. Believe or not Microsoft Search was not finding the files, but I knew things were acting like I was viewing the new code, but running old code. I used another search tool and it found them. What a pain.

    I will be putting this into production tomorrow and hopefully it will hold.

    Thanks for the help.