comparison dwt/widgets/Decorations.d @ 239:43b41c7fe84a

work on allow null strings and arrays
author Frank Benoit <benoit@tionex.de>
date Fri, 20 Jun 2008 16:27:36 +0200
parents 36f5cb12e1a2
children fd9c62a2998e
comparison
equal deleted inserted replaced
238:efe25e7c8a96 239:43b41c7fe84a
1058 * different depth and transparency attributes. 1058 * different depth and transparency attributes.
1059 * 1059 *
1060 * @param images the new image array 1060 * @param images the new image array
1061 * 1061 *
1062 * @exception IllegalArgumentException <ul> 1062 * @exception IllegalArgumentException <ul>
1063 * <li>ERROR_NULL_ARGUMENT - if the array of images is null</li>
1064 * <li>ERROR_INVALID_ARGUMENT - if one of the images is null or has been disposed</li> 1063 * <li>ERROR_INVALID_ARGUMENT - if one of the images is null or has been disposed</li>
1065 * </ul> 1064 * </ul>
1066 * @exception DWTException <ul> 1065 * @exception DWTException <ul>
1067 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 1066 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
1068 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> 1067 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
1070 * 1069 *
1071 * @since 3.0 1070 * @since 3.0
1072 */ 1071 */
1073 public void setImages (Image [] images) { 1072 public void setImages (Image [] images) {
1074 checkWidget (); 1073 checkWidget ();
1075 if (images is null) error (DWT.ERROR_INVALID_ARGUMENT); 1074 // DWT extension: allow null array
1075 //if (images is null) error (DWT.ERROR_INVALID_ARGUMENT);
1076 for (int i = 0; i < images.length; i++) { 1076 for (int i = 0; i < images.length; i++) {
1077 if (images [i] is null || images [i].isDisposed ()) error (DWT.ERROR_INVALID_ARGUMENT); 1077 if (images [i] is null || images [i].isDisposed ()) error (DWT.ERROR_INVALID_ARGUMENT);
1078 } 1078 }
1079 this.images = images; 1079 this.images = images;
1080 setImages (null, images); 1080 setImages (null, images);
1326 * window manager will typically display as the receiver's 1326 * window manager will typically display as the receiver's
1327 * <em>title</em>, to the argument, which must not be null. 1327 * <em>title</em>, to the argument, which must not be null.
1328 * 1328 *
1329 * @param string the new text 1329 * @param string the new text
1330 * 1330 *
1331 * @exception IllegalArgumentException <ul>
1332 * <li>ERROR_NULL_ARGUMENT - if the text is null</li>
1333 * </ul>
1334 * @exception DWTException <ul> 1331 * @exception DWTException <ul>
1335 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 1332 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
1336 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> 1333 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
1337 * </ul> 1334 * </ul>
1338 */ 1335 */
1339 public void setText (String string) { 1336 public void setText (String string) {
1340 checkWidget (); 1337 checkWidget ();
1341 if (string is null) error (DWT.ERROR_NULL_ARGUMENT); 1338 // DWT extension: allow null string
1339 //if (string is null) error (DWT.ERROR_NULL_ARGUMENT);
1342 /* Use the character encoding for the default locale */ 1340 /* Use the character encoding for the default locale */
1343 TCHAR[] buffer = StrToTCHARs (string, true); 1341 TCHAR[] buffer = StrToTCHARs (string, true);
1344 /* Ensure that the title appears in the task bar.*/ 1342 /* Ensure that the title appears in the task bar.*/
1345 if ((state & FOREIGN_HANDLE) !is 0) { 1343 if ((state & FOREIGN_HANDLE) !is 0) {
1346 auto hHeap = OS.GetProcessHeap (); 1344 auto hHeap = OS.GetProcessHeap ();