Changing paragraph variables for selected area

General TRichView support forum. Please post your questions here
Post Reply
mjsmithsr
Posts: 5
Joined: Sat Apr 18, 2009 7:57 pm
Location: Fountain Hills, AZ USA
Contact:

Changing paragraph variables for selected area

Post by mjsmithsr »

How do I change the formatting variables for paragraphs by assigning values through my program rather than through rvActionsResource.rvActionParagraph1? I want to be able to set the variables without forcing the user to enter the changes via the dialog.
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Use ApplyParaStyleConversion procedure and OnParaStyleConversion event.
See the demo in Demos\*\Editors\Editor 2\
mjsmithsr
Posts: 5
Joined: Sat Apr 18, 2009 7:57 pm
Location: Fountain Hills, AZ USA
Contact:

Post by mjsmithsr »

I had gotten that far but how do I set the actual values for the left indentation and the first line?
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

This demo has commands for increasing and decreasing the left indent: PARA_INDENTINC and PARA_INDENTDEC.
They are implemented in TForm1.rveParaStyleConversion in the following way:

Code: Select all

  PARA_INDENTINC:
        begin
          ParaInfo.LeftIndent := ParaInfo.LeftIndent+20;
          if ParaInfo.LeftIndent>200 then
            ParaInfo.LeftIndent := 200;
        end;
      PARA_INDENTDEC:
        begin
          ParaInfo.LeftIndent := ParaInfo.LeftIndent-20;
          if ParaInfo.LeftIndent<0 then
            ParaInfo.LeftIndent := 0;
        end;
You can implement similar commands for assigning specific values to ParaInfo.LeftIndent and ParaInfo.FirstIndent.
Post Reply