Changeset 243:ecb80b2a89e1

Show
Ignore:
Timestamp:
06/28/08 14:18:36 (4 months ago)
Author:
Frank Benoit <benoit@tionex.de>
branch:
default
Message:

work on allow null strings and arrays

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • dwt/widgets/Table.d

    r237 r243  
    11241124 * @exception IllegalArgumentException <ul> 
    11251125 *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li> 
    1126  *    <li>ERROR_NULL_ARGUMENT - if the indices array is null</li> 
    11271126 * </ul> 
    11281127 * @exception DWTException <ul> 
     
    11381137public void clear (int [] indices) { 
    11391138    checkWidget (); 
    1140     if (indices is null) error (DWT.ERROR_NULL_ARGUMENT); 
     1139    // DWT extension: allow null array 
     1140    //if (indices is null) error (DWT.ERROR_NULL_ARGUMENT); 
    11411141    if (indices.length is 0) return; 
    11421142    int count = OS.SendMessage (handle, OS.LVM_GETITEMCOUNT, 0, 0); 
     
    16781678 * @param indices the array of indices for the items to deselect 
    16791679 * 
    1680  * @exception IllegalArgumentException <ul> 
    1681  *    <li>ERROR_NULL_ARGUMENT - if the set of indices is null</li> 
    1682  * </ul> 
    16831680 * @exception DWTException <ul> 
    16841681 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 
     
    16881685public void deselect (int [] indices) { 
    16891686    checkWidget (); 
    1690     if (indices is null) error (DWT.ERROR_NULL_ARGUMENT); 
     1687    // DWT extension: allow null array 
     1688    //if (indices is null) error (DWT.ERROR_NULL_ARGUMENT); 
    16911689    if (indices.length is 0) return; 
    16921690    LVITEM lvItem; 
     
    29142912 * @exception IllegalArgumentException <ul> 
    29152913 *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li> 
    2916  *    <li>ERROR_NULL_ARGUMENT - if the indices array is null</li> 
    29172914 * </ul> 
    29182915 * @exception DWTException <ul> 
     
    29232920public void remove (int [] indices) { 
    29242921    checkWidget (); 
    2925     if (indices is null) error (DWT.ERROR_NULL_ARGUMENT); 
     2922    // DWT extension: allow null array 
     2923    //if (indices is null) error (DWT.ERROR_NULL_ARGUMENT); 
    29262924    if (indices.length is 0) return; 
    29272925    int [] newIndices = new int [indices.length]; 
     
    31353133 * @param indices the array of indices for the items to select 
    31363134 * 
    3137  * @exception IllegalArgumentException <ul> 
    3138  *    <li>ERROR_NULL_ARGUMENT - if the array of indices is null</li> 
    3139  * </ul> 
    31403135 * @exception DWTException <ul> 
    31413136 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 
     
    31473142public void select (int [] indices) { 
    31483143    checkWidget (); 
    3149     if (indices is null) error (DWT.ERROR_NULL_ARGUMENT); 
     3144    // DWT extension: allow null array 
     3145    //if (indices is null) error (DWT.ERROR_NULL_ARGUMENT); 
    31503146    int length = indices.length; 
    31513147    if (length is 0 || ((style & DWT.SINGLE) !is 0 && length > 1)) return; 
     
    39633959 * </ul> 
    39643960 * @exception IllegalArgumentException <ul> 
    3965  *    <li>ERROR_NULL_ARGUMENT - if the item order is null</li> 
    39663961 *    <li>ERROR_INVALID_ARGUMENT - if the item order is not the same length as the number of items</li> 
    39673962 * </ul> 
     
    39763971public void setColumnOrder (int [] order) { 
    39773972    checkWidget (); 
    3978     if (order is null) error (DWT.ERROR_NULL_ARGUMENT); 
     3973    // DWT extension: allow null array 
     3974    //if (order is null) error (DWT.ERROR_NULL_ARGUMENT); 
    39793975    auto hwndHeader = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0); 
    39803976    if (columnCount is 0) { 
     
    46994695 * @param indices the indices of the items to select 
    47004696 * 
    4701  * @exception IllegalArgumentException <ul> 
    4702  *    <li>ERROR_NULL_ARGUMENT - if the array of indices is null</li> 
    4703  * </ul> 
    47044697 * @exception DWTException <ul> 
    47054698 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 
     
    47124705public void setSelection (int [] indices) { 
    47134706    checkWidget (); 
    4714     if (indices is null) error (DWT.ERROR_NULL_ARGUMENT); 
     4707    // DWT extension: allow null array 
     4708    //if (indices is null) error (DWT.ERROR_NULL_ARGUMENT); 
    47154709    deselectAll (); 
    47164710    int length = indices.length; 
     
    47604754 * 
    47614755 * @exception IllegalArgumentException <ul> 
    4762  *    <li>ERROR_NULL_ARGUMENT - if the array of items is null</li> 
    47634756 *    <li>ERROR_INVALID_ARGUMENT - if one of the items has been disposed</li> 
    47644757 * </ul> 
     
    47744767public void setSelection (TableItem [] items) { 
    47754768    checkWidget (); 
    4776     if (items is null) error (DWT.ERROR_NULL_ARGUMENT); 
     4769    // DWT extension: allow null array 
     4770    //if (items is null) error (DWT.ERROR_NULL_ARGUMENT); 
    47774771    deselectAll (); 
    47784772    int length = items.length; 
  • dwt/widgets/TableColumn.d

    r213 r243  
    781781override public void setText (String string) { 
    782782    checkWidget (); 
    783     if (string is null) error (DWT.ERROR_NULL_ARGUMENT); 
    784     if (string==/*eq*/text) return; 
     783    // DWT extension: allow null string 
     784    //if (string is null) error (DWT.ERROR_NULL_ARGUMENT); 
     785    if (string.equals (text)) return; 
    785786    int index = parent.indexOf (this); 
    786787    if (index is -1) return; 
  • dwt/widgets/Text.d

    r237 r243  
    337337 * @param string the string to be appended 
    338338 * 
    339  * @exception IllegalArgumentException <ul> 
    340  *    <li>ERROR_NULL_ARGUMENT - if the string is null</li> 
    341  * </ul> 
    342339 * @exception DWTException <ul> 
    343340 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 
     
    347344public void append (String string) { 
    348345    checkWidget (); 
    349     if (string is null) error (DWT.ERROR_NULL_ARGUMENT); 
     346    // DWT extension: allow null string 
     347    //if (string is null) error (DWT.ERROR_NULL_ARGUMENT); 
    350348    string = Display.withCrLf (string); 
    351349    int length = OS.GetWindowTextLength (handle); 
     
    12101208 * @param string the string 
    12111209 * 
    1212  * @exception IllegalArgumentException <ul> 
    1213  *    <li>ERROR_NULL_ARGUMENT - if the string is <code>null</code></li> 
    1214  * </ul> 
    12151210 * @exception DWTException <ul> 
    12161211 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 
     
    12201215public void insert (String string) { 
    12211216    checkWidget (); 
    1222     if (string is null) error (DWT.ERROR_NULL_ARGUMENT); 
     1217    // DWT extension: allow null string 
     1218    //if (string is null) error (DWT.ERROR_NULL_ARGUMENT); 
    12231219    string = Display.withCrLf (string); 
    12241220    if (hooks (DWT.Verify) || filters (DWT.Verify)) { 
     
    16581654 * @param message the new message 
    16591655 * 
    1660  * @exception IllegalArgumentException <ul> 
    1661  *    <li>ERROR_NULL_ARGUMENT - if the message is null</li> 
    1662  * </ul> 
    16631656 * @exception DWTException <ul> 
    16641657 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 
     
    16701663public void setMessage (String message) { 
    16711664    checkWidget (); 
    1672     if (message is null) error (DWT.ERROR_NULL_ARGUMENT); 
     1665    // DWT extension: allow null string 
     1666    //if (message is null) error (DWT.ERROR_NULL_ARGUMENT); 
    16731667    this.message = message; 
    16741668    if (OS.COMCTL32_MAJOR >= 6) { 
     
    18781872 * @param string the new text 
    18791873 * 
    1880  * @exception IllegalArgumentException <ul> 
    1881  *    <li>ERROR_NULL_ARGUMENT - if the string is null</li> 
    1882  * </ul> 
    18831874 * @exception DWTException <ul> 
    18841875 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 
     
    18881879public void setText (String string) { 
    18891880    checkWidget (); 
    1890     if (string is null) error (DWT.ERROR_NULL_ARGUMENT); 
     1881    // DWT extension: allow null string 
     1882    //if (string is null) error (DWT.ERROR_NULL_ARGUMENT); 
    18911883    string = Display.withCrLf (string); 
    18921884    if (hooks (DWT.Verify) || filters (DWT.Verify)) { 
  • dwt/widgets/ToolItem.d

    r213 r243  
    761761 * @param string the new text 
    762762 * 
    763  * @exception IllegalArgumentException <ul> 
    764  *    <li>ERROR_NULL_ARGUMENT - if the text is null</li> 
    765  * </ul> 
    766763 * @exception DWTException <ul> 
    767764 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 
     
    771768override public void setText (String string) { 
    772769    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); 
    774772    if ((style & DWT.SEPARATOR) !is 0) return; 
    775     if (string==/*eq*/text) return; 
     773    if (string.equals(text)) return; 
    776774    super.setText (string); 
    777775    auto hwnd = parent.handle; 
  • dwt/widgets/ToolTip.d

    r213 r243  
    395395 * @param string the new message 
    396396 * 
    397  * @exception IllegalArgumentException <ul> 
    398  *    <li>ERROR_NULL_ARGUMENT - if the text is null</li> 
    399  * </ul> 
    400397 * @exception DWTException <ul> 
    401398 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 
     
    405402public void setMessage (String string) { 
    406403    checkWidget (); 
    407     if (string is null) error (DWT.ERROR_NULL_ARGUMENT); 
     404    // DWT extension: allow null string 
     405    //if (string is null) error (DWT.ERROR_NULL_ARGUMENT); 
    408406    message = string; 
    409407    //TODO - update when visible 
     
    415413 * @param string the new text 
    416414 * 
    417  * @exception IllegalArgumentException <ul> 
    418  *    <li>ERROR_NULL_ARGUMENT - if the text is null</li> 
    419  * </ul> 
    420415 * @exception DWTException <ul> 
    421416 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 
     
    425420public void setText (String string) { 
    426421    checkWidget (); 
    427     if (string is null) error (DWT.ERROR_NULL_ARGUMENT); 
     422    // DWT extension: allow null string 
     423    //if (string is null) error (DWT.ERROR_NULL_ARGUMENT); 
    428424    text = string; 
    429425    //TODO - update when visible 
  • dwt/widgets/Tracker.d

    r217 r243  
    803803 * 
    804804 * @exception IllegalArgumentException <ul> 
    805  *    <li>ERROR_NULL_ARGUMENT - if the set of rectangles is null or contains a null rectangle</li> 
     805 *    <li>ERROR_NULL_ARGUMENT - if the set of rectangles contains a null rectangle</li> 
    806806 * </ul> 
    807807 * @exception DWTException <ul> 
     
    812812public void setRectangles (Rectangle [] rectangles) { 
    813813    checkWidget (); 
    814     if (rectangles is null) error (DWT.ERROR_NULL_ARGUMENT); 
     814    // DWT extension: allow null array 
     815    //if (rectangles is null) error (DWT.ERROR_NULL_ARGUMENT); 
    815816    this.rectangles = new Rectangle [rectangles.length]; 
    816817    for (int i = 0; i < rectangles.length; i++) { 
  • dwt/widgets/Tree.d

    r237 r243  
    45214521 * </ul> 
    45224522 * @exception IllegalArgumentException <ul> 
    4523  *    <li>ERROR_NULL_ARGUMENT - if the item order is null</li> 
    45244523 *    <li>ERROR_INVALID_ARGUMENT - if the item order is not the same length as the number of items</li> 
    45254524 * </ul> 
     
    45344533public void setColumnOrder (int [] order) { 
    45354534    checkWidget (); 
    4536     if (order is null) error (DWT.ERROR_NULL_ARGUMENT); 
     4535    // DWT extension: allow null array 
     4536    //if (order is null) error (DWT.ERROR_NULL_ARGUMENT); 
    45374537    if (columnCount is 0) { 
    45384538        if (order.length !is 0) error (DWT.ERROR_INVALID_ARGUMENT); 
     
    49014901 * 
    49024902 * @exception IllegalArgumentException <ul> 
    4903  *    <li>ERROR_NULL_ARGUMENT - if the array of items is null</li> 
    49044903 *    <li>ERROR_INVALID_ARGUMENT - if one of the items has been disposed</li> 
    49054904 * </ul> 
     
    49134912public void setSelection (TreeItem [] items) { 
    49144913    checkWidget (); 
    4915     if (items is null) error (DWT.ERROR_NULL_ARGUMENT); 
     4914    // DWT extension: allow null array 
     4915    //if (items is null) error (DWT.ERROR_NULL_ARGUMENT); 
    49164916    int length = items.length; 
    49174917    if (length is 0 || ((style & DWT.SINGLE) !is 0 && length > 1)) { 
  • dwt/widgets/TreeColumn.d

    r237 r243  
    659659override public void setText (String string) { 
    660660    checkWidget (); 
    661     if (string is null) error (DWT.ERROR_NULL_ARGUMENT); 
     661    // DWT extension: allow null string 
     662    //if (string is null) error (DWT.ERROR_NULL_ARGUMENT); 
    662663    if (string.equals (text)) return; 
    663664    int index = parent.indexOf (this); 
  • dwt/widgets/TreeItem.d

    r237 r243  
    16311631 * 
    16321632 * @exception IllegalArgumentException <ul> 
    1633  *    <li>ERROR_NULL_ARGUMENT - if the array of images is null</li> 
    16341633 *    <li>ERROR_INVALID_ARGUMENT - if one of the images has been disposed</li> 
    16351634 * </ul> 
     
    16431642public void setImage (Image [] images) { 
    16441643    checkWidget(); 
    1645     if (images is null) error (DWT.ERROR_NULL_ARGUMENT); 
     1644    // DWT extension; allow null array 
     1645    //if (images is null) error (DWT.ERROR_NULL_ARGUMENT); 
    16461646    for (int i=0; i<images.length; i++) { 
    16471647        setImage (i, images [i]); 
     
    17511751 * @param strings the array of new strings 
    17521752 * 
    1753  * @exception IllegalArgumentException <ul> 
    1754  *    <li>ERROR_NULL_ARGUMENT - if the text is null</li> 
    1755  * </ul> 
    17561753 * @exception DWTException <ul> 
    17571754 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 
     
    17631760public void setText (String[] strings) { 
    17641761    checkWidget(); 
    1765     if (strings is null) error (DWT.ERROR_NULL_ARGUMENT); 
     1762    // DWT extension: allow null array 
     1763    //if (strings is null) error (DWT.ERROR_NULL_ARGUMENT); 
    17661764    for (int i=0; i<strings.length; i++) { 
    17671765        String string = strings [i]; 
     
    17761774 * @param string the new text 
    17771775 * 
    1778  * @exception IllegalArgumentException <ul> 
    1779  *    <li>ERROR_NULL_ARGUMENT - if the text is null</li> 
    1780  * </ul> 
    17811776 * @exception DWTException <ul> 
    17821777 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 
     
    17881783public void setText (int index, String string) { 
    17891784    checkWidget(); 
    1790     if (string is null) error (DWT.ERROR_NULL_ARGUMENT); 
     1785    // DWT extension: allow null string 
     1786    //if (string is null) error (DWT.ERROR_NULL_ARGUMENT); 
    17911787    if (index is 0) { 
    17921788        if (string==/*eq*/text) return; 
  • dwt/widgets/Widget.d

    r234 r243  
    569569 * @return the value of the property or null if it has not been set 
    570570 * 
    571  * @exception IllegalArgumentException <ul> 
    572  *    <li>ERROR_NULL_ARGUMENT - if the key is null</li> 
    573  * </ul> 
    574571 * @exception DWTException <ul> 
    575572 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 
     
    581578public Object getData (String key) { 
    582579    checkWidget(); 
    583     if (key is null) error (DWT.ERROR_NULL_ARGUMENT); 
     580    // DWT extension: allow null key 
     581    //if (key is null) error (DWT.ERROR_NULL_ARGUMENT); 
    584582    if ((state & KEYED_DATA) !is 0) { 
    585583        Object [] table = (cast(ArrayWrapperObject) data).array; 
     
    11441142 * @param value the new value for the property 
    11451143 * 
    1146  * @exception IllegalArgumentException <ul> 
    1147  *    <li>ERROR_NULL_ARGUMENT - if the key is null</li> 
    1148  * </ul> 
    11491144 * @exception DWTException <ul> 
    11501145 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 
     
    11561151public void setData (String key, Object value) { 
    11571152    checkWidget(); 
    1158     if (key.length is 0) error (DWT.ERROR_NULL_ARGUMENT); 
     1153    // DWT extension: allow null key 
     1154    //if (key.length is 0) error (DWT.ERROR_NULL_ARGUMENT); 
    11591155    int index = 1; 
    11601156    Object [] table = null;