Position of the bullet
Posted: Wed Jul 27, 2011 4:22 pm
Hello!
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.
This worked correctly and the corresponding rtf-files are stored in DB. When the caret enters - e.g. level ("ebene") 4 - and I press enter, the caret still is indented to level 4. If I press the bulletlist-button (using the code from the example), the bulled sticks to the left border.
How can I get the correct "markerindent"?
Thanks in advance
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