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.
Is there a bug with Indent
-
- Site Admin
- Posts: 17534
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Posts: 13
- Joined: Mon Jun 16, 2014 1:10 pm
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 :
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 :
-
- Posts: 13
- Joined: Mon Jun 16, 2014 1:10 pm
-
- Site Admin
- Posts: 17534
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
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
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