当前位置:网站首页>Setting and using richview trvstyle template style
Setting and using richview trvstyle template style
2022-07-06 06:55:00 【lyhoo163】
RichView TRVStyle Template style setting and use
One 、RichEdit Of Style
Style Four important attributes :
1、TextStyles[TextNo]
The default is 5 individual :
Serial number name
0: Normal text Arial
1: Heading Arial
2: Subheading Arial
3: Keywords Arial
4: Jump 1 Arial
5: Jump 2 Arial
2、ParaStyles[ParaNo]
The default is 2 individual :
Serial number name
0: Paragraph Style 0
1: Centered 0
3、StyleTemplates[StyleNo]

The default is 11 individual :
Serial number name
0 Normal
1 heading 1
2 heading 2
3 heading 3
4 Hyperlink
5 header
6 footer
7 footnote reference
8 endnote reference
9 footnote text
10 endnote text
4、MainStyle
The default is 0 individual ( not used ):
Two 、 Detailed instructions
1、TextStyles[TextNo] and ParaStyles[ParaNo] As a style ,TextNo and ParaNo, Not used together . Only for users AddNL Wait for function calls to use :
RVE.AddNL(Text, TextNo, ParaNo); actually ,TextStyles[TextNo].StyleName and ParaStyles[ParaNo].StyleName, stay TextStyles and ParaStyles It doesn't make much sense when used to represent any format , We can simply ignore them ( It may be best to leave them empty , To prevent unnecessary storage XML/RVF Information in the file ).
2、StyleTemplates[StyleNo], Is the real style of software , it 0-StyleNo, All definitions TextStyles and ParaStyles, Use uniform Name.
StyleTemplates[StyleNo].Name
In the code , It can be ignored TextStyles[TextNo] and ParaStyles[ParaNo], Use it directly StyleTemplates[StyleNo].
rve.AddNL(S1,
MakeTextStyle(rvs, nil, rvs.StyleTemplates[0]),
MakeParaStyle(rvs, rvs.StyleTemplates[0]));such as , When you put some formats ( for example , Set text to Italic ) When applied to text formatted by a text style , You may create a new text style based on the existing text style , And this new style will inherit all unmodified properties of the existing style , Include its style name . therefore , When adding a style in an editing operation ,StyleName[No] Cannot be used to identify TextStyles and ParaStyles. If you use StyleTemplates[StyleNo], Then the name of the style template has practical significance .
3、 ... and 、 Practical significance
1、TextStyles[TextNo] and ParaStyles[ParaNo] As a style of independent single document . such as : A document has 7 A text style , Yes 4 A paragraph style . You can set 0-6 Text styles , Set up 0-3 Paragraph styles . It is the call of personality style .
RVE.AddNL(Text, TextNo, ParaNo);
2、 adopt StyleTemplates Establish an industry or unit ( Or a person ), Unified and standardized style templates . When creating a document , Unified use StyleTemplates.
rve.AddNL(S1,
MakeTextStyle(rvs, nil, rvs.StyleTemplates[0]),
MakeParaStyle(rvs, rvs.StyleTemplates[0])); Four 、TextStyles and ParaStyles The establishment of the
1、 Modify the original style
with RVHeader.Style.TextStyles[0] do begin
FontName:=' Song style '; // Font name ;
Size:=10; // font size
Color:= clBlack; // text color ;
Style:=[]; // Text style ( bold , Italics , Underline , Delete line )
Charset:=DEFAULT_CHARSET; // Font character set ( Used for the unicode Text style ).
end;
with RVHeader.Style.ParaStyles[0] do begin
FirstIndent:=0; // Indent the first line of the paragraph , use LeftIndent Summarize ;
LeftIndent:=0; // Left edge indent ;
RightIndent:=0; // Indent of the right edge ;
SpaceBefore:=0; // Space above paragraph ;
SpaceAfter:=0; // The space below the paragraph ;
LineSpacing:=200; // 200%
end;
or
RichView.Style.TextStyles.Items[0].FontName:='Monotype Corsiva';
RichView.Style.TextStyles.Items[0].Size:=15;
RichView.Style.TextStyles.Items[0].Color:=clBlack;
RichView.Style.TextStyles.Items[0].Style:=[];
RichView.Style.ParaStyles.Items[0].Alignment:=rvaJustify;
RichView.Style.ParaStyles.Items[0].LineSpacing:=100;2、 Create a new style
RVStyle1.ParaStyles.Clear;
with RVStyle1.ParaStyles.Add do begin
StyleName := 'Paragraph 1';
Alignment := rvaLeft; // Paragraph alignment ( left, right, center, justify or distribute)
LastLineAlignment:=rvaLeft; // Align the next line of paragraphs ( Align left , Right alignment , Align center , Align or assign );
FirstIndent:=0; // Indent the first line of the paragraph
LeftIndent:=0; // Left edge indent ;
RightIndent:=0; // Indent of the right edge ;
SpaceBefore:=5; // Space above paragraph ;
SpaceAfter:=5; // The space below the paragraph ;
Border:=:bsNone; // no border
end;
with RVStyle1.ParaStyles.Add do begin
StyleName := 'Paragraph 2';
Alignment := rvaCenter; // Paragraph alignment ( left, right, center, justify or distribute)
LastLineAlignment:=rvaLeft; // Align the next line of paragraphs ( Align left , Right alignment , Align center , Align or assign );
FirstIndent:=0; // Indent the first line of the paragraph
LeftIndent:=0; // Left edge indent ;
RightIndent:=0; // Indent of the right edge ;
SpaceBefore:=5; // Space above paragraph ;
SpaceAfter:=5; // The space below the paragraph ;
Border.Style:=rvbSingle; // There's a border
Border.VisibleBorders.Top:=True; // Whether the border displays
Border.VisibleBorders.Left:=False;
Border.VisibleBorders.Right:=False;
Border.VisibleBorders.Bottom:=True;
end;
5、 ... and 、StyleTemplates Creation of template style
1、 Modification of the original style
2、 Rebuild StyleTemplates 6、 ... and 、 Find the sequence number of the specified name style
var
ParaNo, StyleNo: Integer;
HeadingStyleTemplate: TRVStyleTemplate;
...
HeadingStyleTemplate := RVStyle1.StyleTemplates.FindItemByName('heading 1');
ParaNo := MakeParaStyle(RVStyle1, HeadingStyleTemplate);
StyleNo := MakeTextStyle(RVStyle1, nil, HeadingStyleTemplate);
RichViewEdit1.AddNL('This is Heading 1', StyleNo, ParaNo);边栏推荐
- RichView TRVStyle 模板样式的设置与使用
- LeetCode每日一题(1870. Minimum Speed to Arrive on Time)
- Py06 dictionary mapping dictionary nested key does not exist test key sorting
- Data security -- 13 -- data security lifecycle management
- pymongo获取一列数据
- 机器人类专业不同层次院校课程差异性简述-ROS1/ROS2-
- LeetCode每日一题(971. Flip Binary Tree To Match Preorder Traversal)
- BIO模型实现多人聊天
- Fedora/rehl installation semanage
- The difference between get and post request types
猜你喜欢

【每日一题】729. 我的日程安排表 I

【刷题】怎么样才能正确的迎接面试?

同事上了个厕所,我帮产品妹子轻松完成BI数据产品顺便得到奶茶奖励

After sharing the clone remote project, NPM install reports an error - CB () never called! This is an error with npm itself.
![[daily question] 729 My schedule I](/img/6b/a9fef338ac09caafe628023f066e1f.png)
[daily question] 729 My schedule I

My seven years with NLP

Classification des verbes reconstruits grammaticalement - - English Rabbit Learning notes (2)

Introduction and underlying analysis of regular expressions

19.段页结合的实际内存管理

At the age of 26, I changed my career from finance to software testing. After four years of precipitation, I have been a 25K Test Development Engineer
随机推荐
[English] Grammar remodeling: the core framework of English Learning -- English rabbit learning notes (1)
19.段页结合的实际内存管理
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
Leetcode daily question (971. flip binary tree to match preorder traversal)
Fedora/REHL 安装 semanage
UDP攻击是什么意思?UDP攻击防范措施
Three methods of adding color to latex text
LeetCode每日一题(971. Flip Binary Tree To Match Preorder Traversal)
Prefix and array series
Practical guidance for interface automation testing (Part I): what preparations should be made for interface automation
The registration password of day 239/300 is 8~14 alphanumeric and punctuation, and at least 2 checks are included
同事上了个厕所,我帮产品妹子轻松完成BI数据产品顺便得到奶茶奖励
[ 英語 ] 語法重塑 之 動詞分類 —— 英語兔學習筆記(2)
Reflex WMS中阶系列3:显示已发货可换组
After working for 10 years, I changed to a programmer. Now I'm 35 + years old and I'm not anxious
LeetCode每日一题(1997. First Day Where You Have Been in All the Rooms)
Development of entity developer database application
PCL实现选框裁剪点云
P5706 [deep foundation 2. Example 8] redistributing fat house water -- February 13, 2022
Supporting title of the book from 0 to 1: ctfer's growth road (Zhou Geng)