Page 1 of 1

Resizing a group and showing/hiding scrollbars

Posted: Wed Feb 06, 2008 11:52 pm
by whelkybaby
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

Posted: Thu Feb 07, 2008 1:07 pm
by Janschenkel
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.

Posted: Thu Feb 07, 2008 1:57 pm
by whelkybaby
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