srichviewedit TSRichViewEdit

Properties   Methods   Events  | Overview

<< Click to display table of contents >>

srichviewedit TSRichViewEdit

Properties   Methods   Events  | Overview

TSRichViewEdit is a word processing component.

Unit SclRView.

Syntax

TSRichViewEdit = class(TCustomControl);

Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

Description

The main features of the component are:

zooming;

WYSIWYG mode;

real-time repagination;

displaying and printing in different formats (e.g. the document in A5 format can be printed in A3 format);

free positioning of page on the screen (optional);

variety of document view modes (web mode, draft mode, page view mode, etc.).

hint on scrolling containing page number and a short text;

vertical and horizontal lines of buttons in the scroll bar area.

Properties

Main properties

RichViewEdit returns a TRichViewEdit control used to render a document. Use properties and methods of this control to modify document or get information about it. By default, RichViewEdit uses auto-created TRVStyle object. If you want to use an external TRVStyle component, use ExternalRVStyle property.

Other editors are used to render different parts of document:

RVHeader for page header;

RVFooter for page footer;

RVNote for notes and text boxes.

The active editor is returned in ActiveEditor property. Additional information about different part of documents is available in overview.

Properties related to page attributes are available in PageProperty.

Properties related to viewing modes are available in ViewProperty.

Properties related to background are available in BackgroundProperty.

Properties related to page arrangement inside the component window are available in PagePosProperty.

Properties related to line numbering are available in LineNumberProperty.

Properties related to a read-mode are available in ReadModeProperty.

Quick access to properties of RichViewEdit

The following properties provide access to properties of RichViewEdit of the same name (some of these properties are applied to ActiveEditor or to all editors, see more information in the topics about these properties):

AnimationMode

BiDiMode

CPEventKind

ReadOnly

RTFOptions

RTFReadProperties

RVBackgroundBitmap (access to BackgrounBitmap)

RVBackgroundStyle (access to BackgrounStyle)

RVColor (access to Color)

RVEditorOptions (access to EditorOptions)

RVFOptions

RVFParaStylesReadMode

RVFTextStylesReadMode

RVOptions (access to Options)

SmartPopupProperties, SmartPopupVisible

TabNavigation

UseStyleTemplates, StyleTemplateInsertMode.

These properties (except for a public property SmartPopupVisible) can be used to assign values at design time.

Scrolling

HScrollPos (0..HMaxScrollPos) and VScrollPos (0..VMaxScrollPos) allow getting/setting the scrolling positions.

HScrollBar and VScrollBar hide/show scrollbars.

OnHScrolled and OnVScrolled events occur on scrolling.

ScrolledPage returns the index of the first visible page.

Menus (toolbars) in the scrollbar area

MenuHButtons and MenuHorizontal define properties of horizontal menu.

MenuVButtons and MenuVertical  define properties of vertical menu.

Skins

Skins can be applied to scrollbars. Skins are linked using SkinManager property. HScrollBarSkinSchemeIndex and HScrollBarSkinSchemeIndex are used to specify skin schemes for scrollbars.

Converted properties of PageProperty

Some properties return layout-related properties of PageProperty converted to screen pixels and scaled according to ViewProperty.ZoomPercent:

LeftMarginPix, TopMarginPix, RightMarginPix, BottomMarginPix

PageHeightPix, PageWidthPix

Menus (toolbars) in scrollbars areas

Buttons are defined in MenuHButtons and MenuVButtons. Properties of menus are defined in MenuHorizontal and MenuVertical.

See also events below.

Methods

Coordinates

ConvertRVToSRV and ConvertSRVToRV allow translating coordinates between this TSRichViewEdit control and RichViewEdit.

GetPageClientRect returns the position of page, GetItemBounds returns the position of item in the page. The page is returned by GetItemPages.

GetCaretPosInUnits returns the caret position on the page.

GetPageAt returns the page at the specified coordinates, GetItemAt returns the item at the specified coordinates.

UnitsPerInchH and UnitsPerInchV allow converting coordinates from units to units.

Finding items

FindNextHyperlink/FindPriorHyperlink, FindNextCheckpoint/FindPriorCheckpoint, FindNextItem/FindPriorItem, FindNextHeading/FindPriorHeading search for hyperlinks, checkpoints, items, headings.

NextCurHyperlink/PriorCurHyperlink, NextCurCheckpoint/PriorCurCheckpoint, NextCurItem/PriorCurItem select the next/previous hyperlink, item with checkpoint, item.

NextCurHeading/PriorCurHeading moves the caret to the next/previous heading.

By default, the search is performed in the whole document. But you can search in the specified range of vertical coordinates, see RangeSearch property.

FirstCurPage, PriorCurPage, NextCurPage, LastCurPage moves the caret to the beginning of the first/previous/next/last page.

Printing

You can print the whole document (PrintAll), the current page (PrintCurrent) or a range of pages (PrintRange).

With MinPrintedItemNo and MaxPrintedItemNo you can define a subrange of items for printing. Items outside of this range are not printed (but places are still reserved for them). Using these properties, you can implement an incremental printing: when the next portion of the document is ready, you can print it below the previously printed fragment.

Drawing on external canvas

DrawPage/DrawMetafile draws page onto the specified canvas/metafile.

Scrolling

ScrollToCaret/ScrollToItem makes the caret/item visible.

GetFirstItemVisibleRV returns the first visible item.

Footnotes and endnotes

Call StartEditNote to edit a footnote/endnote, call ReturnToNote to finish editing.

Additional information can be found in overview.

Events

The most of TSRichViewEdit events provides access to RichViewEdit's events of the same names.

Events on changing properties

OnPageFormatChanged occurs when PageProperty.PageFormat is changed.

OnChangeViewModeAfter and OnChangeViewModeBefore occur when ViewProperty.ViewMode is changed.

OnZoomChanged occurs when ViewProperty.ZoomPercent or .ZoomMode are changed. OnZoomViewChanged occurs when other properties of ViewProperty related to zooming are changed.

Events on scrolling, clicking and caret moving

OnHScrolled, OnVScrolled, OnPageScrolled occur on scrolling.

OnCurrentPageChange occurs when the caret is moved to another page.

OnPageCountChanged occurs when the count of pages is changed.

OnClickPage occurs when the user clicked on the page.

Database

The following items occurs if Document property is linked to a database field using LiveBindings, or in inherited TDBSRichViewEdit component.

OnNewDocument occurs when creating or before loading

OnLoadDocument occurs after loading

OnSaveCustomFormat, OnLoadCustomFormat allow storing data in DB in custom format.

Custom drawing

In addition to custom drawing events of TRVStyle, you can use OnPaintPage for drawing on page, OnPaintComponent for drawing inserted controls, and OnPaint for drawing something else.

Inserted controls

OnPaintComponent allows drawing inserted controls (useful if the default procedure cannot draw them properly).

OnCheckControl allows enumerating all inserted controls.

OnMessageControl allows responding on messages from inserted controls.

Free page position and ordering

OnGetPagePos allows defining position, zooming and Z-order of pages

Menus (toolbars) in scrollbars areas

OnHMenuClickButton and OnVMenuClickButton occur when the user clicked a button.

OnHMenuEnterButton and OnVMenuEnterButton occur when the mouse pointer is above a button.

Table "icons"

When the user moves the mouse pointer above some table, a special icon is displayed at the top left corner of this table (if ViewProperty.UseTableIcons=True).

This icon is displayed for some time (specified in ViewProperty.TableIconDelay) after the mouse pointer leaves this table.

When the user clicks on this icon, OnTableIconClick occurs.