How do I load an RTF formatted string into the TAdvRichEditor component? I have get the RTF string via the ContentAsRTF but there doesn't seem to be a way to do the opposite? The strings are being stored in another class which reads / writes as an XML file.
You can use
When the formatting is changed programmatically, the OnChange event will not be triggered (by design) as the code in this "knows" when a change is done.
When the formatting is changed with a shortcut, for example Ctrl-B to make the selection bold, the OnChange event will be triggered.
To clarify, the formatting buttons don't cause an OnChange event if the currently selected text is the entire text. It does work when the selection is at least one character short of the entire text.
When done from the toolbar, this was indeed not yet happening. We are working to address this for the next update.
Getting back to this, I still can't get InsertAsRTF to work the way I want. It works if fed an RTF formatting string, but fails if fed plain text. In my application it could be either.
There is AdvRichEditor.InsertAsRTF() for when it concerns RTF formatted text and there is AdvRichEditor.InsertMultiLineText() for when it concerns plain text.
The source of the text data in my case can contain plain or rich text.
Why can't LoadAsRTF just load the plain text if there's no formatting in it?
Well, at this moment, it does not test for RTF, it assumes it is RTF as after all, it concerns a method called InsertAsRTF()