BUG: SWTDesigner + Formlayout with margins

SWT Designer allows you to create the views, editors, perspectives, pref pages, composites, etc. that comprise Eclipse SWT & RCP applications and plug-ins.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

BUG: SWTDesigner + Formlayout with margins

Postby dmigowski » Wed Jan 05, 2011 12:28 am

We use the SWTDesigner to edit Composites with Formlayout. The Layout always has marginHeight=5 and marginWidth=5.

When moving controls, the margins are not handled correctly. If I move a control to the right side of the composite, so it is 12 pixels away from the border, when I release the button during drag the control is placed to be 17 (12+5) pixels away.

It seems like the GUI designer uses the distance from the border to set the offset in the FormData object, but it misses that 5 pixels are already contributed by the marginWidth, so the real offset to use would be 7 (12px distance from border minus 5 px margin).

It would be great if someone would find the time to fix this for us.
dmigowski
 
Posts: 1
Joined: Wed Jan 05, 2011 12:12 am

Re: BUG: SWTDesigner + Formlayout with margins

Postby Eric Clayberg » Sun Jan 16, 2011 6:34 pm

Give this a try using the latest WindowBuilder build...

http://code.google.com/javadevtools/dow ... -beta.html

Due to the upcoming donation of WindowBuilder to Eclipse.org, the WindowBuilder namespace (e.g., feature/plug-in names) has changed, so you must un-install the version you currently have loaded (8.1.x) and re-install this new version (0.9.0) from the above update site.
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: BUG: SWTDesigner + Formlayout with margins

Postby P38 » Wed Feb 09, 2011 2:56 pm

I also have been trying to use FormLayout and had similar problems.
I tried the beta version recommended, and it did not fix things.

Questions:

Is FormLayout the only layout that can do the following? We have a Composite with three widgets in a single row. The middle widget should grow with the composite's width. The rightmost widget should stay the same size and be aligned to the right edge.

Questions about using WindowBuilder (WB) with FormLayout :

1. What if you set, for example, Right Alignment on a control and later decide you don't want right alignment? How do you undo that? Selecting it in the Properties window and pressing Delete causes WB to crash.

2. Is WB seriously supposed to do everything visually or is it realistic to expect that many things have to be fixed through manual editing of the code?

3. WB seems to decide what to anchor things to and it makes this choice impossible to change (without manually editing code). The control you are aligned to is shown in the properties window. This seems to lead to situations in which controls within a container are all linked in a highly convoluted way. Why not just do what .Net does with their Anchor feature? Controls can be anchored top, bottom, left and/or right to their parent container. This is simple, yet very effective.

4. WB shows what control a widget is aligned to in the Properties Window. Unfortunately, it does not let us change this to correct things. If you don't like the idea expressed in the preceding point, then why not give us a combobox or droplist which lets us choose what to anchor things to.

5. When placing a component and setting its size, is there some trick to getting this to work? Our experience has been that when you try to set its size, WB spontaneously changes the size after you release the mouse. To get things sized correctly, we've found that you have to do it in many steps, sneaking up on WB or it will up and change the size in an undesireable way including putting some of the control outside of the parent container.

6. We have experienced cases using FormLayout where we would add a control and the other controls, which we painstakingly had gotten into about the right positions, would all change size and position radically. Is there a reason for this, or is this a bug?
P38
 
Posts: 8
Joined: Wed Feb 09, 2011 11:35 am

Re: BUG: SWTDesigner + Formlayout with margins

Postby Eric Clayberg » Wed Feb 09, 2011 3:17 pm

It sounds like you are using the simple FormLayout Automatic Placement mode. If you want to have fine tuned control over FormLayout, you should use Classic mode...

http://code.google.com/javadevtools/wbp ... ayout.html

P38 wrote:Is FormLayout the only layout that can do the following? We have a Composite with three widgets in a single row. The middle widget should grow with the composite's width. The rightmost widget should stay the same size and be aligned to the right edge.

I would say FormLayout is a poor choice for that. The standard SWT GridLayout (used for almost every wizard, editor or form in Eclipse itself) is far superior...

http://code.google.com/javadevtools/wbp ... ayout.html

What you describe would be trivial with GridLayout and would take many, many more steps with FormLayout.
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


Return to SWT Designer

Who is online

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

cron