Hi Sergey,
can you please help with this:
Aim:
To insert HTML (which contains custom control tags) to caret position/curr. selection.
Problem:
As RvHtmlImport only allows to LoadHtml (replace all or append) but not insert, I tried to use SaveRVF[RTF]ToStream, LoadRVF[RTF]FromStream and InsertRVF[RTF]FromStreamEd.
Saving and loading RVF or RTF to and from streams runs into problems when the RichView contains custom controls (our own subclasses of TGraphicControl).
e.g.
CRVFData -> GetParaBounds throws index out of bounds;
RVFMisc -> RVFLoadControl[Binary] throws "... exception class EClassNotFound with message 'Class [our custom control] not found' ..."
Question:
What is the best way to do an insert of HTML that contains custom-control tags? (I already modified the RvHtmlImport to parse for and create custom controls, so the LoadHtml works fine)
Alternatively, what is the best way to get saving, loading and inserting of RVF to and from streams - including custom controls - working?
many thanks,
-- Lutz
save, load, insert custom controls to/from stream
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
1) About HTML insertion: load HTML in a hidden TRichView, then save the document using SaveRVFToStream and insert to the caret position using InsertRVFFromStreamEd. RichViewActions do it in this way.
2) About RVF loading problems. Call RegisterClass for class of each control that must be loaded from RVF.
2) About RVF loading problems. Call RegisterClass for class of each control that must be loaded from RVF.