1 | TRichTextView component
|
---|
2 | for SpeedSoft Sibyl
|
---|
3 |
|
---|
4 | Written by Aaron Lawrence (aaronl@consultant.com)
|
---|
5 |
|
---|
6 | Summary
|
---|
7 | -------
|
---|
8 |
|
---|
9 | This Sibyl component displays 'rich' text, with various fonts, colors,
|
---|
10 | styles and alignment.
|
---|
11 |
|
---|
12 | The major features are:
|
---|
13 | Fast, accurate drawing of text
|
---|
14 | Full smooth scrolling
|
---|
15 | Selection and copy
|
---|
16 | Built-in default popup menu
|
---|
17 |
|
---|
18 |
|
---|
19 | Installation
|
---|
20 | ------------
|
---|
21 |
|
---|
22 | Load RichTextView.pas into Sibyl, and compile it with Project - Compile.
|
---|
23 |
|
---|
24 | Use Component - Install Component to install.
|
---|
25 |
|
---|
26 | Using the component
|
---|
27 | -------------------
|
---|
28 |
|
---|
29 | Put a component on your form. Adjust the properties as you see fit.
|
---|
30 | If you don't want the default menu, then set UseDefaultMenu to false
|
---|
31 | (all the actions in the default menu can be implemented externally).
|
---|
32 | At runtime, load the text into the control using AddText, AddParagraph,
|
---|
33 | and Clear.
|
---|
34 |
|
---|
35 | Formatting syntax
|
---|
36 |
|
---|
37 | This is a HTML-like set of tags. But note that tag pairs don't have to
|
---|
38 | match up.
|
---|
39 |
|
---|
40 | <b> </b> bold on, off
|
---|
41 | <u> </u> underline on, off
|
---|
42 | <i> </i> italic on, off
|
---|
43 | <h1> <h2> <h3> heading 1-3, set with Heading1Font etc
|
---|
44 | </h> normal text
|
---|
45 | <tt> </tt> fixed font
|
---|
46 | <red> etc colors
|
---|
47 | <left> left alignment (word wrap)
|
---|
48 | <unaligned> no right margin
|
---|
49 | <center> centered
|
---|
50 | <right> right alignment
|
---|
51 | <justify> full justification (not implemented)
|
---|
52 | <defaultalign> default alignment
|
---|
53 | <margin x> set left margin to x pixels
|
---|
54 | <link linktext> </link>
|
---|
55 | start, end link.
|
---|
56 | The OnClickLink and OnOverLink events are called with linktext
|
---|
57 | <image x> Display image x from associated TImageList
|
---|
58 |
|
---|
59 |
|
---|
60 | Example
|
---|
61 |
|
---|
62 | RichText.AddParagraph( '<h1>This is a big heading</h>' );
|
---|
63 | RichText.AddParagraph( 'Here is some <b>bold</b> text' );
|
---|
64 |
|
---|
65 |
|
---|
66 | Problems/limitations
|
---|
67 | --------------------
|
---|
68 |
|
---|
69 | Yes, there probably are some.
|
---|