comparison dwt/widgets/Widget.d @ 309:8117dc3a8faa

String version for Widget getData,setData
author Frank Benoit <benoit@tionex.de>
date Mon, 15 Sep 2008 03:40:57 +0200
parents 810b16d6559b
children 27479f54069d
comparison
equal deleted inserted replaced
308:8d53428f9be0 309:8117dc3a8faa
552 */ 552 */
553 public Object getData () { 553 public Object getData () {
554 checkWidget(); 554 checkWidget();
555 return (state & KEYED_DATA) !is 0 ? (cast(ArrayWrapperObject) data).array [0] : data; 555 return (state & KEYED_DATA) !is 0 ? (cast(ArrayWrapperObject) data).array [0] : data;
556 } 556 }
557 public String getDataStr () {
558 return stringcast(getData());
559 }
557 560
558 /** 561 /**
559 * Returns the application defined property of the receiver 562 * Returns the application defined property of the receiver
560 * with the specified name, or null if it has not been set. 563 * with the specified name, or null if it has not been set.
561 * <p> 564 * <p>
586 String tablekey = (cast(ArrayWrapperString) table[i]).array; 589 String tablekey = (cast(ArrayWrapperString) table[i]).array;
587 if (key ==/*eq*/ tablekey ) return table [i+1]; 590 if (key ==/*eq*/ tablekey ) return table [i+1];
588 } 591 }
589 } 592 }
590 return null; 593 return null;
594 }
595 public String getDataStr (String key) {
596 return stringcast(getData(key));
591 } 597 }
592 598
593 /** 599 /**
594 * Returns the <code>Display</code> that is associated with 600 * Returns the <code>Display</code> that is associated with
595 * the receiver. 601 * the receiver.
1125 (cast(ArrayWrapperObject) this.data).array [0] = data; 1131 (cast(ArrayWrapperObject) this.data).array [0] = data;
1126 } else { 1132 } else {
1127 this.data = data; 1133 this.data = data;
1128 } 1134 }
1129 } 1135 }
1136 /// DWT extension
1137 public void setDataStr (String data) {
1138 setData(stringcast(data));
1139 }
1130 1140
1131 /** 1141 /**
1132 * Sets the application defined property of the receiver 1142 * Sets the application defined property of the receiver
1133 * with the specified name to the given value. 1143 * with the specified name to the given value.
1134 * <p> 1144 * <p>
1193 data = new ArrayWrapperObject( newTable ); 1203 data = new ArrayWrapperObject( newTable );
1194 } 1204 }
1195 } 1205 }
1196 } 1206 }
1197 } 1207 }
1208 }
1209 /// DWT extension
1210 public void setDataStr (String key, String value) {
1211 setData( key, stringcast(value));
1198 } 1212 }
1199 1213
1200 bool sendFocusEvent (int type) { 1214 bool sendFocusEvent (int type) {
1201 sendEvent (type); 1215 sendEvent (type);
1202 // widget could be disposed at this point 1216 // widget could be disposed at this point