Mercurial > projects > dwt-win
diff dwt/widgets/MessageBox.d @ 213:36f5cb12e1a2
Update to SWT 3.4M7
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 17 May 2008 17:34:28 +0200 |
parents | ab60f3309436 |
children | fd9c62a2998e |
line wrap: on
line diff
--- a/dwt/widgets/MessageBox.d Mon May 05 00:12:38 2008 +0200 +++ b/dwt/widgets/MessageBox.d Sat May 17 17:34:28 2008 +0200 @@ -42,6 +42,9 @@ * </p> */ public class MessageBox : Dialog { + + alias Dialog.checkStyle checkStyle; + String message = ""; private bool allowNullParent = false; @@ -86,7 +89,7 @@ * </ul> */ public this (Shell parent, int style) { - super (parent, checkStyle (style)); + super (parent, checkStyle (parent, checkStyle (style))); checkSubclass (); } @@ -95,8 +98,7 @@ +/ public this (int style) { allowNullParent = true; - super (parent, checkStyle (style)); - checkSubclass (); + this( null, style ); } // PORT // actually, the parent can be null @@ -107,7 +109,6 @@ } static int checkStyle (int style) { - if ((style & (DWT.PRIMARY_MODAL | DWT.APPLICATION_MODAL | DWT.SYSTEM_MODAL)) is 0) style |= DWT.APPLICATION_MODAL; int mask = (DWT.YES | DWT.NO | DWT.OK | DWT.CANCEL | DWT.ABORT | DWT.RETRY | DWT.IGNORE); int bits = style & mask; if (bits is DWT.OK || bits is DWT.CANCEL || bits is (DWT.OK | DWT.CANCEL)) return style; @@ -200,12 +201,12 @@ * parent be temporarily modal. */ HWND hwndOwner = parent !is null ? parent.handle : null; - Shell oldModal = null; + Dialog oldModal = null; Display display = null; if ((bits & OS.MB_TASKMODAL) !is 0) { display = ( allowNullParent && parent is null ) ? Display.getCurrent() : parent.getDisplay (); - oldModal = display.getModalDialogShell (); - display.setModalDialogShell (parent); + oldModal = display.getModalDialog (); + display.setModalDialog (this); } /* Open the message box */ @@ -216,7 +217,7 @@ /* Clear the temporarily dialog modal parent */ if ((bits & OS.MB_TASKMODAL) !is 0) { - display.setModalDialogShell (oldModal); + display.setModalDialog (oldModal); } /*