<< Click to display table of contents >> New in v3.0 |
Related to header and footer
Previously, TSRichViewEdit control contained only one RichViewEdit control (RichViewEdit). Now, there are three of them: RichViewEdit, RVHeader and RVFooter. All of them can be edited. All editing operations must be applied to ActiveEditor, not RichViewEdit. However, file saving and loading operations still must be called for RichViewEdit.
Before loading a file, you need to clear not only RichViewEdit, but also header and footer (loading RVF or RTF does it automatically, but loading text does not).
After loading a file, you need to format all editors:
SRichViewEdit1.RVHeader.Clear;
SRichViewEdit1.RVFooter.Clear;
SRichViewEdit1.RichViewEdit.Clear;
SRichViewEdit1.RichViewEdit.LoadRTF(FileName);
SRichViewEdit1.RVHeader.Format;
SRichViewEdit1.RVFooter.Format;
SRichViewEdit1.SetRVMargins;
(update: in newer version, you can use a simpler code:
SRichViewEdit1.Clear;
SRichViewEdit1.RichViewEdit.LoadRTF(FileName);
SRichViewEdit1.Format;
update 2: since version 6, you must use TSRichViewEdit.Clear and TSRichViewEdit.Format)
)
Alternatively, you can hide header and footer using TSRVPageProperty's HeaderVisible and FooterVisible properties.
The following events have TRichViewEdit control in Sender parameter: OnCurTextStyleChanged, OnCurParaStyleChanged, OnCaretMove (previously, it was TSRichViewEdit). Now all events of TNofifyEvent type have RichViewEdit in Sender parameter, so you can distinguish if it was called from RichViewEdit, RVHeader or RVFooter.
In the new version, ConvertRVToSRV, ConvertSRVToRV, GetCurrentLineCol methods work for ActiveEditor instead of RichViewEdit.
Formatting
A new text formatting procedure is used, so existing documents may look not exactly like before.
The following properties of TSRVViewProperty are renamed:
•BoundTextPen MarginsPen
•BoundTextVisible MarginsRectVisible
Two new properties of TSRichViewEdit control return TRichViewEdit controls used for editing/displaying header and footer: RVHeader, RVFooter.
ActiveEditor returns the currently edited control (see the compatibility issues above). OnChangeActiveEditor event occurs when it changed.
New properties of TSRVPageProperty:
New properties of TSRVViewProperty:
•HeaderTitle, FooterTitle
•HeaderTitleFont, FooterTitleFont
•HeaderTitleColor, FooterTitleColor
New properties and methods of TSRichViewEdit:
•SkinManager, HScrollBarSchemeIndex, VScrollBarSchemeIndex
•new optional parameter in SetRVMargins
New properties of TSRVBackgroundProperty:
Headings
•FindNextHeading/FindPriorHeading search for headings.
•NextCurHeading/PriorCurHeading move the caret to the next/previous heading.