rvico TRichView Reference | TRVStyle | TCustomRVFontInfo

TCustomRVFontInfo.Protection

Top  Previous  Next

Protects text of this style from specific operations in editor.

property Protection: TRVProtectOptions;

 

type

  TRVProtectOption = 

    (rvprStyleProtect, rvprStyleSplitProtect,

     rvprModifyProtect,

     rvprDeleteProtect, rvprConcateProtect,

     rvprRVFInsertProtect, rvprDoNotAutoSwitch,

     rvprParaStartProtect, 

     rvprSticking, rvprSticking2, rvprSticking3,

     rvprStickToTop, rvprStickToBottom);

  TRVProtectOptions = set of TRVProtectOption;

Used in RichViewEdit. Text of this style has special behavior when editing.

General Protection Options

Option

Meaning

rvprStyleProtect

Protects text from changing style with ApplyTextStyle, ApplyTextStyleTemplate, ApplyStyleTemplate. This protection is ignored by ApplyStyleConversion, but you can take it into account manually in OnStyleConversion event.

rvprStyleSplitProtect

Protects from applying text style to the part of text item.

ApplyTextStyle and ApplyStyleConversion methods apply new style to the whole item having this protection, even if it is selected only partially.

rvprModifyProtect

Protects text items of this style from modification, but does not protect from deleting as a whole.

rvprDeleteProtect

Protects text items of this style from deletion as a whole, but does not protect from modification.

Normally, this option blocks all operations deleting the last character of the protected text item. But if EmptyWidth > 0, all characters can be deleted, but the item is not deleted.

See also: rvepDeleteProtect item property.

rvprConcateProtect

Protects texts items from concatenation with adjacent item of the same style.

rvprRVFInsertProtect

If set, items of this style will not be inserted when inserting RVF. Affects methods introduced in editor only (InsertRV***Ed, pasting).

rvprDoNotAutoSwitch

If set, editor never switches the current text style to this one automatically.

If this style was made current by the user (by assigning CurTextStyleNo property), the editor switches back to another (previously used) style after the first performed operation.

rvprParaStartProtect

Disallows moving text item of this style to/from new line; blocks  Enter  key when the caret is in text of this style.

Sticking

Option

Meaning

rvprSticking

Disallows insertion between two text items having this protection (allows to stick together several text items of different text styles).

rvprSticking2

The same.

rvprSticking3

The same.

rvprStickToTop

Disallows insertion before the text of this style, if this text is a first document item.

rvprStickToBottom

Disallows insertion after the text of this style, if this text is a last document item.

rvprSticking, rvprSticking2, and rvprSticking3 allow to create several groups of stuck items. It's not possible to insert something between items having the same protection option, but it's possible to insert between items having different options, for example rvprSticking and rvprSticking2. In addition to these options, you can use OnCheckStickingItems event.

Note:

TFontInfo.SingleSymbols property is removed in version 1.3. When loading forms saved with an older version, or when loading styles from ini-files or registry, SingleSymbols=True is converted to Protection=[rvprStyleProtect, rvprDoNotAutoSwitch].

Default value:

[]

See also:

Options of paragraph style;

EmptyWidth property

Demo projects:

Demos\Delphi\Assorted\Fields\

Demos\CBuilder\Assorted\Fields\


TRichView © trichview.com