Changing variables

General TRichView support forum. Please post your questions here
Ceprotec
Posts: 259
Joined: Thu Oct 28, 2010 6:09 pm
Contact:

Post by Ceprotec »

Thank you very much!! :D

just one more question:

I use this command to insert variables:
SRichViewEdit1.RichViewEdit.CurTextStyleNo: = 6;
SRichViewEdit1.RichViewEdit.InsertText ('{name} ', False);
SRichViewEdit1.RichViewEdit.SetFocus;

6 The style is to be locked in variable text and will not change.
but when the text is changed, ie, the variable receives its value, the text remains locked. I tried using RVStyle1.ResetTextStyles, but stayed with letters, fonts, colors, very different. The same way I have the style 6, would like to format all text to the style of 0, which would normal text. how to do this?
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

You can call this procedure to remove all protection:

Code: Select all

for i := 0 to SRichViewEdit1.RichViewEdit.Style.TextStyles.Count-1 do
  SRichViewEdit1.RichViewEdit.Style.TextStyles[i].Protection := [];
Ceprotec
Posts: 259
Joined: Thu Oct 28, 2010 6:09 pm
Contact:

Post by Ceprotec »

Very Nice!!

Thank you Sergey :D
Ceprotec
Posts: 259
Joined: Thu Oct 28, 2010 6:09 pm
Contact:

Post by Ceprotec »

The code you gave me using:

FillFields (SRichViewEdit1.RichViewEdit.RVData, SRichViewEdit1, 1);
SRichViewEdit1.Format;

worked just fine. but it does not alter the header or the footer. I used then:

FillFields (SRichViewEdit1.RVFooter.RVData, SRichViewEdit1, 1);
SRichViewEdit1.Format;

and

FillFields (SRichViewEdit1.RVHeader.RVData, SRichViewEdit1, 1);
SRichViewEdit1.Format;

but the error: List index out of bouds (61).
this line: "if RVData.GetItemStyle (i) = rvsTable then begin"

There are how to resolve this so they can change the variables of the header and footer?
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

For RVHeader and RVFooter, use your old version of FillFields.
Ceprotec
Posts: 259
Joined: Thu Oct 28, 2010 6:09 pm
Contact:

Post by Ceprotec »

ok, I can use FillFields old. But it would have somehow to get the headers of the pages to be independent? as if a page had a headline and I could change the header on page 2 without changing the first. as if making a break header?
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Unfortunately, the current version of TSRichViewEdit does not support different headers/footers for different pages.
Ceprotec
Posts: 259
Joined: Thu Oct 28, 2010 6:09 pm
Contact:

Post by Ceprotec »

ok Sergey, thank you :D
Post Reply