Rv Align

General TRichView support forum. Please post your questions here
Post Reply
miwan
Posts: 26
Joined: Tue Nov 01, 2011 8:30 pm

Rv Align

Post by miwan »

hi sergey

how to align RichView rvbdRightToleft with Program ?
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

For the whole document: a simple assignment, RichView1.BiDiMode := rvbdRightToLeft.

--

You can also assign BiDiMode property of a paragraph style (it overrides the document BiDiMode) and of a text style (it overrides the both document and a paragraph BiDiMode).
If you want to do it as an editing operation (undoable), you need to use ApplyStyleConversion/ApplyParaStyleConversion procedure. Or, if you use RichViewActions, you can simply use TrvActionTextRTL and TrvActionParaRTL.
miwan
Posts: 26
Joined: Tue Nov 01, 2011 8:30 pm

Post by miwan »

:arrow:

---> no effect

Richview.bidimode: rvRightToLeft


procedure TForm1.Button1Click(Sender: TObject);
begin
with rvActionTextRTL1 do
begin
rv.BiDiMode:=rvbdRightToLeft;
end;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
with rvActionParaRTL1 do
begin
rv.BiDiMode:=rvbdRightToLeft;
end;
end;

No effect vor All

:idea: :?:
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Please send me a sample project to reproduce the problem.
miwan
Posts: 26
Joined: Tue Nov 01, 2011 8:30 pm

Post by miwan »

I sent a private message
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

BiDiMode specifies a text direction, not alignment.
Regardless of the value of BiDiMode property, alignment is defined by Alignment property of a paragraph style.

In your project, to align the list to the right side:
- Delphi IDE, right click RVStyle2, choose "Edit Paragraph Styles". Add a new style in the collection (it will be the third style). Assign its Alignment = rvaRight.
- in Button3Click, change rv.AddNL(Name,4,0) to rv.AddNL(Name,4,2);

--

As for BiDiMode:
- you need to change it to rvbdRightToLeft or rvbdLeftToRight to display Arabic text; otherwise, RTL text will not be processed correctly;
- the value of this property affects to neutral characters; English characters are always displayed LTR, Arabic characters are always displayed RTL; what's why you cannot see a difference in your example.
miwan
Posts: 26
Joined: Tue Nov 01, 2011 8:30 pm

Post by miwan »

Hoooolala
:D

Supper

Merci Sergey

I said that your component is hyper Rich
Post Reply