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

Syntax

TRVStyle = class(TComponent)

Hierarchy

TObject

TPersistent

TComponent

Using

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.DeleteUnusedStyles;

TDBRichViewEdit.AutoDeleteUnusedStyles=True;

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.

invokes property editor for TextStyles on double-click.

Properties

Three main properties of RVStyle are:

TextStyles – collection of text styles (collection of TFontInfo);

ParaStyles – collection of paragraph styles (collection of TParaInfo);

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

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 color of selected text (with and without focus);

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

DisabledFontColor – text color for disabled controls.

HoverColordefault color of hypertext links under the mouse pointer;

CheckpointColorcolor of checkpoints (if visible);

CheckpointEvColorcolor of "RaiseEvent" checkpoints (if visible);

PageBreakColorcolor of explicit page breaks (if visible);

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

RVStyle allows to set cursors:

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

LineSelectCursorcursor for the left margin.

Tabs:

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.

Other properties:

SelectionStylevisual appearance of selection;

SelectionModemodes of selection;

DefUnicodeStyledefault Unicode text style;

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

LineWrapMode specifies a line wrapping algorithm;

UseSound.

Methods

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):

SaveCSS;

SaveCSSToStream.

Events

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?".


RichView © Sergey Tkachenko