diff dwt/widgets/Table.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 e2affbeb686d
children fd9c62a2998e
line wrap: on
line diff
--- a/dwt/widgets/Table.d	Tue Jun 24 22:05:28 2008 +0200
+++ b/dwt/widgets/Table.d	Sat Jun 28 20:18:36 2008 +0200
@@ -1123,7 +1123,6 @@
  *
  * @exception IllegalArgumentException <ul>
  *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
- *    <li>ERROR_NULL_ARGUMENT - if the indices array is null</li>
  * </ul>
  * @exception DWTException <ul>
  *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
@@ -1137,7 +1136,8 @@
  */
 public void clear (int [] indices) {
     checkWidget ();
-    if (indices is null) error (DWT.ERROR_NULL_ARGUMENT);
+    // DWT extension: allow null array
+    //if (indices is null) error (DWT.ERROR_NULL_ARGUMENT);
     if (indices.length is 0) return;
     int count = OS.SendMessage (handle, OS.LVM_GETITEMCOUNT, 0, 0);
     for (int i=0; i<indices.length; i++) {
@@ -1677,9 +1677,6 @@
  *
  * @param indices the array of indices for the items to deselect
  *
- * @exception IllegalArgumentException <ul>
- *    <li>ERROR_NULL_ARGUMENT - if the set of indices is null</li>
- * </ul>
  * @exception DWTException <ul>
  *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
@@ -1687,7 +1684,8 @@
  */
 public void deselect (int [] indices) {
     checkWidget ();
-    if (indices is null) error (DWT.ERROR_NULL_ARGUMENT);
+    // DWT extension: allow null array
+    //if (indices is null) error (DWT.ERROR_NULL_ARGUMENT);
     if (indices.length is 0) return;
     LVITEM lvItem;
     lvItem.stateMask = OS.LVIS_SELECTED;
@@ -2913,7 +2911,6 @@
  *
  * @exception IllegalArgumentException <ul>
  *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
- *    <li>ERROR_NULL_ARGUMENT - if the indices array is null</li>
  * </ul>
  * @exception DWTException <ul>
  *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
@@ -2922,7 +2919,8 @@
  */
 public void remove (int [] indices) {
     checkWidget ();
-    if (indices is null) error (DWT.ERROR_NULL_ARGUMENT);
+    // DWT extension: allow null array
+    //if (indices is null) error (DWT.ERROR_NULL_ARGUMENT);
     if (indices.length is 0) return;
     int [] newIndices = new int [indices.length];
     System.arraycopy (indices, 0, newIndices, 0, indices.length);
@@ -3134,9 +3132,6 @@
  *
  * @param indices the array of indices for the items to select
  *
- * @exception IllegalArgumentException <ul>
- *    <li>ERROR_NULL_ARGUMENT - if the array of indices is null</li>
- * </ul>
  * @exception DWTException <ul>
  *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
@@ -3146,7 +3141,8 @@
  */
 public void select (int [] indices) {
     checkWidget ();
-    if (indices is null) error (DWT.ERROR_NULL_ARGUMENT);
+    // DWT extension: allow null array
+    //if (indices is null) error (DWT.ERROR_NULL_ARGUMENT);
     int length = indices.length;
     if (length is 0 || ((style & DWT.SINGLE) !is 0 && length > 1)) return;
     LVITEM lvItem;
@@ -3962,7 +3958,6 @@
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  * </ul>
  * @exception IllegalArgumentException <ul>
- *    <li>ERROR_NULL_ARGUMENT - if the item order is null</li>
  *    <li>ERROR_INVALID_ARGUMENT - if the item order is not the same length as the number of items</li>
  * </ul>
  *
@@ -3975,7 +3970,8 @@
  */
 public void setColumnOrder (int [] order) {
     checkWidget ();
-    if (order is null) error (DWT.ERROR_NULL_ARGUMENT);
+    // DWT extension: allow null array
+    //if (order is null) error (DWT.ERROR_NULL_ARGUMENT);
     auto hwndHeader = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
     if (columnCount is 0) {
         if (order.length !is 0) error (DWT.ERROR_INVALID_ARGUMENT);
@@ -4698,9 +4694,6 @@
  *
  * @param indices the indices of the items to select
  *
- * @exception IllegalArgumentException <ul>
- *    <li>ERROR_NULL_ARGUMENT - if the array of indices is null</li>
- * </ul>
  * @exception DWTException <ul>
  *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
@@ -4711,7 +4704,8 @@
  */
 public void setSelection (int [] indices) {
     checkWidget ();
-    if (indices is null) error (DWT.ERROR_NULL_ARGUMENT);
+    // DWT extension: allow null array
+    //if (indices is null) error (DWT.ERROR_NULL_ARGUMENT);
     deselectAll ();
     int length = indices.length;
     if (length is 0 || ((style & DWT.SINGLE) !is 0 && length > 1)) return;
@@ -4759,7 +4753,6 @@
  * @param items the array of items
  *
  * @exception IllegalArgumentException <ul>
- *    <li>ERROR_NULL_ARGUMENT - if the array of items is null</li>
  *    <li>ERROR_INVALID_ARGUMENT - if one of the items has been disposed</li>
  * </ul>
  * @exception DWTException <ul>
@@ -4773,7 +4766,8 @@
  */
 public void setSelection (TableItem [] items) {
     checkWidget ();
-    if (items is null) error (DWT.ERROR_NULL_ARGUMENT);
+    // DWT extension: allow null array
+    //if (items is null) error (DWT.ERROR_NULL_ARGUMENT);
     deselectAll ();
     int length = items.length;
     if (length is 0 || ((style & DWT.SINGLE) !is 0 && length > 1)) return;