comparison dwt/widgets/Item.d @ 212:ab60f3309436

reverted the char[] to String and use the an alias.
author Frank Benoit <benoit@tionex.de>
date Mon, 05 May 2008 00:12:38 +0200
parents 0f25be5cbe6f
children b4846fd3437a
comparison
equal deleted inserted replaced
211:ff59aeb96cac 212:ab60f3309436
14 14
15 15
16 import dwt.widgets.Widget; 16 import dwt.widgets.Widget;
17 import dwt.DWT; 17 import dwt.DWT;
18 import dwt.graphics.Image; 18 import dwt.graphics.Image;
19 import dwt.dwthelper.utils;
19 20
20 /** 21 /**
21 * This class is the abstract superclass of all non-windowed 22 * This class is the abstract superclass of all non-windowed
22 * user interface objects that occur within specific controls. 23 * user interface objects that occur within specific controls.
23 * For example, a tree will contain tree items. 24 * For example, a tree will contain tree items.
28 * <dd>(none)</dd> 29 * <dd>(none)</dd>
29 * </dl> 30 * </dl>
30 */ 31 */
31 32
32 public abstract class Item : Widget { 33 public abstract class Item : Widget {
33 char[] text; 34 String text;
34 Image image; 35 Image image;
35 36
36 /** 37 /**
37 * Constructs a new instance of this class given its parent 38 * Constructs a new instance of this class given its parent
38 * and a style value describing its behavior and appearance. 39 * and a style value describing its behavior and appearance.
117 public Image getImage () { 118 public Image getImage () {
118 checkWidget (); 119 checkWidget ();
119 return image; 120 return image;
120 } 121 }
121 122
122 override char[] getNameText () { 123 override String getNameText () {
123 return getText (); 124 return getText ();
124 } 125 }
125 126
126 /** 127 /**
127 * Returns the receiver's text, which will be an empty 128 * Returns the receiver's text, which will be an empty
132 * @exception DWTException <ul> 133 * @exception DWTException <ul>
133 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 134 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
134 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> 135 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
135 * </ul> 136 * </ul>
136 */ 137 */
137 public char[] getText () { 138 public String getText () {
138 checkWidget(); 139 checkWidget();
139 return text; 140 return text;
140 } 141 }
141 142
142 override void releaseWidget () { 143 override void releaseWidget () {
176 * @exception DWTException <ul> 177 * @exception DWTException <ul>
177 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 178 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
178 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> 179 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
179 * </ul> 180 * </ul>
180 */ 181 */
181 public void setText (char[] string) { 182 public void setText (String string) {
182 checkWidget (); 183 checkWidget ();
183 if (string is null) error (DWT.ERROR_NULL_ARGUMENT); 184 if (string is null) error (DWT.ERROR_NULL_ARGUMENT);
184 text = string; 185 text = string;
185 } 186 }
186 187