comparison dwt/widgets/Dialog.d @ 240:ce446666f5a2

Update to SWT 3.4M7
author Frank Benoit <benoit@tionex.de>
date Mon, 12 May 2008 19:13:01 +0200
parents 380bad9f6852
children 5a30aa9820f3
comparison
equal deleted inserted replaced
239:06a1f6829310 240:ce446666f5a2
17 17
18 import dwt.DWT; 18 import dwt.DWT;
19 import dwt.DWTException; 19 import dwt.DWTException;
20 import dwt.widgets.Shell; 20 import dwt.widgets.Shell;
21 import dwt.widgets.Display; 21 import dwt.widgets.Display;
22 import dwt.widgets.Widget;
22 23
23 /** 24 /**
24 * This class is the abstract superclass of the classes 25 * This class is the abstract superclass of the classes
25 * that represent the built in platform dialogs. 26 * that represent the built in platform dialogs.
26 * A <code>Dialog</code> typically contains other widgets 27 * A <code>Dialog</code> typically contains other widgets
169 void checkParent (Shell parent) { 170 void checkParent (Shell parent) {
170 if (parent is null) error (DWT.ERROR_NULL_ARGUMENT); 171 if (parent is null) error (DWT.ERROR_NULL_ARGUMENT);
171 parent.checkWidget (); 172 parent.checkWidget ();
172 } 173 }
173 174
175 static int checkStyle (Shell parent, int style) {
176 if ((style & (DWT.PRIMARY_MODAL | DWT.APPLICATION_MODAL | DWT.SYSTEM_MODAL)) is 0) {
177 style |= DWT.APPLICATION_MODAL;
178 }
179 style &= ~DWT.MIRRORED;
180 if ((style & (DWT.LEFT_TO_RIGHT | DWT.RIGHT_TO_LEFT)) is 0) {
181 if (parent !is null) {
182 if ((parent.style & DWT.LEFT_TO_RIGHT) !is 0) style |= DWT.LEFT_TO_RIGHT;
183 if ((parent.style & DWT.RIGHT_TO_LEFT) !is 0) style |= DWT.RIGHT_TO_LEFT;
184 }
185 }
186 return Widget.checkBits (style, DWT.LEFT_TO_RIGHT, DWT.RIGHT_TO_LEFT, 0, 0, 0, 0);
187 }
188
174 /** 189 /**
175 * Does whatever dialog specific cleanup is required, and then 190 * Does whatever dialog specific cleanup is required, and then
176 * uses the code in <code>DWTError.error</code> to handle the error. 191 * uses the code in <code>DWTError.error</code> to handle the error.
177 * 192 *
178 * @param code the descriptive error code 193 * @param code the descriptive error code