formattedHeight and scrollbars

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

formattedHeight and scrollbars

Claus Dreischer
Hi,

I'm a bit confused with the formattedHeight of a field and an additional
scrollbar:

The content of a field has the formattedHeight of e.g. 74
The scrollbarwidth is set to 10, but the hScrollbar is not enabled yet.

Now when i enable the hScrollbar,
the formattedHeight of that field jumps to *94*.

The scrollbar is counted twice.

I would have expected the new formattedHeight to jump to 84.

Can someone please explain the logic behind this (when it's intended)?


Regards,
        Claus.

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: formattedHeight and scrollbars

BNig
Hi Claus,

I made a little revlet that shows what impacts the formattedHeight of a field:

http://berndniggemann.on-rev.com/marginsrevlet/

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
Reply | Threaded
Open this post in threaded view
|

Re: formattedHeight and scrollbars

dunbarxx
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.


But when I just add a hor scrollbar to a field, by changing the hScrollBar property, the scrollbar only subtends a portion of the bottom of the field. The bottom does not move. Nonetheless, per the original post, the formattedheight loses more than it seems it ought to. I am playing with this, and it seems that it may not have anything to do with the actual height of the Hor scrollBar.




-----Original Message-----
From: BNig <[hidden email]>
To: [hidden email]
Sent: Wed, Feb 16, 2011 6:37 pm
Subject: Re: formattedHeight and scrollbars



Hi Claus,

I made a little revlet that shows what impacts the formattedHeight of a
field:

http://berndniggemann.on-rev.com/marginsrevlet/

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
--
View this message in context: http://runtime-revolution.278305.n4.nabble.com/formattedHeight-and-scrollbars-tp3309720p3309965.html
Sent from the Revolution - User mailing list archive at Nabble.com.

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

 
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: formattedHeight and scrollbars

Claus Dreischer
Hi,

Am 17.02.11 01:02, schrieb [hidden email]:
> A fun revlet.

Indeed!


> 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
>:-> )

Example:
- 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?


Regards,
        Claus.


[...]

> Hi Claus,
>
> I made a little revlet that shows what impacts the formattedHeight of a
> field:
>
> http://berndniggemann.on-rev.com/marginsrevlet/
>
> 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

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: formattedHeight and scrollbars

Claus Dreischer
In reply to this post by Claus Dreischer
Fixed with 4.6.0-dp-6.

http://quality.runrev.com/qacenter/show_bug.cgi?id=9404


We can now use the formattedHeight (or Width) reliably to decide if a
field needs scrollbars or not.

Regards,
        Claus.



Am 16.02.11 22:03, schrieb Claus Dreischer:

> Hi,
>
> I'm a bit confused with the formattedHeight of a field and an additional
> scrollbar:
>
> The content of a field has the formattedHeight of e.g. 74
> The scrollbarwidth is set to 10, but the hScrollbar is not enabled yet.
>
> Now when i enable the hScrollbar,
> the formattedHeight of that field jumps to *94*.
>
> The scrollbar is counted twice.
>
> I would have expected the new formattedHeight to jump to 84.
>
> Can someone please explain the logic behind this (when it's intended)?
>
>
> Regards,
> Claus.
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: formattedHeight and scrollbars

Howard Bornstein-2
In reply to this post by BNig
Hi,

I was having some issues with formattedTextHeight and came across this
post. I looked at your revlet and it suggested some things that solved my
problem. Thank you for that!

I wondered if you would be willing to send me the LC stack you made this
revlet from. It would be very useful to have as a reference when I run into
these kinds of problems again (and when I'm not online).

Thanks in advance.

--
Regards,

Howard Bornstein
-----------------------
www.designeq.com

On Wed, Feb 16, 2011 at 3:37 PM, BNig <[hidden email]> wrote:

>
> Hi Claus,
>
> I made a little revlet that shows what impacts the formattedHeight of a
> field:
>
> http://berndniggemann.on-rev.com/marginsrevlet/
>
> 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
> --
> View this message in context:
> http://runtime-revolution.278305.n4.nabble.com/formattedHeight-and-scrollbars-tp3309720p3309965.html
> Sent from the Revolution - User mailing list archive at Nabble.com.
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: formattedHeight and scrollbars

Howard Bornstein-2
oops, sorry, that was meant to be a private email.

On Wed, Feb 1, 2012 at 1:54 PM, Howard Bornstein <[hidden email]>wrote:

> Hi,
>
> I was having some issues with formattedTextHeight and came across this
> post. I looked at your revlet and it suggested some things that solved my
> problem. Thank you for that!
>
> I wondered if you would be willing to send me the LC stack you made this
> revlet from. It would be very useful to have as a reference when I run into
> these kinds of problems again (and when I'm not online).
>
> Thanks in advance.
>
> --
> Regards,
>
> Howard Bornstein
> -----------------------
> www.designeq.com
>
>
> On Wed, Feb 16, 2011 at 3:37 PM, BNig <[hidden email]> wrote:
>
>>
>> Hi Claus,
>>
>> I made a little revlet that shows what impacts the formattedHeight of a
>> field:
>>
>> http://berndniggemann.on-rev.com/marginsrevlet/
>>
>> 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
>> --
>> View this message in context:
>> http://runtime-revolution.278305.n4.nabble.com/formattedHeight-and-scrollbars-tp3309720p3309965.html
>> Sent from the Revolution - User mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>
>
>


--
Regards,

Howard Bornstein
-----------------------
www.designeq.com
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: formattedHeight and scrollbars

BNig
Hi Howard,

I've sent you the stack and here it is for anyone interested in playing around with the parameters of a field that affect the formattedHeight of that field.


http://berndniggemann.on-rev.com/margins/marginsapp.livecode.zip

Kind regards

Bernd




On Wed, Feb 1, 2012 at 1:54 PM, Howard Bornstein <[hidden email]>wrote:

> Hi,
>
> I was having some issues with formattedTextHeight and came across this
> post. I looked at your revlet and it suggested some things that solved my
> problem. Thank you for that!
>
> I wondered if you would be willing to send me the LC stack you made this
> revlet from. It would be very useful to have as a reference when I run into
> these kinds of problems again (and when I'm not online).
>
> Thanks in advance.
>
> --
> Regards,
>
> Howard Bornstein
> -----------------------
> www.designeq.com
>
>
> On Wed, Feb 16, 2011 at 3:37 PM, BNig <[hidden email]> wrote:
>
>>
>> Hi Claus,
>>
>> I made a little revlet that shows what impacts the formattedHeight of a
>> field:
>>
>> http://berndniggemann.on-rev.com/marginsrevlet/
>>
>> 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
>> --
>> View this message in context:
>> http://runtime-revolution.278305.n4.nabble.com/formattedHeight-and-scrollbars-tp3309720p3309965.html
>> Sent from the Revolution - User mailing list archive at Nabble.com.
>>