comparison dwt/widgets/MenuItem.d @ 240:c84e3d3feb3f

allow null strings and arrays as arguments
author Frank Benoit <benoit@tionex.de>
date Sat, 21 Jun 2008 02:24:49 +0200
parents 36f5cb12e1a2
children fd9c62a2998e
comparison
equal deleted inserted replaced
239:43b41c7fe84a 240:c84e3d3feb3f
1030 * is installed using #setAccelerator. 1030 * is installed using #setAccelerator.
1031 * </p> 1031 * </p>
1032 * 1032 *
1033 * @param string the new text 1033 * @param string the new text
1034 * 1034 *
1035 * @exception IllegalArgumentException <ul>
1036 * <li>ERROR_NULL_ARGUMENT - if the text is null</li>
1037 * </ul>
1038 * @exception DWTException <ul> 1035 * @exception DWTException <ul>
1039 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 1036 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
1040 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> 1037 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
1041 * </ul> 1038 * </ul>
1042 * 1039 *
1043 * @see #setAccelerator 1040 * @see #setAccelerator
1044 */ 1041 */
1045 override public void setText (String string) { 1042 override public void setText (String string) {
1046 checkWidget (); 1043 checkWidget ();
1047 if (string is null) error (DWT.ERROR_NULL_ARGUMENT); 1044 // DWT extension: allow null string
1045 //if (string is null) error (DWT.ERROR_NULL_ARGUMENT);
1048 if ((style & DWT.SEPARATOR) !is 0) return; 1046 if ((style & DWT.SEPARATOR) !is 0) return;
1049 if (text==/*eq*/string ) return; 1047 if (text==/*eq*/string ) return;
1050 super.setText (string); 1048 super.setText (string);
1051 auto hHeap = OS.GetProcessHeap (); 1049 auto hHeap = OS.GetProcessHeap ();
1052 TCHAR* pszText; 1050 TCHAR* pszText;