Difference between Mac and PC

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

Difference between Mac and PC

Postby hanland » Mon Sep 20, 2010 1:41 am

Hi,

I have an RCP application which uses SWT designer to create the form layouts. I have noticed an annoying difference between the Mac and the PC. This relates to the Group headings. Using grid layouts, the Mac version truncates the group title, but not on the PC. As the user can set the font size I can't rely on width hints to solve this one. I have two small screen shots showing the difference in the designer. The group is using fill but not grab as I just want the group contents to be contained and no more, as with the PC version.

Any ideas how to get around this one?

Thanks in advance.

This is using eclipse 3.5, and SWT designer Pro, last Instantiations version and Google version (same result)

PC Version

screen_pc.png
PC version
screen_pc.png (57.39 KiB) Viewed 242 times



Mac Version

screen.png
screen.png (66.31 KiB) Viewed 242 times
hanland
 
Posts: 6
Joined: Mon Sep 20, 2010 1:30 am

Re: Difference between Mac and PC

Postby Eric Clayberg » Mon Sep 20, 2010 6:13 am

Looks like an SWT OSX bug.

Have you told that column/cell to grab all of the remaining space?

In general, it is a lot easier to diagnose issues like this with an actual test case.
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: Difference between Mac and PC

Postby hanland » Mon Sep 20, 2010 7:44 am

The grab is not an option as this would expand the group to cover 85 % of the screen.

I will put a test case together.

Regards
hanland
 
Posts: 6
Joined: Mon Sep 20, 2010 1:30 am

Re: Difference between Mac and PC

Postby hanland » Mon Sep 20, 2010 8:47 am

OK a test case with two screen shots.

Code: Select all
package uk.hsoft.reports.forms;

import org.eclipse.swt.widgets.Composite;

public class TextCase extends FormPage {

   /**
    * Create the form page.
    * @param id
    * @param title
    */
   public TextCase(String id, String title) {
      super(id, title);
   }

   /**
    * Create the form page.
    * @param editor
    * @param id
    * @param title
    * @wbp.parser.constructor
    * @wbp.eval.method.parameter id "Some id"
    * @wbp.eval.method.parameter title "Some title"
    */
   public TextCase(FormEditor editor, String id, String title) {
      super(editor, id, title);
   }

   /**
    * Create contents of the form.
    * @param managedForm
    */
   @Override
   protected void createFormContent(IManagedForm managedForm) {
      FormToolkit toolkit = managedForm.getToolkit();
      ScrolledForm form = managedForm.getForm();
      form.setText("Empty FormPage");
      Composite body = form.getBody();
      toolkit.decorateFormHeading(form.getForm());
      toolkit.paintBordersFor(body);
      managedForm.getForm().getBody().setLayout(new GridLayout(2, false));
      
      Group grpGroup = new Group(managedForm.getForm().getBody(), SWT.NONE);
      grpGroup.setText("Group 1");
      grpGroup.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
      managedForm.getToolkit().adapt(grpGroup);
      managedForm.getToolkit().paintBordersFor(grpGroup);
      
      Group grpGroup_1 = new Group(managedForm.getForm().getBody(), SWT.NONE);
      grpGroup_1.setText("Group 2");
      managedForm.getToolkit().adapt(grpGroup_1);
      managedForm.getToolkit().paintBordersFor(grpGroup_1);
      
      Group grpGroup_2 = new Group(managedForm.getForm().getBody(), SWT.NONE);
      grpGroup_2.setText("Group  xxxxxxx 3");
      managedForm.getToolkit().adapt(grpGroup_2);
      managedForm.getToolkit().paintBordersFor(grpGroup_2);
   }
}


The screen shots

Screen shot one with the group heading broken

screen1.png
screen1.png (68.67 KiB) Viewed 231 times


Screen shot two with the group heading shown but too wide

screen2.png
screen2.png (68.03 KiB) Viewed 231 times
hanland
 
Posts: 6
Joined: Mon Sep 20, 2010 1:30 am

Re: Difference between Mac and PC

Postby Konstantin.Scheglov » Tue Sep 21, 2010 4:23 am

hanland wrote:The grab is not an option as this would expand the group to cover 85 % of the screen.


You can use GridData.minimumWidth property in combination with grab (see Javadoc).
Konstantin.Scheglov
Moderator
 
Posts: 186
Joined: Tue Oct 18, 2005 8:11 pm
Location: Russian Federation, Lipetsk

Re: Difference between Mac and PC

Postby hanland » Tue Sep 21, 2010 6:57 am

As I said in the original post "As the user can set the font size I can't rely on width hints to solve this one". OK if thats the only way to get around it then so be it, but it would be nice if it worked properly.

Regards
hanland
 
Posts: 6
Joined: Mon Sep 20, 2010 1:30 am

Re: Difference between Mac and PC

Postby Eric Clayberg » Tue Sep 21, 2010 7:56 am

hanland wrote:t it would be nice if it worked properly.

I agree. Unfortunately, it isn't an SWT Designer issue. All we can do is present what the OS renders for us.

This is an OSX "feature" that directly impacts SWT/OSX.
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], Google [Bot] and 1 guest

cron