font TrvActionFontEx

Properties

Top  Previous  Next

TrvActionFontEx is the action for "Font" command. It uses an advanced font dialog.

Unit RichViewActions;

Syntax

TrvActionFontEx = class(TrvActionFonts)

hmtoggle_arrow1Hierarchy

Description

If UserInterface=False, the action applies its properties to the selected text. The list of properties to apply is specified in ValidProperties.

If UserInterface=True, the action displays a font dialog (initialized with font properties of the selected text), assigns the chosen font to the action's properties, and then applies these properties to the selected text.

For example, if you want to apply {"Arial", 12, not bold, dotted underline} to the selected text in RichViewEdit1:

    with rvActionFontEx1 do begin

      UserInterface := False;

      ValidProperties := [rvfimFontName, rvfimSize, rvfimBold, rvfimUnderline, rvfimUnderlineType];

      Font.Name := FontName;

      Font.Size := 12;

      Font.Style := [fsUnderline];

      UnderlineType := rvutDotted;

      ExecuteTarget(RichViewEdit1);

      UserInterface := True;

    end;

See also:

TrvActionFonts


RichViewActions © trichview.com