<< Click to display table of contents >> TRVFootnoteItemInfo |
TRVFootnoteItemInfo is a class representing a footnote in TRichView documents. This is not a component. Objects of this class are created at runtime and appended to TRichView (see AddItem) or inserted into TRichViewEdit (see InsertItem). Style of this item type: rvsFootnote (-203)
Unit RVNote.
Syntax
TRVFootnoteItemInfo = class(TRVFootOrEndnoteItemInfo)
(introduced in version 10)
TObject
TPersistent
TRVNonTextItemInfo
TRVRectItemInfo
Numbering type for footnotes is defined in FootnoteNumbering property of TRVStyle component (NumberType property, inherited from TRVSeqItemInfo, is ignored).
You can enumerate all footnotes in documents using RVGetFirstFootnote and RVGetNextFootnote functions.
Use RVGetNoteTextStyleNo to assign TextStyleNo property (in the constructor).
Footnotes are numbered continuously in TCustomRichView. But when printing, footnote numbering can be restarted on each page, see FootnotePageReset property of TRVStyle component.
Limitation: footnote's Document must not be higher than the page height. Unlike endnotes, footnote is printed on a single page.
Use SetCurrentItemExtraIntPropertyEx and SetCurrentItemExtraStrPropertyEx to change properties of label items as editing operations.
This example inserts a new footnote in rveMain (TCustomRichViewEdit). TextStyleNo for this footnote is returned by RVGetNoteTextStyleNo function basing on the rveMain.CurTextStyleNo-th style).
Document for this footnote contains one reference (TextStyleNo for this reference is returned by RVGetNoteTextStyleNo function basing on the 0th style) and one space character of the 0th style.
var FootNote: TRVFootnoteItemInfo;
NoteRef: TRVNoteReferenceItemInfo;
begin
FootNote := TRVFootnoteItemInfo.CreateEx(rveMain.RVData,
RVGetNoteTextStyleNo(rvs, rveMain.CurTextStyleNo), 1, False);
NoteRef := TRVNoteReferenceItemInfo.CreateEx(FootNote.Document,
RVGetNoteTextStyleNo(rveMain.Style,0));
FootNote.Document.AddItem('', NoteRef);
FootNote.Document.AddNL(' ', 0, -1);
if rveMain.InsertItem('', FootNote) then
...
end;
The topic about TRVNoteReferenceItemInfo contains example showing how to edit Document.
Demos:
▪Demos\*\Editors\Notes