Mercurial > projects > dwt-win
comparison dwt/widgets/Button.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 |
---|---|
1022 * | 1022 * |
1023 * @since 3.3 | 1023 * @since 3.3 |
1024 */ | 1024 */ |
1025 /*public*/ void setMessage (String message) { | 1025 /*public*/ void setMessage (String message) { |
1026 checkWidget (); | 1026 checkWidget (); |
1027 if (message is null) error (DWT.ERROR_NULL_ARGUMENT); | 1027 // DWT externsion: allow null string |
1028 //if (message is null) error (DWT.ERROR_NULL_ARGUMENT); | |
1028 this.message = message; | 1029 this.message = message; |
1029 if (OS.COMCTL32_VERSION >= OS.VERSION (6, 1)) { | 1030 if (OS.COMCTL32_VERSION >= OS.VERSION (6, 1)) { |
1030 if ((style & DWT.COMMAND) !is 0) { | 1031 if ((style & DWT.COMMAND) !is 0) { |
1031 OS.SendMessage (handle, OS.BCM_SETNOTE, 0, StrToTCHARz( message )); | 1032 OS.SendMessage (handle, OS.BCM_SETNOTE, 0, StrToTCHARz( message )); |
1032 } | 1033 } |
1107 * a Button that has an image and text set into it will display the | 1108 * a Button that has an image and text set into it will display the |
1108 * image or text that was set most recently. | 1109 * image or text that was set most recently. |
1109 * </p> | 1110 * </p> |
1110 * @param string the new text | 1111 * @param string the new text |
1111 * | 1112 * |
1112 * @exception IllegalArgumentException <ul> | |
1113 * <li>ERROR_NULL_ARGUMENT - if the text is null</li> | |
1114 * </ul> | |
1115 * @exception DWTException <ul> | 1113 * @exception DWTException <ul> |
1116 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> | 1114 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
1117 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> | 1115 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
1118 * </ul> | 1116 * </ul> |
1119 */ | 1117 */ |
1120 public void setText (String string) { | 1118 public void setText (String string) { |
1121 checkWidget (); | 1119 checkWidget (); |
1122 if (string is null) error (DWT.ERROR_NULL_ARGUMENT); | 1120 // DWT externsion: allow null string |
1121 //if (string is null) error (DWT.ERROR_NULL_ARGUMENT); | |
1123 if ((style & DWT.ARROW) !is 0) return; | 1122 if ((style & DWT.ARROW) !is 0) return; |
1124 text = string; | 1123 text = string; |
1125 /* This code is intentionally commented */ | 1124 /* This code is intentionally commented */ |
1126 // if (OS.COMCTL32_MAJOR < 6) { | 1125 // if (OS.COMCTL32_MAJOR < 6) { |
1127 // if (text.length is 0 && image !is null) { | 1126 // if (text.length is 0 && image !is null) { |