Page 1 of 1

Table Properties form/Width combo has Pixels and "

Posted: Mon Sep 05, 2011 11:05 pm
by jimmaguire
There are 2 items in the Table Properties, Width combo: Percent and "

I want Percent and Pixels. Your Actions demo is correct and I'm using it almost verbatim.

Opening my existing docs set it to: "

Any ideas?

Posted: Tue Sep 06, 2011 11:20 am
by Sergey Tkachenko
A measuring units displayed in RichViewActions dialogs are defined in RVAControlPanel.UnitsDisplay.
If the combobox shows '', the units are inches.

In the ActionTest demo, TForm3.RVAControlPanel1MarginsChanged contains the following code:

Code: Select all

  cmbUnits.ItemIndex := ord(SRichViewEdit1.UnitsProgram);
  SclRVRuler1.UnitsDisplay := TRulerUnits(SRichViewEdit1.UnitsProgram);
  SclRVRuler2.UnitsDisplay := TRulerUnits(SRichViewEdit1.UnitsProgram);
This code changes the units displayed in RichViewActions dialogs (and in rulers) to the units defined for SRichViewEdit1. Because of this, the units may change after loading a file. To prevent this, just remove this code.

Changed UnitsProgram to pixels to get Table Width in pixels

Posted: Wed Sep 07, 2011 12:55 am
by jimmaguire
Commenting those lines worked but only when I set UnitsProgram to pixels in design mode.

Whatever UnitsProgram is set to determines one of the Table Properties/width combo items, the other is always Percent.

I'm ok with it although it would be nice to have the display in inches but have the option to set the table width in pixels.

Posted: Wed Sep 07, 2011 6:35 pm
by Sergey Tkachenko
Commenting those lines worked but only when I set UnitsProgram to pixels in design mode.
It is because the demo contains this line in TForm3.FormCreate:

Code: Select all

RVAControlPanel1.UnitsDisplay := SRichViewEdit1.UnitsProgram;
You can also change units in dialogs using the combobox in the toolbar. So the user, if he/she wants to assign table size in pixels, may switch to pixels and back when necessary.

It would be too difficult to define units for each dialogs separately.
Currently, there are the following rules:
- if units<>pixels, dialogs show large sizes in these units, small sizes - in points
- border widths can be always defined in pixels (if RVAControlPanel.PixelBorders=True). Currently, it is highly recommended for ScaleRichView, because its drawing precision is 1 pixel, so defining border widths in points makes no sense; in future, we will increase a drawing precision.
The only exception was made for pictures. Their size can be defined in %, the specified units and pixels. Sorry, I do not think that a table size should be an exception like this.

PS: probably, we will allow entering units directly in editors, like in MS Word, but not in near future.