comparison dwt/widgets/DirectoryDialog.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 43b41c7fe84a
comparison
equal deleted inserted replaced
212:ab60f3309436 213:36f5cb12e1a2
56 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li> 56 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
57 * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li> 57 * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
58 * </ul> 58 * </ul>
59 */ 59 */
60 public this (Shell parent) { 60 public this (Shell parent) {
61 this (parent, DWT.PRIMARY_MODAL); 61 this (parent, DWT.APPLICATION_MODAL);
62 } 62 }
63 63
64 /** 64 /**
65 * Constructs a new instance of this class given its parent 65 * Constructs a new instance of this class given its parent
66 * and a style value describing its behavior and appearance. 66 * and a style value describing its behavior and appearance.
84 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li> 84 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
85 * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li> 85 * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
86 * </ul> 86 * </ul>
87 */ 87 */
88 public this (Shell parent, int style) { 88 public this (Shell parent, int style) {
89 super (parent, style); 89 super (parent, checkStyle (parent, style));
90 checkSubclass (); 90 checkSubclass ();
91 } 91 }
92 92
93 extern(Windows)static int BrowseCallbackProc (HWND hwnd, uint uMsg, int lParam, int lpData) { 93 extern(Windows)static int BrowseCallbackProc (HWND hwnd, uint uMsg, int lParam, int lpData) {
94 DirectoryDialog pThis = cast(DirectoryDialog)cast(void*)lpData; 94 DirectoryDialog pThis = cast(DirectoryDialog)cast(void*)lpData;
191 int lpfn = callback.getAddress ();+/ 191 int lpfn = callback.getAddress ();+/
192 BFFCALLBACK lpfn = &BrowseCallbackProc; 192 BFFCALLBACK lpfn = &BrowseCallbackProc;
193 if (lpfn is null) DWT.error (DWT.ERROR_NO_MORE_CALLBACKS); 193 if (lpfn is null) DWT.error (DWT.ERROR_NO_MORE_CALLBACKS);
194 194
195 /* Make the parent shell be temporary modal */ 195 /* Make the parent shell be temporary modal */
196 Shell oldModal = null; 196 Dialog oldModal = null;
197 Display display = parent.getDisplay (); 197 Display display = parent.getDisplay ();
198 if ((style & (DWT.APPLICATION_MODAL | DWT.SYSTEM_MODAL)) !is 0) { 198 if ((style & (DWT.APPLICATION_MODAL | DWT.SYSTEM_MODAL)) !is 0) {
199 oldModal = display.getModalDialogShell (); 199 oldModal = display.getModalDialog ();
200 display.setModalDialogShell (parent); 200 display.setModalDialog (this);
201 } 201 }
202 202
203 directoryPath = null; 203 directoryPath = null;
204 BROWSEINFO lpbi; 204 BROWSEINFO lpbi;
205 lpbi.hwndOwner = hwndOwner; 205 lpbi.hwndOwner = hwndOwner;
243 if (OS.COMCTL32_MAJOR < 6) display.runMessages = oldRunMessages; 243 if (OS.COMCTL32_MAJOR < 6) display.runMessages = oldRunMessages;
244 OS.SetErrorMode (oldErrorMode); 244 OS.SetErrorMode (oldErrorMode);
245 245
246 /* Clear the temporary dialog modal parent */ 246 /* Clear the temporary dialog modal parent */
247 if ((style & (DWT.APPLICATION_MODAL | DWT.SYSTEM_MODAL)) !is 0) { 247 if ((style & (DWT.APPLICATION_MODAL | DWT.SYSTEM_MODAL)) !is 0) {
248 display.setModalDialogShell (oldModal); 248 display.setModalDialog (oldModal);
249 } 249 }
250 250
251 bool success = lpItemIdList !is null; 251 bool success = lpItemIdList !is null;
252 if (success) { 252 if (success) {
253 /* Use the character encoding for the default locale */ 253 /* Use the character encoding for the default locale */