I'm trying to switch from Delphi's TRichEdit to your TRichView component. I've a lot of RTF-Files which are stored in a Database. Now I'm trying to add the bullets for (un)ordered lists.
The bullets should be in exactly the same position as the paragraph text is. I saw that I have to use the "markerindent". But I don't know how to read out the paragraph's left indent. It's always 0 (zero). Here is the way, I created the intendation of the lists using the delphi-component.
Code: Select all
procedure TextEinruecken(Editor: TJvRichEdit; Ebene: Integer);
var
fmt, fmt_current: TPARAFORMAT2;
begin
ZeroMemory(@fmt, sizeof(TParaformat2));
fmt.cbSize:=SizeOf(TParaformat2);
fmt.dwMask:=PFM_NUMBERING or PFM_NUMBERINGSTART or PFM_NUMBERINGSTYLE or
PFM_NUMBERINGTAB or PFM_STARTINDENT or PFN_BULLET or PFM_OFFSETINDENT
or PFM_OFFSET;
ZeroMemory(@fmt_current, sizeof(TParaformat2));
fmt_current.cbSize:=SizeOf(TParaformat2);
fmt_current.dwMask:=PFM_NUMBERING or PFM_NUMBERINGSTART or PFM_NUMBERINGSTYLE or
PFM_NUMBERINGTAB or PFM_STARTINDENT or PFN_BULLET or PFM_OFFSETINDENT
or PFM_OFFSET;
if (Ebene = 1) then
fmt.dxStartIndent:=0
else if (ebene = 2) then
fmt.dxStartIndent:=200
else if (ebene > 2) then
fmt.dxStartIndent:=200*(ebene-1);
Editor.Perform(EM_GETPARAFORMAT, 0, lParam(@fmt_current));
uTextEditorUtils.letzterEinzug:=fmt_current.dxStartIndent;
Editor.Perform(EM_SETPARAFORMAT, 0, lParam(@fmt));
end;
How can I get the correct "markerindent"?
Thanks in advance