| Subject |
Re: Metric conversion |
| From |
Mervyn Bick <invalid@invalid.invalid> |
| Date |
Sat, 25 Mar 2023 21:34:28 +0200 |
| Newsgroups |
dbase.getting-started |
On 2023/03/25 18:27, Tom wrote:
> Hi all,
>
> Found lots of conversion formulas in the dUFLP but not the one I am
> looking for.
>
> I wish to convert form metric characters to form metric pixels.
>
> Seems like I saw this in some program in the dUFLP but, as usual, cannot
> remember where.
>
> Thanks in advance,
>
> Tom
Set up a form with metric = 0 (Characters) with top = 10 , left = 10,
height = 10 and width = 100 and save it. Open the form in the designer
and change the metric to 6 (Pixels) and save. If you open the form in
the sourcecode editor you will see that
height = 10.0
left = 10.0
top = 10.0
width = 100.0
has been changed to
height = 220.0
left = 70.0
top = 220.0
width = 700.0
The easiest way to convert a form's metric from character to pixels is
to open it in the designer, change the metric property from 0 to 6 and
save the form. dBASE will do all the conversions for you.
If you have many forms to convert you could write a program to read a
form's source code line by line, parse each line and multiply height and
top properties by 22 and multiply left and width properties by 7 before
writing the line back to a new file.
You will also need to check that the metric property is included in the
form's constructor code. It it is change it to 6, if it isn't (which is
quite likely if you haven't changed the metric property and then changed
it back to character) then add the line.
Mervyn.
|
|