Page 1 of 1

RVRuler - Fixed size

Posted: Fri Sep 12, 2014 11:03 am
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

Posted: Fri Sep 12, 2014 11:53 am
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.

Posted: Fri Sep 12, 2014 12:40 pm
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_ ---------|
|---------________---------|
|---------________---------|
|---------________---------|
|---------________---------|
|---------________---------|
|---------________---------|
|---------________---------|
|____________________|

Posted: Sat Sep 13, 2014 2:35 pm
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?