|
This invisible at run-time component is used for defining 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:
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; |
| ▪ | invokes property editor for TextStyles on double-click. |
Properties
Three main properties of RVStyle are:
RVStyle allows to set some colors for associated controls:
| ▪ | Color – background color; |
| ▪ | HoverColor – default color of hypertext links under the mouse pointer; |
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; |
Properties related to label items and item types inherited from them:
Other properties:
| ▪ | DefCodePage – default code page for internal ANSI <->Unicode conversion; |
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):
Events
Custom drawing:
| ▪ | OnStyleHoverSensitive – "should the component be repainted when user moves the mouse pointer over hyperlink of the given style?". |
|