Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » how to resize a dialog and its content?
how to resize a dialog and its content? [message #447720] Thu, 16 December 2004 18:25
Eclipse UserFriend
Originally posted by: gopowereclipse.yahoo.com

I'm trying to figure out how to resize a dialog. I added the line below to
allow dialog resize. But the controls within the dialog do not resize. I
used GridLayout and GridData to layout the controls. When the dialog
resizes, the controls stay the same size. I thought the layout will auto
resize the controls. Can someone shed some light how I can make the controls
resize as well? Thanks!!! -- Vivian

public MyDialog(Shell parentShell)
{
super(parentShell);
setShellStyle(getShellStyle() | SWT.RESIZE); <<==== allow dialog
resize
}

protected Control createContents(Composite parent)
{
// create the top level composite for the dialog
Composite composite = new Composite(parent, SWT.RESIZE);
GridLayout layout = new GridLayout();
layout.marginHeight = 0;
layout.marginWidth = 0;
layout.verticalSpacing = 0;
composite.setLayout(layout);
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
applyDialogFont(composite);

// initialize the dialog units
initializeDialogUnits(composite);

// create the dialog area and button bar
dialogArea = createDialogArea(composite);
buttonBar = createButtonBar(composite);

// populate the controls in the dialog area
populateControls();

return composite;
}
Previous Topic:Drag and drop not working
Next Topic:[POCKET PC] SWT exception when creating tree
Goto Forum:
  


Current Time: Tue Apr 23 10:30:13 GMT 2024

Powered by FUDForum. Page generated in 0.03149 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top