Mercurial > projects > dwt-mac
comparison dwt/widgets/Dialog.d @ 15:2952d5604c0a
Ported some widgets, added some stuff to the runtime bindings
author | Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com> |
---|---|
date | Fri, 29 Aug 2008 21:46:05 +0200 |
parents | 380af2bdd8e5 |
children | 5b53d338c709 |
comparison
equal
deleted
inserted
replaced
14:762fbe6f17d3 | 15:2952d5604c0a |
---|---|
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 * | |
11 * Port to the D programming language: | |
12 * Jacob Carlborg <jacob.carlborg@gmail.com> | |
10 *******************************************************************************/ | 13 *******************************************************************************/ |
11 module dwt.widgets.Dialog; | 14 module dwt.widgets.Dialog; |
12 | 15 |
13 import dwt.dwthelper.utils; | |
14 | |
15 | 16 |
16 import dwt.DWT; | 17 import dwt.DWT; |
17 import dwt.DWTException; | 18 import dwt.DWTException; |
19 | |
20 import dwt.dwthelper.utils; | |
21 import dwt.widgets.Display; | |
22 import dwt.widgets.Shell; | |
23 import dwt.widgets.Widget; | |
18 | 24 |
19 /** | 25 /** |
20 * This class is the abstract superclass of the classes | 26 * This class is the abstract superclass of the classes |
21 * that represent the built in platform dialogs. | 27 * that represent the built in platform dialogs. |
22 * A <code>Dialog</code> typically contains other widgets | 28 * A <code>Dialog</code> typically contains other widgets |
92 * </ul> | 98 * </ul> |
93 * @exception DWTException <ul> | 99 * @exception DWTException <ul> |
94 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li> | 100 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li> |
95 * </ul> | 101 * </ul> |
96 */ | 102 */ |
97 public Dialog (Shell parent) { | 103 public this (Shell parent) { |
98 this (parent, DWT.PRIMARY_MODAL); | 104 this (parent, DWT.PRIMARY_MODAL); |
99 } | 105 } |
100 | 106 |
101 /** | 107 /** |
102 * Constructs a new instance of this class given its parent | 108 * Constructs a new instance of this class given its parent |
122 * | 128 * |
123 * @see DWT#PRIMARY_MODAL | 129 * @see DWT#PRIMARY_MODAL |
124 * @see DWT#APPLICATION_MODAL | 130 * @see DWT#APPLICATION_MODAL |
125 * @see DWT#SYSTEM_MODAL | 131 * @see DWT#SYSTEM_MODAL |
126 */ | 132 */ |
127 public Dialog (Shell parent, int style) { | 133 public this (Shell parent, int style) { |
128 checkParent (parent); | 134 checkParent (parent); |
129 this.parent = parent; | 135 this.parent = parent; |
130 this.style = style; | 136 this.style = style; |
131 title = ""; | 137 title = ""; |
132 } | 138 } |
142 * </ul> | 148 * </ul> |
143 * | 149 * |
144 * @see Widget#checkSubclass | 150 * @see Widget#checkSubclass |
145 */ | 151 */ |
146 protected void checkSubclass () { | 152 protected void checkSubclass () { |
147 if (!Display.isValidClass (getClass ())) { | 153 if (!Display.isValidClass (this.classinfo)) { |
148 error (DWT.ERROR_INVALID_SUBCLASS); | 154 error (DWT.ERROR_INVALID_SUBCLASS); |
149 } | 155 } |
150 } | 156 } |
151 | 157 |
152 /** | 158 /** |
254 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> | 260 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
255 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> | 261 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
256 * </ul> | 262 * </ul> |
257 */ | 263 */ |
258 public void setText (String string) { | 264 public void setText (String string) { |
259 if (string is null) error (DWT.ERROR_NULL_ARGUMENT); | 265 //if (string is null) error (DWT.ERROR_NULL_ARGUMENT); |
260 title = string; | 266 title = string; |
261 } | 267 } |
262 | 268 |
263 } | 269 } |