How to code in Delphi superscript etc
How to code in Delphi superscript etc
Hello,
I want trichview component placed at the bottom of my form. While a user is putting data into some editfields the exit eventhandler calls a procedure coding for rtf-text in this trichview.
Could you give me an example of how to code into trichviw the attached text Delphi.
I presume that when saving this text as RTF the superscrip will persist?
/Lars - DK
I want trichview component placed at the bottom of my form. While a user is putting data into some editfields the exit eventhandler calls a procedure coding for rtf-text in this trichview.
Could you give me an example of how to code into trichviw the attached text Delphi.
I presume that when saving this text as RTF the superscrip will persist?
/Lars - DK
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: How to code in Delphi superscript etc
Do you want an example how to generate such document in code?
Yes, sub/superscripts are stored in RTF
Yes, sub/superscripts are stored in RTF
Re: How to code in Delphi superscript etc
Yes - thank youDo you want an example how to generate such document in code?
And the reason is that this is in fact all I need in my lexicographical program.
I dont need a wordpad-like editor, i just need to be able to show the user what the database input will look like in the final dictionary output. So while the input is done in the editfields the exit-event of each of these editfields calls a procedure which code the dictionary layout in a TRichView placed at the bottom of the screen.
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: How to code in Delphi superscript etc
A sample project creating this document in code is attached.
- Attachments
-
- MakeSampleDoc.zip
- (2.9 KiB) Downloaded 1711 times
Re: How to code in Delphi superscript etc
Thank you, I have downloaded the code. Installed the TRichView trialversion. Then tried to run the program.
First I get an "access violation" error. After having canceled this error the form pups up and in the bottom TrichView area I get this message:
Style is not defined.
Create a TRVStyle object and assign it to RichView1.Style
Can you tell me what is the problem here?
First I get an "access violation" error. After having canceled this error the form pups up and in the bottom TrichView area I get this message:
Style is not defined.
Create a TRVStyle object and assign it to RichView1.Style
Can you tell me what is the problem here?
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: How to code in Delphi superscript etc
Which Delphi version do you use?
Re: How to code in Delphi superscript etc
XE 10.1 Berlin
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: How to code in Delphi superscript etc
I downloaded the trial version from our website, installed it in Delphi 10.1, and this demo runs fine on my computer. So I cannot reproduce the problem.
The demo really will raise an exception if TRVStyle component is not assigned to Style property of RichviewEdit1. Please check that it is assigned, in the Object Inspector.
The demo really will raise an exception if TRVStyle component is not assigned to Style property of RichviewEdit1. Please check that it is assigned, in the Object Inspector.
Re: How to code in Delphi superscript etc
I downloaded the sample once more, and now it is working fine. Thank you!
Re: How to code in Delphi superscript etc
In the same manner (as the above attached demo) I would like to code for font and size in Delphi.
I was told in another thread that this could be found in Editor2 demo. Do you have a link to this folder please? Thank you!
PS: function GetTextStyle(Style: TFontStyles; Color: TColor;
SScript: TRVSubSuperScriptType): Integer;
- here you have color and style
- where do you have font and size?
I was told in another thread that this could be found in Editor2 demo. Do you have a link to this folder please? Thank you!
PS: function GetTextStyle(Style: TFontStyles; Color: TColor;
SScript: TRVSubSuperScriptType): Integer;
- here you have color and style
- where do you have font and size?
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: How to code in Delphi superscript etc
I attached a modified demo.
In this demo, GetTextStyle has additional parameter, SizeDouble (double font size in points). For example, SizeDouble = 20 means font size 10pt, SizeDouble=21 means font size 10.5pt.
Internally, the function simply assigns this parameter to the property of the same name of TextStyle object.
You can see text properties in the help file, may be you will need to define even more properties: http://www.trichview.com/help/pme_cp_tfontinfo.html
You can simply add the corresponding parameter to GetTextStyle and assign it to the property in this function.
In this demo, GetTextStyle has additional parameter, SizeDouble (double font size in points). For example, SizeDouble = 20 means font size 10pt, SizeDouble=21 means font size 10.5pt.
Internally, the function simply assigns this parameter to the property of the same name of TextStyle object.
You can see text properties in the help file, may be you will need to define even more properties: http://www.trichview.com/help/pme_cp_tfontinfo.html
You can simply add the corresponding parameter to GetTextStyle and assign it to the property in this function.
- Attachments
-
- MakeSampleDoc2.zip
- (6.33 KiB) Downloaded 1545 times
Re: How to code in Delphi superscript etc
Thank you Sergey - just what I needed.