|
<< Click to display table of contents >> TCustomRichView.DocObjects |
A collection of objects that can be stored in RVF files or streams.
type // defined in RVDocParams unit
TRVDocObjectCollection = class (TOwnedCollection);
TRVDocObject = class (TCollectionItem);
property DocObjects: TRVDocObjectCollection;
(introduced in version 17)
TRVDocObjectCollection is a collection of items inherited from TRVDocObject. Items of this collection may have different type.
All published properties of items can be saved and loaded.
If rvfoSaveDocObjects is in RVFOptions, these objects are saved in RVF.
If rvfoLoadDocObjects is in RVFOptions, methods for loading RVF load these objects. Methods for inserting RVF ignore these objects.
Method TRichView.Clear clears DocObjects.
There is one more property allowing to save custom data in RVF: DocProperties.
▪TRVMathDocObject defines default properties for items displaying mathematical expressions.
▪TRVSVGPathsDocObject contains a collection of named SVG paths for use in ReportWorkshop.
▪TRVReportDocObject (implemented in ReportWorkshop) has properties controlling report generation for a document.
Define your own classes:
type
TMyDocObjectA = class (TRVDocObject)
...
published
property A: String ...
end;
TMyDocObjectB = class (TRVDocObject)
...
published
property B: Integer ...
end;
Adding:
var
ObjA: TMyDocObjectA;
ObjB: TMyDocObjectB;
...
ObjA := TMyDocObjectA.Create(MyRichView.DocObjects);
ObjA.A := 'Hello';
ObjB := TMyDocObjectB.Create(MyRichView.DocObjects);
ObjB.B := 1;
How to save to RVF: include rvfoSaveDocObjects in RVFOptions.
How to load from RVF: include rvfoLoadDocObjects in RVFOptions.
See also methods for saving RVF (they can save this property):
▪SaveRVF;
See also methods for loading RVF (they can load this property):
▪LoadRVF;
See also methods of TRichViewEdit for inserting RVF in the caret position (they ignore this property):
▪PasteRVF.
See also methods for inserting RVF (they ignore this property):
See also properties:
See also:
▪Saving and loading RichView documents;
▪RVF.