Page 1 of 1

Is there a bug with Indent

Posted: Fri Dec 19, 2014 6:41 pm
by gdemers_logilys
Is it normal that I can have text outside my TRichViewEdit ?

I type "ABC" insite my TRichViewEdit.
If I call myRichView.ApplyParaStyleConversion(PARA_INDENTDEC), I have 2 characters ouside the page. I can't do it more than that. It stops after 2 characters are outside the visible zone.

Posted: Fri Dec 19, 2014 9:30 pm
by Sergey Tkachenko
Can you post (or send to richviewgmailcom):
1) your code in OnParaStyleConversion event
2) screenshot

Posted: Mon Jan 05, 2015 1:52 pm
by gdemers_logilys
After some tests, I have found a way to do it every time. It seems to be a problem with bullets in the text.

I have string with a buttet before it. I put my cursor in right after the bullet and press BackSpace. It erases the bullet. After that if I call myRichView.ApplyParaStyleConversion(PARA_INDENTDEC), it is outside the visible zone.



1) here is my code :

procedure TfStdFrameRichEditor.RichViewParaStyleConversion(
Sender: TCustomRichViewEdit; StyleNo, UserData: Integer;
AppliedToText: Boolean; var NewStyleNo: Integer);
var ParaInfo: TParaInfo;
begin
ParaInfo := TParaInfo.Create(nil);
try
ParaInfo.Assign(RVStyle.ParaStyles[StyleNo]);
case UserData of
PARA_ALIGNMENT:
ParaInfo.Alignment := GetAlignmentFromUI;
PARA_INDENTINC:
begin
ParaInfo.LeftIndent := ParaInfo.LeftIndent+20;
if ParaInfo.LeftIndent>200 then
ParaInfo.LeftIndent := 200;
end;
PARA_INDENTDEC:
begin
ParaInfo.LeftIndent := ParaInfo.LeftIndent-20;
if ParaInfo.LeftIndent<0 then
ParaInfo.LeftIndent := 0;
end;
PARA_COLOR:
ParaInfo.Background.Color := ColorDialog.Color;
// add your code here....
end;
NewStyleNo := RVStyle.FindParaStyle(ParaInfo);
finally
ParaInfo.Free;
end;
end;

2) Here is a screenshot : Image

Posted: Thu Aug 25, 2016 1:02 pm
by gdemers_logilys
I did not get a response for this, do you have any idea what the problem might be ?

Posted: Fri Aug 26, 2016 1:58 pm
by Sergey Tkachenko
In bulleted and numbered paragraphs, parastyle.LeftIndent is not used. instead, Liststyle. Levels[].LeftIndent is used.
So you cannot modify left indent of these paragraphs by ApplyStyleConversion.
RichViewActions for increasing and decreasing indent promote and demote list levels instead. Default lists in RichViewActions, like in Word, have 9 levels.
Alternatively, you can change indents of list level, but there some difficulties, i csn explain with more details