Page 1 of 1

Trial Version

Posted: Sat Feb 18, 2017 5:25 pm
by larshgf
What is the restrictions in the TRichView's trialverion?

Re: Trial Version

Posted: Sun Feb 19, 2017 4:33 pm
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%

Re: Trial Version

Posted: Sun Feb 19, 2017 5:23 pm
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;

Re: Trial Version

Posted: Mon Feb 20, 2017 7:50 am
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.

Re: Trial Version

Posted: Mon Feb 20, 2017 9:42 am
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

Re: Trial Version

Posted: Mon Feb 20, 2017 10:24 am
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?

Re: Trial Version

Posted: Mon Feb 20, 2017 1:20 pm
by larshgf
Hi Sergey, you are right. I just copied the "head" of the function itself beleiving that there was no differences.
Thank you!