Hi;
Is it possible to add an horizontal line in a way it's paragraph remains read-only and only can be deleted?.
I use the next code for inserting and it works. But if I go to the begin of the line, I can start adding text to the same paragrph. Also, if I remove the end of paragraph for the previous paragraph then both paragraphs are joined.
Code
procedure TEditor.LineahorizontalClick(Sender: TObject);
var
iPos: integer;
begin
if WP.Changing then
begin
iPos := WP.CPPosition;
WP.BeginUpdate;
try
while not WP.ActivePar.IsEmpty do
begin
WP.InputString(#13);
if not WP.ActivePar.IsEmpty then WP.CPPosition := iPos;
end;
WP.ActivePar.ADel(WPAT_IndentFirst);
WP.ActivePar.ADel(WPAT_IndentLeft);
WP.ActivePar.ADel(WPAT_IndentRight);
WP.ActivePar.AppendNewObject(wpobjHorizontalLine);
WP.ChangeApplied;
finally
WP.EndUpdate;
WP.CPPosition := iPos;
end;
end;
end;
Alles anzeigen
Thank you.
Felipe