[Fxruby-users] Seeing which scrollbars are displayed
Status: Inactive
Brought to you by:
lyle
From: Daniel S. <da...@pr...> - 2004-03-15 03:48:19
|
I've been basing the width of one of my elements on the width of the visible content within a scrollbar. Ie. =20 aaaaaaaaaaaaab =20 sssssssssssss^ =20 sssssssssssss| =20 sssssssssssss| =20 sssssssssssss| =20 <-----------> Where aaaaa is the element that is being resized and b is the space to account for the scrollbar. However, there doesn't appear to be any easy way to tell if either of the scrollbars is displayed or not. I've cooked up the following methods: =20 def vscroll? =20 not @scroll.horizontalScrollbar.width =3D @scroll.width and =20 (@scroll.verticalScrollbar.height =3D @scroll.height or =20 (@scroll.horizontalScrollbar.width =3D @scroll.width + @scroll.verticalScrollbar.width and =20 @scroll.verticalScrollbar.height =3D @scroll.height + @scroll.horizontalScrollbar.height) =20 ) =20 end =20 def hscroll? =20 not @scroll.verticalScrollbar.height =3D @scroll.height and =20 (@scroll.horizontalScrollbar.width =3D @scroll.width or =20 (@scroll.horizontalScrollbar.width =3D @scroll.width + @scroll.verticalScrollbar.width and =20 @scroll.verticalScrollbar.height =3D @scroll.height + @scroll.horizontalScrollbar.height) =20 ) =20 end Which I know is probably missing an edge case somewhere.... I just have the feeling that there's an easier way in here somewhere that I'm just not finding. A little help anybody? #########################################################################= ############ This email has been scanned by MailMarshal, an email content filter. #########################################################################= ############ |