how to resize a dialog and its content? [message #447720] |
Thu, 16 December 2004 18:25 |
Eclipse User |
|
|
|
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;
}
|
|
|
Powered by
FUDForum. Page generated in 0.03332 seconds