Text with formatting information
Source position: mserichstring.pas line 93
type richstringty = record |
text: msestring; |
format: formatinfoarty; |
flags: richflagsty; |
end; |
Text with formatting information (font color, background color, font style), used for example by the richvalue property of trichmemoedit and trichstringdisp, by syntax highlighting and by drawtext. format holds the style changes, each one starting at a zero-based character index.
The format is set with the functions of this unit. Each comes in two forms: setcolorbackground1 (with the suffix 1) modifies its var parameter and returns whether something changed, whereas setcolorbackground returns a new array and leaves its argument untouched, so its result must be assigned. To change the format of a widget, work on a copy and assign it back:
var rstr1: richstringty; begin rstr1:= richedit.richvalue; setcolorbackground1(rstr1.format,1,3,cl_red); richedit.richvalue:= rstr1; end;