formattedHeight and scrollbars

Claus Dreischer claus at
Thu Feb 17 03:52:23 EST 2011


Am 17.02.11 01:02, schrieb dunbarx at
> A fun revlet.


> The way you made it, it can be seen that a horizontal scrollbar not only takes up its own height, but intrudes that amount into the lower part of the field as well. That is why it takes twice its height from the formattedHeight.

The height of the filed does not change, so either you subtract the
scrollbarwidth from the height of the field, or you add the
scrollbarwidth to the formattedHeight to get "the height needed by an
object to display its full contents without scrolling" (Dictionary).

I don't think you can do both.
(Well at least if you are no banker or politician or something like hat
>:-> )

- Start Bernds Revlet
- set textHeight to 11
- set textSize to 1
- gives you formattedHeight of 70
- The height of the field is 78 (i checked with Bernd)
- The difference of 8 pixel (78-70) is the free space below the text
- Now set the scrollbarWidth to 8
- enable the hScrollbar
- The 8 pixel scrollbar takes the place of that free space
- *BUT* the formattedHeight is now 86,
  which implies that you need additional 8 pixel
  "to display its full contents without scrolling" (Dictionary).

  This is just not true.

"the height needed by an object to display its full contents without
scrolling" (Dictionary) is 80, Bernds Revlet demonstrates it clearly.

Or, where in the above did i go wrong?



> Hi Claus,
> I made a little revlet that shows what impacts the formattedHeight of a
> field:
> among other things the scrollbars and their size furthermor the margins, the
> borderwith the textsize and the textheight. I hope I did not forget
> anything. Before 4.5 on a Mac the focusborder also added to the
> formattedHeight if I remember correctly.
> Kind regards
> Bernd

More information about the Use-livecode mailing list