Changeset 180:772f75da6a52
- Timestamp:
- 03/09/08 06:03:57
(6 months ago)
- Author:
- Frank Benoit <benoit@tionex.de>
- branch:
- default
- Message:
Allow null argument for Label.setText
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r177 |
r180 |
|
| 321 | 321 | } |
|---|
| 322 | 322 | |
|---|
| | 323 | public char* toStringzValidPtr( char[] src ){ |
|---|
| | 324 | if( src ){ |
|---|
| | 325 | return src.toStringz(); |
|---|
| | 326 | } |
|---|
| | 327 | else{ |
|---|
| | 328 | static const char[] nullPtr = "\0"; |
|---|
| | 329 | return nullPtr.ptr; |
|---|
| | 330 | } |
|---|
| | 331 | } |
|---|
| | 332 | |
|---|
| 323 | 333 | static char[] toHex(uint value, bool prefix = true, int radix = 8){ |
|---|
| 324 | 334 | return tango.text.convert.Integer.toString( |
|---|
| r117 |
r180 |
|
| 395 | 395 | public void setText (char[] string) { |
|---|
| 396 | 396 | checkWidget (); |
|---|
| 397 | | if (string is null) error (DWT.ERROR_NULL_ARGUMENT); |
|---|
| | 397 | // DWT extension: allow null for zero length string |
|---|
| | 398 | //if (string is null) error (DWT.ERROR_NULL_ARGUMENT); |
|---|
| 398 | 399 | if ((style & DWT.SEPARATOR) !is 0) return; |
|---|
| 399 | 400 | /* |
|---|
| … | … | |
| 403 | 404 | * nothing. |
|---|
| 404 | 405 | */ |
|---|
| 405 | | if (string==/*eq*/text) return; |
|---|
| | 406 | if (string.equals(text)) return; |
|---|
| 406 | 407 | text = string; |
|---|
| 407 | 408 | if (image is null || !IMAGE_AND_TEXT) { |
|---|
| … | … | |
| 420 | 421 | } |
|---|
| 421 | 422 | string = Display.withCrLf (string); |
|---|
| 422 | | TCHAR* buffer = StrToTCHARz (/+getCodePage (),+/ string); |
|---|
| | 423 | TCHAR* buffer = StrToTCHARz ( getCodePage (), string); |
|---|
| 423 | 424 | OS.SetWindowText (handle, buffer); |
|---|
| 424 | 425 | /* |
|---|