comparison dwt/widgets/ToolItem.d @ 243:ecb80b2a89e1

work on allow null strings and arrays
author Frank Benoit <benoit@tionex.de>
date Sat, 28 Jun 2008 20:18:36 +0200
parents 36f5cb12e1a2
children fd9c62a2998e
comparison
equal deleted inserted replaced
242:32a6819fef61 243:ecb80b2a89e1
758 * '&amp;' to be displayed. 758 * '&amp;' to be displayed.
759 * </p> 759 * </p>
760 * 760 *
761 * @param string the new text 761 * @param string the new text
762 * 762 *
763 * @exception IllegalArgumentException <ul>
764 * <li>ERROR_NULL_ARGUMENT - if the text is null</li>
765 * </ul>
766 * @exception DWTException <ul> 763 * @exception DWTException <ul>
767 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 764 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
768 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> 765 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
769 * </ul> 766 * </ul>
770 */ 767 */
771 override public void setText (String string) { 768 override public void setText (String string) {
772 checkWidget(); 769 checkWidget();
773 if (string is null) error (DWT.ERROR_NULL_ARGUMENT); 770 // DWT extension: allow null string
771 //if (string is null) error (DWT.ERROR_NULL_ARGUMENT);
774 if ((style & DWT.SEPARATOR) !is 0) return; 772 if ((style & DWT.SEPARATOR) !is 0) return;
775 if (string==/*eq*/text) return; 773 if (string.equals(text)) return;
776 super.setText (string); 774 super.setText (string);
777 auto hwnd = parent.handle; 775 auto hwnd = parent.handle;
778 TBBUTTONINFO info; 776 TBBUTTONINFO info;
779 info.cbSize = TBBUTTONINFO.sizeof; 777 info.cbSize = TBBUTTONINFO.sizeof;
780 info.dwMask = OS.TBIF_TEXT | OS.TBIF_STYLE; 778 info.dwMask = OS.TBIF_TEXT | OS.TBIF_STYLE;