Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 284844

Summary: [Layout] The GridLayout is not shown correctly.
Product: [Eclipse Project] Platform Reporter: Chen Chao <cchen>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: CLOSED WONTFIX QA Contact: Carolyn MacLeod <carolynmacleod4>
Severity: normal    
Priority: P3 CC: remy.suen, zqian
Version: 3.5Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug
Attachments:
Description Flags
a simple example snapshot none

Description Chen Chao CLA 2009-07-28 06:58:51 EDT
Please look the attchment snapshot.

Expected: Text1 grabs all of the space.
Actually: Text1 doesn't grab the space. 

Code:

public class TestGridLayout
{

	public static void main( String[] args )
	{
		Display display = new Display( );
		Shell shell = new Shell( display );
		shell.setSize( 200, 200 );
		shell.setText( "Test layout" );

		GridLayout layout = new GridLayout( );
		layout.numColumns = 3;
		shell.setLayout( layout );

		Text text = new Text( shell, SWT.BORDER );
		text.setText( "Text1" );
		GridData gd = new GridData( GridData.FILL_HORIZONTAL );
		gd.horizontalSpan = 2;
		text.setLayoutData( gd );

		Button button = new Button( shell, SWT.PUSH );
		GridData gd3 = new GridData( );
		gd3.horizontalAlignment = SWT.END;
		button.setText( "..." );
		button.setLayoutData( gd3 );

		Text text1 = new Text( shell, SWT.BORDER );
		text1.setText( "Text2" );
		GridData gd1 = new GridData( GridData.FILL_HORIZONTAL );
		text1.setLayoutData( gd1 );

		Button button1 = new Button( shell, SWT.PUSH );
		GridData gd2 = new GridData( );
		gd2.horizontalSpan = 2;
		button1.setText( "..............." );
		button1.setLayoutData( gd2 );

		shell.layout( );

		shell.open( );
		while ( !shell.isDisposed( ) )
		{
			if ( !display.readAndDispatch( ) )
				display.sleep( );
		}
		display.dispose( );
	}

}
Comment 1 Chen Chao CLA 2009-07-28 07:00:04 EDT
Created attachment 142752 [details]
a simple example snapshot
Comment 2 Leo Ufimtsev CLA 2017-08-03 12:33:40 EDT
This is a one-off bulk update. (The last one in the triage migration).

Moving bugs from swt-triaged@eclipse to platform-swt-inbox@eclipse.org and adding "triaged" keyword as per new triage process:
https://wiki.eclipse.org/SWT/Devel/Triage

See Bug 518478 for details.

Tag for notification/mail filters:
@TriageBulkUpdate
Comment 3 Eclipse Genie CLA 2020-01-10 07:42:41 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.