Mercurial > projects > dwt-mac
comparison dwt/widgets/Dialog.d @ 45:d8635bb48c7c
Merge with SWT 3.5
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Mon, 01 Dec 2008 17:07:00 +0100 |
parents | 5b53d338c709 |
children |
comparison
equal
deleted
inserted
replaced
44:ca5e494f2bbf | 45:d8635bb48c7c |
---|---|
1 /******************************************************************************* | 1 /******************************************************************************* |
2 * Copyright (c) 2000, 2005 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 * | 10 * |
11 * Port to the D programming language: | 11 * Port to the D programming language: |
12 * Jacob Carlborg <jacob.carlborg@gmail.com> | 12 * Jacob Carlborg <doob@me.com> |
13 *******************************************************************************/ | 13 *******************************************************************************/ |
14 module dwt.widgets.Dialog; | 14 module dwt.widgets.Dialog; |
15 | 15 |
16 | 16 |
17 import dwt.DWT; | 17 import dwt.DWT; |
78 * Note: Only one of the styles APPLICATION_MODAL, PRIMARY_MODAL, | 78 * Note: Only one of the styles APPLICATION_MODAL, PRIMARY_MODAL, |
79 * and SYSTEM_MODAL may be specified. | 79 * and SYSTEM_MODAL may be specified. |
80 * </p> | 80 * </p> |
81 * | 81 * |
82 * @see Shell | 82 * @see Shell |
83 * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ControlExample</a> | |
84 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> | |
83 */ | 85 */ |
84 | 86 |
85 public abstract class Dialog { | 87 public abstract class Dialog { |
86 int style; | 88 int style; |
87 Shell parent; | 89 Shell parent; |
171 if (parent is null) error (DWT.ERROR_NULL_ARGUMENT); | 173 if (parent is null) error (DWT.ERROR_NULL_ARGUMENT); |
172 parent.checkWidget (); | 174 parent.checkWidget (); |
173 } | 175 } |
174 | 176 |
175 static int checkStyle (Shell parent, int style) { | 177 static int checkStyle (Shell parent, int style) { |
178 if ((style & (DWT.PRIMARY_MODAL | DWT.APPLICATION_MODAL | DWT.SYSTEM_MODAL)) is 0) { | |
179 style |= DWT.APPLICATION_MODAL; | |
180 } | |
176 style &= ~DWT.MIRRORED; | 181 style &= ~DWT.MIRRORED; |
177 if ((style & (DWT.LEFT_TO_RIGHT | DWT.RIGHT_TO_LEFT)) is 0) { | 182 if ((style & (DWT.LEFT_TO_RIGHT | DWT.RIGHT_TO_LEFT)) is 0) { |
178 if (parent !is null) { | 183 if (parent !is null) { |
179 if ((parent.style & DWT.LEFT_TO_RIGHT) !is 0) style |= DWT.LEFT_TO_RIGHT; | 184 if ((parent.style & DWT.LEFT_TO_RIGHT) !is 0) style |= DWT.LEFT_TO_RIGHT; |
180 if ((parent.style & DWT.RIGHT_TO_LEFT) !is 0) style |= DWT.RIGHT_TO_LEFT; | 185 if ((parent.style & DWT.RIGHT_TO_LEFT) !is 0) style |= DWT.RIGHT_TO_LEFT; |