comparison 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
comparison
equal deleted inserted replaced
69:07b9d96fd764 70:46a6e0e6ccd4
1 /******************************************************************************* 1 /*******************************************************************************
2 * Copyright (c) 2000, 2007 IBM Corporation and others. 2 * Copyright (c) 2000, 2008 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials 3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0 4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at 5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html 6 * http://www.eclipse.org/legal/epl-v10.html
7 * 7 *
8 * Contributors: 8 * Contributors:
9 * IBM Corporation - initial API and implementation 9 * IBM Corporation - initial API and implementation
10 * Remy Chi Jian Suen <remy.suen@gmail.com> - Bug 218553 [JFace] mis-spelling of their in applyDialogFont(...)
10 * Port to the D programming language: 11 * Port to the D programming language:
11 * Frank Benoit <benoit@tionex.de> 12 * Frank Benoit <benoit@tionex.de>
12 *******************************************************************************/ 13 *******************************************************************************/
13 module dwtx.jface.dialogs.Dialog; 14 module dwtx.jface.dialogs.Dialog;
14 15
448 * 449 *
449 * @since 3.1 450 * @since 3.1
450 */ 451 */
451 protected this(IShellProvider parentShell) { 452 protected this(IShellProvider parentShell) {
452 super(parentShell); 453 super(parentShell);
453 setShellStyle(DWT.DIALOG_TRIM | DWT.APPLICATION_MODAL 454 if (isResizable()) {
454 | getDefaultOrientation()); 455 setShellStyle(DWT.DIALOG_TRIM | DWT.APPLICATION_MODAL | DWT.MAX | DWT.RESIZE
456 | getDefaultOrientation());
457 } else {
458 setShellStyle(DWT.DIALOG_TRIM | DWT.APPLICATION_MODAL
459 | getDefaultOrientation());
460 }
455 setBlockOnOpen(true); 461 setBlockOnOpen(true);
456 } 462 }
457 463
458 /** 464 /**
459 * Notifies that this dialog's button with the given id has been pressed. 465 * Notifies that this dialog's button with the given id has been pressed.
1007 Font dialogFont = JFaceResources.getDialogFont(); 1013 Font dialogFont = JFaceResources.getDialogFont();
1008 applyDialogFont(control, dialogFont); 1014 applyDialogFont(control, dialogFont);
1009 } 1015 }
1010 1016
1011 /** 1017 /**
1012 * Sets the dialog font on the control and any of its children if thier font 1018 * Sets the dialog font on the control and any of its children if their font
1013 * is not otherwise set. 1019 * is not otherwise set.
1014 * 1020 *
1015 * @param control 1021 * @param control
1016 * the control to apply the font to. Font will also be applied to 1022 * the control to apply the font to. Font will also be applied to
1017 * its children. 1023 * its children.
1281 } 1287 }
1282 // No attempt is made to constrain the bounds. The default 1288 // No attempt is made to constrain the bounds. The default
1283 // constraining behavior in Window will be used. 1289 // constraining behavior in Window will be used.
1284 return result; 1290 return result;
1285 } 1291 }
1286 1292
1293 /**
1294 * Returns a bool indicating whether the dialog should be
1295 * considered resizable when the shell style is initially
1296 * set.
1297 *
1298 * This method is used to ensure that all style
1299 * bits appropriate for resizable dialogs are added to the
1300 * shell style. Individual dialogs may always set the shell
1301 * style to ensure that a dialog is resizable, but using this
1302 * method ensures that resizable dialogs will be created with
1303 * the same set of style bits.
1304 *
1305 * Style bits will never be removed based on the return value
1306 * of this method. For example, if a dialog returns
1307 * <code>false</code>, but also sets a style bit for a
1308 * DWT.RESIZE border, the style bit will be honored.
1309 *
1310 * @return a bool indicating whether the dialog is
1311 * resizable and should have the default style bits for
1312 * resizable dialogs
1313 *
1314 * @since 3.4
1315 */
1316 protected bool isResizable() {
1317 return false;
1318 }
1287 } 1319 }