rvico TRichView Reference | TDBRichViewEdit

DBRichViewEdit TDBRichViewEdit

Properties   Methods   Events

Top  Previous  Next

Use TDBRichView to edit hypertext documents stored in database field.

Unit DBRV;

Syntax

TDBRichViewEdit = class(TCustomRichViewEdit)

DBRichViewEdit does not display or edit its content if it is not linked to RVStyle 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 DBRichViewEdit object on the form, choose "Settings" in the context menu. If you decide to choose "Allow adding styles dynamically" mode, please set AutoDeleteUnusedStyles to True.

If the application doesn't require the data-aware capabilities of TDBRichViewEdit, use TRichViewEdit instead, to conserve system resources.

If the application doesn't require the editing capabilities of TDBRichViewEdit, use TDBRichView instead, to conserve system resources.

Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TRVScroller

TCustomRichView

TCustomRichViewEdit

Field Type

This component must be linked to BLOB field.

If you use RVF (RichView Format), the database field must have binary BLOB type (i.e. must have ability to store arbitrary binary data, without conversion and filtering of characters). For example, in Paradox Tables it is "Binary", in Microsoft Access tables it is "OLE Object".

You can also use text BLOB field type (memo). Memo fields cannot store binary data, so it is impossible to store documents in RVF format in them (unless you exclude rvfoSaveBinary from RVFOptions).

However, you can use memo fields:

to display text or RTF (Rich Text Format) fields,

to display text mode RVF  (that was saved with rvfoSaveBinary excluded from RVFOptions).

Starting from Delphi 2006, Unicode memo fields (Field.DataType=ftWideMemo) are supported specially. TDBRichView does not attempt loading RVF from these fields. It tries to load Unicode RTF (RTF code converted from String to WideString) or Unicode text from them.

If rvfoLoadBack is in RVFOptions and FieldFormat=rvdbRVF, the component clears BackgroundBitmap before loading data from the field.

Supported Data Formats

The supported field formats are:

RVF (RichView Format),

RTF (Rich Text Format),

text,

others (using events).

For all field types except for Unicode memos:

1.OnLoadCustomFormat event occurs.

2.If this event is not processed, TDBRichView tries to load RVF.

3.If the field does not contain RVF, it tries to load RTF.

4.If the field does not contain RTF, it loads plain ANSI text.

For Unicode memos:

1.OnLoadCustomFormat event occurs.

2.If this event is not processed, TDBRichView tries to load Unicode RTF (RTF code stored as WideString).

3.If the field does not contain RTF, it loads plain Unicode text.

Saving data to the field:

OnSaveCustomFormat event allows saving data in your own format. If this event is not processed, documents are saved in FieldFormat.

Events

OnNewDocument event occurs when creating a new document or before loading an existing one from the field.

When the document is loaded from the field, OnLoadDocument occurs.

OnLoadCustomFormat and OnSaveCustomFormat allow saving and loading documents in custom formats.

Examples

Example 1: Using viewer-style methods in DBRichViewEdit (such as LoadRTF)

Example 2: Inserting controls what can modify themselves in DBRichViewEdit (for example, inserting TEdit; user can modify its text)


TRichView © trichview.com