Checking Group Size to see if scrollbar is needed?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
makeshyft
Posts: 222
Joined: Mon Apr 15, 2013 4:41 am
Contact:

Checking Group Size to see if scrollbar is needed?

Post by makeshyft » Sun Sep 22, 2013 3:21 pm

Hello LiveCoders

Just wondering how you would approach reading the INNER Content of a group to check if I should activate the scrollbar or not. Both vertical and horizontal I guess. I'm kinda scratching my head on this, so I thought I'd ask cuz I'm sure its been done.

Thanks,

Tom
Founder & Developer @ MakeShyft R.D.A - https://www.makeshyft.com
Build Software with AppStarterStack for Livecode - https://www.AppStarterStack.com
Save Time with The Time Saver's Toolbox - https://www.TimeSaversToolbox.com

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Checking Group Size to see if scrollbar is needed?

Post by Klaus » Sun Sep 22, 2013 3:32 pm

Hi Tom,

you can compare
1. -> the width/height of grp XYZ = the actual "visible" size, not all content may be visible.
with
2. -> the formattedwidth/formattedheight of grp XYZ = the size necessary to display all its content.

if 2 > 1 then scrollbars neccessary :D


Best

Klaus

makeshyft
Posts: 222
Joined: Mon Apr 15, 2013 4:41 am
Contact:

Re: Checking Group Size to see if scrollbar is needed?

Post by makeshyft » Sun Sep 22, 2013 3:38 pm

got it. didn't know about the formatted width function. Thank you Klaus.
Founder & Developer @ MakeShyft R.D.A - https://www.makeshyft.com
Build Software with AppStarterStack for Livecode - https://www.AppStarterStack.com
Save Time with The Time Saver's Toolbox - https://www.TimeSaversToolbox.com

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Checking Group Size to see if scrollbar is needed?

Post by Klaus » Sun Sep 22, 2013 3:43 pm

Hi TOm,

check the dictionary for "formatted*******"!

There are a LOT of "formatted" things that you can query,
even the widht/height/top/left/right etc. of text chunks in fields!
Love it! :D


Best

Klaus

makeshyft
Posts: 222
Joined: Mon Apr 15, 2013 4:41 am
Contact:

Re: Checking Group Size to see if scrollbar is needed?

Post by makeshyft » Sun Sep 22, 2013 8:25 pm

I see that ......very useful functions indeed. I've done the whole "looking through dictionary" thing before, and saw a lot of useful functions.... but its hard to remember them all until one uses them somewhere.

Thanks brother....
Founder & Developer @ MakeShyft R.D.A - https://www.makeshyft.com
Build Software with AppStarterStack for Livecode - https://www.AppStarterStack.com
Save Time with The Time Saver's Toolbox - https://www.TimeSaversToolbox.com

Post Reply