RVRuler - Fixed size

General TRichView support forum. Please post your questions here
Post Reply
Testomatico
Posts: 15
Joined: Sat Mar 22, 2014 7:47 pm

RVRuler - Fixed size

Post by Testomatico »

Hello,
I have to develop a input program for iOS. So the size of my TRichView needs to be fixed (only the width).
I tried the following code but this doesnt work very well.

Code: Select all

 RVRuler1.LeftMargin:= 3.7;
 RVRuler1.RightMargin:= 3.7;
If I resize the form, the width of the ruler will be resized too.
Is there any other possibility?

Best regards
Testo
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

You can fix document width by assigning it to RichViewEdit.MinTextWidth and MaxTextWidth properties.
Make sure that rvoClientTextWidth is excluded from RichViewEdit.Options.

I recommend to assign margins to RichViewEdit, so that the ruler will be updated according to them, not vice versa.
Testomatico
Posts: 15
Joined: Sat Mar 22, 2014 7:47 pm

Post by Testomatico »

Assigning RightMargin to RichViewEdit works fine but LeftMargin does not.
I want that the allowed space, where the user can type in, is centered in the TRichViewEdit.
Like this:
_____________________
|---------__Text__---------|
|---------_Bla bla_ ---------|
|---------________---------|
|---------________---------|
|---------________---------|
|---------________---------|
|---------________---------|
|---------________---------|
|---------________---------|
|____________________|
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I can make an example on changing margins on resizing, but may be you can consider using a table having a fixed width and inserted in a centered paragraph?
Post Reply