Page 1 of 1

Rv Align

Posted: Thu Nov 24, 2011 8:19 pm
by miwan
hi sergey

how to align RichView rvbdRightToleft with Program ?

Posted: Fri Nov 25, 2011 7:22 am
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.

Posted: Fri Nov 25, 2011 4:42 pm
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: :?:

Posted: Fri Nov 25, 2011 8:00 pm
by Sergey Tkachenko
Please send me a sample project to reproduce the problem.

Posted: Fri Nov 25, 2011 8:56 pm
by miwan
I sent a private message

Posted: Sat Nov 26, 2011 5:00 pm
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.

Posted: Sat Nov 26, 2011 5:38 pm
by miwan
Hoooolala
:D

Supper

Merci Sergey

I said that your component is hyper Rich