Re:RichEdit Indents
Quote
In article <8a30ki$4...@bornews.borland.com>, Mike Mayes wrote:
> Does anyone know what the deal is with FirstIndent and LeftIndent using the
> RTF control. The documentation indicates that FirstIndent is supposed to
> indent the first line of a paragraph, but instead, it indents the entire
> paragraph -- which is what I thought LeftIndent was supposed to do. I can
> live with that problem as long as I know it is consistent. But, LeftIndent
> (instead of working the way I thought it should), works kind of the opposite
> of what I thought a FirstIndent was supposed to do. It unindents the first
> line of the paragraph -- or more specifically, it indents all but the first
> line of text.
The documentation is misleading, these two properties are not independent of
each other. The map to two fields of the Windows PARAFORMAT record, which is
used to set paragroph properties in a rich edit control by sending it a
EM_SETPARAFORMAT message. The two fields are
<quote from win32.hlp, PARAFORMAT topic>
dxStartIndent
Indentation of the first line in the paragraph. If the paragraph formatting is
being set and PFM_OFFSETINDENT is specified, this member is treated as a
relative value that is added to the starting indentation of each affected
paragraph.
dxOffset
Indentation of the second line and subsequent lines, relative to the starting
indentation. The first line is indented if this member is negative, or
outdented is this member is positive.
</quote>
FirstIndent maps to dxStartIndent, LeftIndent maps to dxOffset. Perhaps this
info makes the observed behaviour a bit clearer. The VCL does not use
PFM_OFFSETINDENT, by the way.
Peter Below (TeamB) 100113.1...@compuserve.com)
No e-mail responses, please, unless explicitly requested!
Sent using Virtual Access 5.00 - download your freeware copy now
http://www.atlantic-coast.com/downloads/vasetup.exe