|
|
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) HierarchyTObject TPersistent TComponent UsingIf 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 EditorTRVStyle 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. PropertiesThree 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: ▪Color – background color; ▪SelColor, InactiveSelColor – background color of selected text (with and without focus); ▪SelTextColor, InactiveSelTextColor – color of selected text (with and without focus); ▪DisabledFontColor – text color for disabled controls. ▪HoverColor – default color of hypertext links under the mouse pointer; ▪CheckpointColor – color of checkpoints (if visible); ▪CheckpointEvColor – color of "RaiseEvent" checkpoints (if visible); ▪PageBreakColor – color of explicit page breaks (if visible); ▪FloatingLineColor – color of placeholders for left- and right-aligned items (if visible). RVStyle allows to set cursors: JumpCursor – hypertext cursor for hotspots and hot-pictures (and default cursor for text hypertext items); LineSelectCursor – cursor for the left margin. Tabs: ▪SpacesInTab – If 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; ▪DefTabWidth – default 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: ▪SelectionStyle – visual appearance of selection; ▪SelectionMode – modes of selection; ▪DefUnicodeStyle – default Unicode text style; ▪DefCodePage – default code page for internal ANSI <->Unicode conversion; ▪LineWrapMode specifies a line wrapping algorithm; ▪UseSound. MethodsYou 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; EventsCustom drawing: ▪OnDrawCheckpoint – drawing checkpoint; ▪OnDrawPageBreak – drawing page break; ▪OnDrawParaBack – drawing background of paragraph; ▪OnDrawTextBack – drawing background of text; ▪OnApplyStyle – applying text style to Canvas; ▪OnApplyStyleColor – applying text style color to Canvas; ▪OnDrawStyleText – drawing text of the given style; ▪OnStyleHoverSensitive – "should the component be repainted when user moves the mouse pointer over hyperlink of the given style?". |