diff dwtx/jface/dialogs/Dialog.d @ 70:46a6e0e6ccd4

Merge with d-fied sources of 3.4M7
author Frank Benoit <benoit@tionex.de>
date Thu, 22 May 2008 01:36:46 +0200
parents f44bd8465f2f
children 0aafcf6e5217
line wrap: on
line diff
--- a/dwtx/jface/dialogs/Dialog.d	Mon May 19 13:41:06 2008 +0200
+++ b/dwtx/jface/dialogs/Dialog.d	Thu May 22 01:36:46 2008 +0200
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Remy Chi Jian Suen <remy.suen@gmail.com> - Bug 218553 [JFace] mis-spelling of their in applyDialogFont(...)
  * Port to the D programming language:
  *     Frank Benoit <benoit@tionex.de>
  *******************************************************************************/
@@ -450,8 +451,13 @@
      */
     protected this(IShellProvider parentShell) {
         super(parentShell);
-        setShellStyle(DWT.DIALOG_TRIM | DWT.APPLICATION_MODAL
-                | getDefaultOrientation());
+        if (isResizable()) {
+            setShellStyle(DWT.DIALOG_TRIM | DWT.APPLICATION_MODAL | DWT.MAX | DWT.RESIZE
+                    | getDefaultOrientation());
+        } else {
+            setShellStyle(DWT.DIALOG_TRIM | DWT.APPLICATION_MODAL
+                    | getDefaultOrientation());
+        }
         setBlockOnOpen(true);
     }
 
@@ -1009,7 +1015,7 @@
     }
 
     /**
-     * Sets the dialog font on the control and any of its children if thier font
+     * Sets the dialog font on the control and any of its children if their font
      * is not otherwise set.
      *
      * @param control
@@ -1283,5 +1289,31 @@
         // constraining behavior in Window will be used.
         return result;
     }
-
+    
+    /**
+     * Returns a bool indicating whether the dialog should be
+     * considered resizable when the shell style is initially
+     * set.  
+     * 
+     * This method is used to ensure that all style 
+     * bits appropriate for resizable dialogs are added to the 
+     * shell style.  Individual dialogs may always set the shell 
+     * style to ensure that a dialog is resizable, but using this
+     * method ensures that resizable dialogs will be created with
+     * the same set of style bits.
+     * 
+     * Style bits will never be removed based on the return value 
+     * of this method.  For example, if a dialog returns 
+     * <code>false</code>, but also sets a style bit for a 
+     * DWT.RESIZE border, the style bit will be honored.
+     * 
+     * @return a bool indicating whether the dialog is 
+     * resizable and should have the default style bits for
+     * resizable dialogs
+     * 
+     * @since 3.4
+     */
+    protected bool isResizable() {
+        return false;
+    }
 }