|
TRichView is a control for displaying documents with pictures, tables, Delphi controls and hyperlinks.
Unit RichView;
Syntax
TCustomRichView = class(TRVScroller)
TRichView = class(TCustomRichView)
TRichView does not display its content if it is not linked to TRVStyle component via Style property.
The most important property settings can be done in the component editor for TRichView. In Delphi (C++Builder) IDE, right click the RichView object on the form, choose "Settings" in the context menu.
Hierarchy
TObject
TPersistent
TComponent
TControl
TWinControl
TCustomControl
TRVScroller
TCustomRichView
List of properties, events and methods
grouped in several categories (some entries can be in several groups)
General properties
| ▪ | Style – link to RVStyle component defining a lot of properties which can be used in several RichViews; |
| ▪ | ItemCount – number of items in the document. |
Properties defining background
Appending items (Add*** methods)
Main methods for appending items:
| ▪ | AddNL adds one text item; |
| ▪ | AddHotspotEx adds hotspot (image from ImageList - hypertext link); |
| ▪ | AddItem – general method for appending items (usually used for tables); |
"Tagged" analogs of the methods above (Add***Tag methods) (the same methods, but have additional Tag parameter):
Additional methods for appending items:
| ▪ | Add adds one text item in last paragraph; |
| ▪ | AddFmt adds one formatted string assembled from a Pascal format string and an array arguments; |
"Tagged" analogs of the methods above:
Also
See also
Hypertext
| ▪ | event OnJump occurs when user clicks hyperlink; |
| ▪ | event OnRVMouseMove occurs when mouse pointer moves over hyperlink; |
| ▪ | property FirstJumpNo – use to set hypertext id for the first hypertext item; |
| ▪ | GetJumpPointY returns Y coordinate of item with the specified hypertext id. |
Scrolling, margins and sizes
Properties:
| ▪ | MinTextWidth – minimal width for word wrapping (minimal width of scrollable area, not including margins); |
| ▪ | VAlign – vertical alignment of document; |
| ▪ | VSmallStep – number of pixels in one step of vertical scrollbar; |
| ▪ | MaxLength – maximal count of characters per line; |
| ▪ | WordWrap allows to disable word wrapping; |
| ▪ | Tracking – whether RichView repaints while its scrollbar thumb tab is dragged with the mouse. |
Methods:
Events:
| ▪ | OnVScrolled occurs when document is scrolled vertically |
| ▪ | OnHScrolled occurs when document is scrolled horizontally |
Also:
Methods for working with selection and the Clipboard
| ▪ | Copy copies selection to the Clipboard in all available formatsl |
| ▪ | CopyDef copies selection to the Clipboard using formats specified in Options; |
| ▪ | CopyImage copies selected image to the Clipboard; |
| ▪ | CopyText copies selection as text to the Clipboard; |
| ▪ | CopyTextW copies selection to the Clipboard as Unicode text; |
| ▪ | CopyRVF copies selection as RVF to the Clipboard; |
| ▪ | CopyRTF copies selection as RTF (Rich Text Format); |
| ▪ | SelectAll selects the whole document for copying to the Clipboard; |
| ▪ | Deselect clears selection (not contents, but bounds); |
| ▪ | event OnSelect occurs when selection bounds are changed; |
| ▪ | event OnCopy allows to copy selection to the Clipboard in custom formats. |
Properties, methods and events for loading and saving RVF
Properties:
| ▪ | RVFWarnings describes warnings or errors occurred during the last reading of RVF. |
Events:
| ▪ | OnRVFControlNeeded requests inserted control when reading RVF, if RVF was saved without controls' "bodies"; |
| ▪ | OnRVFPictureNeeded requests image when reading RVF, if RVF was saved without images' "bodies". |
Methods:
| ▪ | SaveRVF saves document or selection as RVF to the file; |
| ▪ | CopyRVF copies selection as RVF to the Clipboard; |
| ▪ | AppendRVFFromStream appends RVF from the stream using the specified paragraph style for the first RVF item. |
Also:
Other saving and loading
Methods:
| ▪ | LoadTextW appends text from the file in Unicode encoding; |
| ▪ | SaveHTML saves the document in the HTML file; |
| ▪ | SaveHTMLEx saves the document in the HTML file using CSS; |
| ▪ | SaveText saves the document in the text file; |
| ▪ | SaveRTF saves the document (or selection) in the RTF file; |
Properties:
Events:
| ▪ | OnSaveItemToFile allows to save any item in RTF, HTML or text files in your own format; |
| ▪ | OnImportPicture allows custom processing of external images when importing RTF. |
Information about items (Get***Info methods)
| ▪ | GetItem – general method for obtaining items (usually used for tables); |
| ▪ | IsParaStart returns "is this item a first item in paragraph?"; |
| ▪ | IsFromNewLine returns "is this item a first item in paragraph?"; |
| ▪ | GetItemPara returns an index of paragraph containing a specified item; |
| ▪ | GetItemNo returns item index for object representing item (usually used for tables); |
| ▪ | GetItemCoords returns coordinates of item relative to document area; |
Modifying items (Set***Info methods)
Working with checkpoints
Obtaining checkpoint data:
| ▪ | event OnCheckPointVisible occurs when checkpoint (or "section", marked by this checkpoint) becomes visible as a result of vertical scrolling; |
Extracting properties from checkpoint data:
Also:
See also methods for obtaining information about items and for modifying document.
Mouse events
See also hypertext events.
Live spelling check
Picture animation
Properties:
Methods:
Unicode
| ▪ | AddNLATag adds one text item in ANSI encoding; |
| ▪ | AddNLWTag adds one text item in Unicode encoding; |
| ▪ | AddTextNLW adds one or more text items in Unicode encoding; |
| ▪ | CopyTextW copies selection to the Clipboard as Unicode. |
Working in palette mode
Others
Properties:
| ▪ | RVData – object representing document; |
| ▪ | TabNavigation sets mode for navigation through hypertext links and controls; |
| ▪ | NoteText – text for references to parent notes. |
Methods:
| ▪ | GetWordAt returns a word at the specified point; |
| ▪ | DeleteParas deletes the specified range of paragraphs, updates the document; |
| ▪ | GetLineNo returns line number in the specified position; |
Events:
Obsolete properties and methods:
AddBullet, AddCenterLine, AddControl, AddFromNewLine, AddHotspot, AddNamedCheckPoint, AddPicture, AllowSelection, AddText, AddTextFromNewLine, LineCount, SingleClick.
|