Trial Version

General TRichView support forum. Please post your questions here
Post Reply
larshgf
Posts: 20
Joined: Fri Jan 20, 2017 9:35 am

Trial Version

Post by larshgf »

What is the restrictions in the TRichView's trialverion?
Sergey Tkachenko
Site Admin
Posts: 17253
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Trial Version

Post by Sergey Tkachenko »

For TRichView - only a red label showing "unregistered" message.
For ScaleRichView - "unregisted" text in the editor window, printing only the first page, zoom in range 25-150%
larshgf
Posts: 20
Joined: Fri Jan 20, 2017 9:35 am

Re: Trial Version

Post by larshgf »

Hi,

You gave me an example of coding tekst in RichViewEdit with colors, superscript and more.
I have tried to transfer the example to my own program (after installation of the TRichView) but I get an error message pointing at the first occurance of GetTextStyle, with the text: "Not enough actual parameters". In your example I do not get this message, but here benath I am not able to compile the code because of the error????



function TForm1.GetTextStyle(Style: TFontStyles; Color: TColor;
SScript: TRVSubSuperScriptType): Integer;
var
TextStyle: TFontInfo;
begin
TextStyle := TFontInfo.Create(nil);
TextStyle.Assign(RVStyle1.TextStyles[0]);
TextStyle.Color := Color;
TextStyle.Style := Style;
TextStyle.SubSuperScriptType := SScript;
Result := RVStyle1.FindTextStyle(TextStyle);
TextStyle.Free;
end;


procedure TForm1.lbOrdbog2Click(Sender: TObject);
begin
RichViewEdit1.Clear;
RichViewEdit1.AddNL('This is ', 0, 0);
RichViewEdit1.Add('bold', GetTextStyle([fsBold])); (ERROR IN THIS LINE)
RichViewEdit1.Add(' and ', 0);
RichViewEdit1.Add('italic', GetTextStyle([fsItalic]));
RichViewEdit1.Add(' and ', 0);
RichViewEdit1.Add('underline', GetTextStyle([fsUnderline]));
RichViewEdit1.Add('. This is superscript', 0);
RichViewEdit1.Add('pl', GetTextStyle([], clWindowText, rvsssSuperScript));
RichViewEdit1.Add(' and more superscript', 0);
RichViewEdit1.Add('t', GetTextStyle([], clWindowText, rvsssSuperScript));
RichViewEdit1.AddNL('', 0, 0);
RichViewEdit1.AddNL('This is ', 0, 0);
RichViewEdit1.Add('green', GetTextStyle([], clGreen));
RichViewEdit1.Add(' and ', 0);
RichViewEdit1.Add('red', GetTextStyle([], clRed));
RichViewEdit1.Format;
end;
Sergey Tkachenko
Site Admin
Posts: 17253
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Trial Version

Post by Sergey Tkachenko »

This method is defined in the interface section in the following way:

Code: Select all

    function GetTextStyle(Style: TFontStyles = []; Color: TColor = clWindowText;
  SScript: TRVSubSuperScriptType = rvsssNormal): Integer;
You can see all parameters have default values, so they can be omitted.
larshgf
Posts: 20
Joined: Fri Jan 20, 2017 9:35 am

Re: Trial Version

Post by larshgf »

Why do I then get an error if I try to compile the code?
The only difference between the code example you send me and my code is that I put the maincode in a listbox click event and yours is placed in the formcreate event.
BR Lars
Sergey Tkachenko
Site Admin
Posts: 17253
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Trial Version

Post by Sergey Tkachenko »

I think you copied code from my demo incompletely.
How is GetTextStyle defined in the interface section of your unit? Does it have default values specified, as it was in the original code?
larshgf
Posts: 20
Joined: Fri Jan 20, 2017 9:35 am

Re: Trial Version

Post by larshgf »

Hi Sergey, you are right. I just copied the "head" of the function itself beleiving that there was no differences.
Thank you!
Post Reply