Page 1 of 1
Changing paragraph variables for selected area
Posted: Mon Jul 16, 2012 5:14 pm
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.
Posted: Tue Jul 17, 2012 10:47 am
by Sergey Tkachenko
Use ApplyParaStyleConversion procedure and OnParaStyleConversion event.
See the demo in Demos\*\Editors\Editor 2\
Posted: Tue Jul 17, 2012 5:13 pm
by mjsmithsr
I had gotten that far but how do I set the actual values for the left indentation and the first line?
Posted: Wed Jul 18, 2012 5:40 pm
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.