I am trying to get wprichtext to work like Word when a user backspaces at the start of a numbered or bulleted paragraph. And also with an indented para. I am not getting very far!
Code so far:
Code
if key=vk_back then
begin
if (wprichtext1.Textcursor.active_posinpar=0) and (wpRichText1.activepar.isNumbered) then
begin
key:=0;
wpRichText1.AGet(WPAT_NumberLevel, val);
wpRichText1.ASet(WPAT_NumberSTYLE, 0);
wpRichText1.ASet(WPAT_NumberLevel, 0);
wpRichText1.ASet(WPAT_IndentFirst, 0);
wpRichText1.ASet(WPAT_IndentLeft, 0);
wpRichText1.InputString(#13); //for some reason still processing the back space
end
else
if (wprichtext1.Textcursor.active_posinpar=0) and (wpRichText1.currAttr.IndentLeft>0) then
begin
key:=0;
wpRichText1.currAttr.decIndent;
wpRichText1.InputString(#13); ////for some reason still processing the back space
end;
end;
Alles anzeigen
The first section of the code only works if a top level number/bullet. Not sure how to get it to decrease the indent by 1. Any pointers please?