rvico TRichView Reference | TRVStyle

RVStyle TRVStyle

Properties   Methods   Events

Top  Previous  Next

This invisible at run-time component is used for defining a visual appearance of RichView and its descendant components.

Unit RVStyle


TRVStyle = class(TComponent)






If you want to display some document in RichView, associate this RichView with some RVStyle component: create TRVStyle component and assign it to the Style property of RichView. You can do it at design-time using the the Object Inspector.

The same RVStyle object can be used by several RichView, RichViewEdit, DBRichView, DBRichViewEdit controls.

But if you use the following:



TCustomRichView.LoadRVF, LoadRVFFromStream, and RVFTextStylesReadMode or RVFParaStylesReadMode <> rvf_sIgnore;

TDBRichView or TDBRichViewEdit, and RVFTextStylesReadMode or RVFParaStylesReadMode <> rvf_sIgnore

you must use one RVStyle for one RichView.

Design-Time Component Editor

TRVStyle has a design-time component editor (unit RVSEdit). This editor:

adds 3 items into the context menu for component:"Edit Text Styles", "Edit Paragraph Styles", "Edit List Styles" which invoke property editors for TextStyles, ParaStyles, or ListStyles;

adds "Convert to twips" or "Convert to pixels" item in the context menu, allowing to convert all RVStyle properties measured in Units.

adds 3 items into the context menu for component:"Edit Style Templates", "Save Style Templates...", "Load Style Templates..." which invoke property editors for StyleTemplates, save them to a file, and load them from a file.

invokes property editor for TextStyles on double-click.


Three main properties of RVStyle are:

TextStyles – collection of text attributes (styles), a collection of TFontInfo items;

ParaStyles – collection of paragraph attributes (styles), a collection of TParaInfo items;

ListStyles – collection of paragraph list styles (bullets and numbering), a collection of TRVListInfo items.

Style templates ("real" styles)

StyleTemplates – collection of "real" styles, controlling properties of TextStyles and ParaStyles;

MainRVStyle allows using a single StyleTemplates in multiple RVStyle components.

Units of measurement

Units defines measure units for properties of this component and documents in linked controls.

RVStyle allows to set some colors for associated controls:

Colorbackground color;

SelColor, InactiveSelColorbackground colors of selected text (with and without focus);

SelTextColor, InactiveSelTextColorcolors of selected text (with and without focus);

DisabledFontColor – text color for disabled controls.

HoverColordefault color of hypertext links under the mouse pointer;

CheckpointColor, CheckpointEvColorcolors of checkpoints (if visible);

PageBreakColorcolor of explicit page breaks (if visible);

FloatingLineColor – color of placeholders for left- and right-aligned items (if visible).

GridColor, GridReadOnlyColor – colors of table grid lines (if visible); GridStyle, GridReadOnlyStyle define their pen styles.

RVStyle allows to set cursors:

JumpCursorhypertext cursor for hotspots and hot-pictures (and default cursor for text hypertext items);

LineSelectCursorcursor for the left margin.


SpacesInTabIf positive, Add*** methods of RichView, methods for loading text and RTF, keyboard input will replace tab characters with the specified number of spaces. If 0 (default), a special tabulator item type is used;

DefTabWidthdefault distance between tab stops.

Properties related to label items and item types inherited from them:

FieldHighlightColor – color for highlighting label items.

FieldHighlightType specifies when to highlight label items.

FootnoteNumbering – numbering type for footnotes.

FootnotePageReset – numbering mode for footnotes.

EndnoteNumbering – numbering type for endnotes.

SidenoteNumbering – numbering type for sidenotes.

Properties related to selection:

SelectionStylevisual appearance of selection;

SelectionModemodes of selection;

SelectionHandleKindvisual appearance of touch screen selection handles;

SelColor, InactiveSelColorbackground colors of selected text (with and without focus);

SelTextColor, InactiveSelTextColorcolors of selected text (with and without focus).

Other properties

TextEngine specifies which API is used for drawing and measuring text;

FontQuality – font quality and anti-aliasing;

DefUnicodeStyledefault Unicode text style;

DefCodePagedefault code page for internal ANSI <->Unicode conversion;

LineWrapMode specifies a line wrapping algorithm;



You can save and load all information in RVStyle in ini-file:

SaveINI saves RVStyle properties in ini-file;

LoadINI loads RVStyle properties from ini-file;

or registry:

SaveReg saves RVStyle properties in ini-file;

LoadReg loads RVStyle properties from ini-file.

You can export styles in style sheet (for saving HTML files):



You can search for a style with the specified properties:

FindTextStyle, FindParaStyle


Custom drawing:

OnDrawCheckpointdrawing checkpoint;

OnDrawPageBreakdrawing page break;

OnDrawParaBack – drawing background of paragraph;

OnDrawTextBack – drawing background of text;

OnApplyStyleapplying text style to Canvas;

OnApplyStyleColorapplying text style color to Canvas;

OnDrawStyleTextdrawing text of the given style;

OnStyleHoverSensitive"should the component be repainted when user moves the mouse pointer over hyperlink of the given style?".

TRichView © trichview.com