rvico TRichView Reference | TRVStyle | TFontInfos

TFontInfos.FindSuchStyle, FindSuchStyleEx

Top  Previous  Next

Searches for a style.

function FindSuchStyle(BaseStyle: Integer; Style: TFontInfo;

  Mask: TRVFontInfoProperties): Integer;

function FindSuchStyleEx(BaseStyle: Integer; Style: TFontInfo;

  Mask: TRVFontInfoProperties): Integer;

(Introduced in version 1.3 and version 14)

Searches for a style having properties like Style.

The BaseStyle-th style is checked first. BaseStyle is an index in Items.

Mask is a set of properties to compare (other properties are ignored). Use RVAllFontInfoProperties constant to compare all properties.

The following properties are ignored when comparing styles:

Standard;

StyleName (if RichViewCompareStyleNames=False (default)).

If FindSuchStyle cannot find the desired style, it returns -1.

If FindSuchStyleEx cannot find the desired style, it adds a new style to the end of Items, assigns properties of Style to this new item, sets its Standard=False, returns the index of this new item.

Return value:

Index of the found style; FindSuchStyle returns -1 if not found.

See also:

other TFontInfos.Find*** methods;

TRVStyle.FindTextStyle;

TFontInfo.IsEqual;

TParaInfos.FindSuchStyle;

TRVListInfos.FindSuchStyle.

Demos:

Demos\Delphi\Editors\Editor 2\

Demos\CBuilder\Editors\Editor 2\

(see procedure TForm1.rveStyleConversion, rve.OnStyleConversion event)


TRichView © trichview.com