Sign in Join
Wiki copytemporary

RichMemo/Samples: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11## Tabs
22
33Tabs are used to organize the text in table-like layout. This would not be a real layout table, but will make the text (if it's short enough) to look table alike.
44
55### Basics
66
77In order for tabs to work the text should be split tab character (#9)
88
99This is how the text would look like if no tab separation is used:
1010
11-<figure>
12-<img src="richmemo_basic1.png" title="richmemo_basic1.png" />
13-<figcaption>richmemo_basic1.png</figcaption>
14-</figure>
11+![](/wiki-images/4/41/Richmemo_basic1.png)
1512
1613```delphi
1714 RichMemo1.Lines.Add('hello world');
1815 RichMemo1.Lines.Add('this sample');
1916```
2017
2118If the words are split by Tabs, then the control tries to find the next proper tab offset in order:
2219
23-<figure>
24-<img src="richmemo_basic2.png" title="richmemo_basic2.png" />
25-<figcaption>richmemo_basic2.png</figcaption>
26-</figure>
20+![](/wiki-images/1/1e/Richmemo_basic2.png)
2721
2822```delphi
2923 RichMemo1.Lines.Add('hello'#9'world');
3024 RichMemo1.Lines.Add('this'+#9+'sample');
3125```
3226
3327### Tab Offsets
3428
3529The length of tab offsets can be controlled using [[RichMemo|GetParaTabs]] and [[RichMemo|SetParaTabs]] methods.
3630
3731```delphi
3832var
3933 st : TTabStopList;
4034 i : integer;
4135begin
4236
4337 RichMemo1.GetParaTabs(0, st); // getting the current tabs
4438 st.Count:=8;
4539 SetLength(st.Tabs, st.Count);
4640 for i:=0 to length(st.Tabs)-1 do
4741 st.Tabs[i].Offset:=i*72;
4842 RichMemo1.SetParaTabs(-1,-1,st); // assigning tabs stops
4943
5044 // assigning text with tabs (#9)
5145 RichMemo1.Lines.Add('hello'#9'world'#9'to'#9'columns');
5246 RichMemo1.Lines.Add('does'#9'it'#9'look'#9'good'#9'?');
5347 RichMemo1.Lines.Add('tab'+#9+'is'+#9+'character'+#9+'9');
5448end;
5549```
5650
57-<figure>
58-<img src="richmemo_tabs.png" title="richmemo_tabs.png" />
59-<figcaption>richmemo_tabs.png</figcaption>
60-</figure>
51+![](/wiki-images/8/8c/Richmemo_tabs.png)
6152
6253## See Also
6354
6455- [[RichMemo]]
6556
6657---
6758*From the Free Pascal wiki, page "RichMemo/Samples", as it stood on 2021-06-28 after a change by Skalogryz, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
6859Category: RichMemo

Back to history