Is there a bug with Indent

General TRichView support forum. Please post your questions here
Post Reply
gdemers_logilys
Posts: 13
Joined: Mon Jun 16, 2014 1:10 pm

Is there a bug with Indent

Post 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.
Sergey Tkachenko
Site Admin
Posts: 17524
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Can you post (or send to richviewgmailcom):
1) your code in OnParaStyleConversion event
2) screenshot
gdemers_logilys
Posts: 13
Joined: Mon Jun 16, 2014 1:10 pm

Post 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
gdemers_logilys
Posts: 13
Joined: Mon Jun 16, 2014 1:10 pm

Post by gdemers_logilys »

I did not get a response for this, do you have any idea what the problem might be ?
Sergey Tkachenko
Site Admin
Posts: 17524
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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
Post Reply