Mercurial > projects > dwt-mac
comparison dwt/widgets/Item.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.Item; | 14 module dwt.widgets.Item; |
12 | |
13 import dwt.dwthelper.utils; | |
14 | 15 |
15 | 16 |
16 import dwt.DWT; | 17 import dwt.DWT; |
17 import dwt.DWTException; | 18 import dwt.DWTException; |
18 import dwt.graphics.Image; | 19 import dwt.graphics.Image; |
20 | |
21 import dwt.dwthelper.utils; | |
22 import dwt.widgets.Widget; | |
19 | 23 |
20 /** | 24 /** |
21 * This class is the abstract superclass of all non-windowed | 25 * This class is the abstract superclass of all non-windowed |
22 * user interface objects that occur within specific controls. | 26 * user interface objects that occur within specific controls. |
23 * For example, a tree will contain tree items. | 27 * For example, a tree will contain tree items. |
27 * <dt><b>Events:</b></dt> | 31 * <dt><b>Events:</b></dt> |
28 * <dd>(none)</dd> | 32 * <dd>(none)</dd> |
29 * </dl> | 33 * </dl> |
30 */ | 34 */ |
31 | 35 |
32 public abstract class Item extends Widget { | 36 public abstract class Item : Widget { |
33 String text; | 37 String text; |
34 Image image; | 38 Image image; |
35 | 39 |
36 /** | 40 /** |
37 * Constructs a new instance of this class given its parent | 41 * Constructs a new instance of this class given its parent |
58 * </ul> | 62 * </ul> |
59 * | 63 * |
60 * @see DWT | 64 * @see DWT |
61 * @see Widget#getStyle | 65 * @see Widget#getStyle |
62 */ | 66 */ |
63 public Item (Widget parent, int style) { | 67 public this (Widget parent, int style) { |
64 super (parent, style); | 68 super (parent, style); |
65 text = ""; | 69 text = ""; |
66 } | 70 } |
67 | 71 |
68 /** | 72 /** |
93 * </ul> | 97 * </ul> |
94 * | 98 * |
95 * @see DWT | 99 * @see DWT |
96 * @see Widget#getStyle | 100 * @see Widget#getStyle |
97 */ | 101 */ |
98 public Item (Widget parent, int style, int index) { | 102 public this (Widget parent, int style, int index) { |
99 this (parent, style); | 103 this (parent, style); |
100 } | 104 } |
101 | 105 |
102 protected void checkSubclass () { | 106 protected void checkSubclass () { |
103 /* Do Nothing - Subclassing is allowed */ | 107 /* Do Nothing - Subclassing is allowed */ |
178 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> | 182 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
179 * </ul> | 183 * </ul> |
180 */ | 184 */ |
181 public void setText (String string) { | 185 public void setText (String string) { |
182 checkWidget (); | 186 checkWidget (); |
183 if (string is null) error (DWT.ERROR_NULL_ARGUMENT); | 187 //if (string is null) error (DWT.ERROR_NULL_ARGUMENT); |
184 text = string; | 188 text = string; |
185 } | 189 } |
186 | 190 |
187 } | 191 } |