Dialog missing title image [message #719043] |
Thu, 25 August 2011 21:43 |
Josh Davis Messages: 20 Registered: August 2011 |
Junior Member |
|
|
I created a dialog that extends org.eclipse.jface.dialogs.MessageDialog
I am unable to display the title image, without adding SWT.CLOSE to the style.
Here is some sample code...
public class TestDialog extends MessageDialog {
public static boolean open(final Shell shell, final String title, final Image image) {
final String[] dialogButtonLabels = new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL };
final TestDialog = new TestDialog(shell, title, image, "close?", MessageDialog.QUESTION, dialogButtonLabels, 1);
return dialog.open() == 0;
}
private class TestDialog(final Shell parentShell, final String dialogTitle, final Image dialogTitleImage,
final String dialogMessage, final int dialogImageType, final String[] dialogButtonLabels,
final int defaultIndex) {
super(parentShell, dialogTitle, dialogTitleImage, dialogMessage, dialogImageType, dialogButtonLabels,
defaultIndex);
setShellStyle(SWT.TITLE | SWT.APPLICATION_MODAL | SWT.BORDER);
}
}
If I add SWT.CLOSE to the setShellStyle my title image will appear.
Any idea as to why I need to add SWT.CLOSE to get the icon to show up?
I am using org.eclipse.jface_3.6.0.I20100601-0800.jar
I am running Windows 7
Thanks,
Josh
|
|
|
Powered by
FUDForum. Page generated in 0.02994 seconds