Resizing a group and showing/hiding scrollbars

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
whelkybaby
Posts: 47
Joined: Sat Nov 17, 2007 6:04 pm

Resizing a group and showing/hiding scrollbars

Post by whelkybaby » Wed Feb 06, 2008 11:52 pm

Hello all,

Birrova story here to describe things, but bear with me!

I'm building an application with its main window laid out akin to the iWork/iTunes way of doing things. So far it looks pretty spot on. Between the toolbar, left handed disclosure tree and bottom bar (which are all grouped so they can appear across a few cards) is the main content of the window.

Now, due to disclosure tree and window resizing, the content isn't always going to fit in the space. In keeping with the correct way of doing things, the scrollbars should only appear when the area gets too small.

So, I've grouped all of the controls in this area but have decided that the geometry manager will either show the scrollbars all the time or not at all.

As a workaround, I thought I could use the resizeStack handler to allow geometry manager to do its stuff but turn the scrollbars on and off as necessary.

Problem is, I cannot work out how to test for when the group has naturally started to clip its contents. Does a group have such a property or am I going to have to create my own way or working things out (possibly with setting some customer properties)?

Cheers,


Steve

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Post by Janschenkel » Thu Feb 07, 2008 1:07 pm

Hi Steve,

You should check the formattedHeight and formattedWidth properties of the group. If they're larger than the actual height / width, show the scrollbar(s) - the conundrum being that showing either scrollbar may force the other one to appear, so you need to check twice, and take the scrollbarWidth into account.

On the other hand, what's wrong with permanently showing the scrollbars? It's accepted practice on MacOSX. All depends on the Human Interface Guidelines you're implementing, of course.

Hope this helped,

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

whelkybaby
Posts: 47
Joined: Sat Nov 17, 2007 6:04 pm

Post by whelkybaby » Thu Feb 07, 2008 1:57 pm

Oh that's fab! I didn't think of that!

Most of the forms that the user will complete shouldn't require scrolling, even when the window is reduced in size. However, some will and therefore I only wanted to show the scrollbars when absolutely necessary.

Overall, it keeps the look of the application neater.

Thanks again,


Steve

Post Reply