Layout managers for VA ST

VA Smalltalk is a "100% VisualAge compatible" IDE that includes the original VisualAge technology and the popular VA Assist and WidgetKit add-ons.

Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig

Layout managers for VA ST

Postby jtuchel » Sun Apr 13, 2008 12:21 am

Hi there,

the more I am facing the cross-(windows)-platform nightmare (see my question about fonts for XP and VISTA), the more I wonder whether it wouldn't be a great thing to have layout managers in VAST, which could help solve some issues like widget height differences between platforms.
With Layout managers I mean GridLayout etc, like they are in Swing or SWT.

What do you people out there think?
Am I missing some best practices that are available for VAST cross platform GUIs?

cu

Joachim
jtuchel
[|]
 
Posts: 245
Joined: Fri Oct 05, 2007 1:05 am
Location: Ludwigsburg, Germany

Re: Layout managers for VA ST

Postby Eric Clayberg » Sun Apr 13, 2008 5:01 am

jtuchel wrote:the more I am facing the cross-(windows)-platform nightmare (see my question about fonts for XP and VISTA), the more I wonder whether it wouldn't be a great thing to have layout managers in VAST, which could help solve some issues like widget height differences between platforms.
With Layout managers I mean GridLayout etc, like they are in Swing or SWT.

The layout system used in VAST (attachments on each widget side) is basically the same as SWT FormLayout (which is basically just a Java port of the VAST system) and Swing SpringLayout. The layout system in VAST does actually solve the problem you identify as long as you don't over specify the constraints and use widget-to-widget attachments correctly. For example, if you fix only the top and left corners of a Button, its right side and bottom will adjust based on its text, font and font size (which is what you want in a multi-lingual, multi-resolution, multi-font application). If you place a second button next to the first and set its left side to be attached to the right side of the first, its position will adjust based on the size of the first button. To layout an entire form so that it will grow and shrink intelligently, you would typically begin by locking the widgets around the periphery to the margins of the window and then work inward using widget attachments.

Something like the SWT GridLayout might be a nice alternative as it simplifies some things (at the expense of others). Interestingly enough, the SWT GridLayout layout manager was originally developed in VAST for VA Java. Most of the VA Java wizards were built using GridLayout and that layout was later ported to Java for use with Eclipse. The main problem with GridLayout (which is a grid-based left-to-right wrapping layout with row and column spanning) is that it takes a lot of work to get right when laying things out manually. You also need to create invisible spacer widgets (usually empty Labels) for any cells in the grid that you want to keep blank. If you can plan ahead and know the exact number of columns you need, it can work out pretty well. Change the number of columns after the fact, and you have a real nightmare on your hands trying to readjust the flow of the grid. To really use GridLayout effectively, you need pretty sophisticated GUI builder support to automatically adjust all the grid column and row positions, invisible spacers, etc. As an example, you can take a look at the flash demo of what we do in the Java version of WindowBuilder.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: Layout managers for VA ST

Postby jtuchel » Sun Apr 13, 2008 11:32 pm

Eric,

while you are right that form layiout managers aren't perfect, the approach you mention won't work in quite some situations as well:
* aligning a label and a text field vertically due to the differences in height. How would you do that for cross platform GUIs?
* aligning labels and text fields in two columns, the first of which has the width of the widest label

These alignments are easy at development time, using the tools in the Composition editor. But that's only true for the platform you design on. If you want to go cross platform, these tools can't help at all.

So I think layout managers have their pro's and I think they could be very helpful to VA ST developers. Maybe porting them back from WB Pro / Java would not be too much effort?

Regards

Joachim
jtuchel
[|]
 
Posts: 245
Joined: Fri Oct 05, 2007 1:05 am
Location: Ludwigsburg, Germany


Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest