Mercurial > projects > dwt-linux
comparison dwt/widgets/Tree.d @ 255:5a30aa9820f3
removed tango.stdc.stringz imports and allow null for arrays and string arguments.
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 15 Jun 2008 22:32:20 +0200 |
parents | ce446666f5a2 |
children | c0d810de7093 |
comparison
equal
deleted
inserted
replaced
254:8bca790583c3 | 255:5a30aa9820f3 |
---|---|
2818 * @exception DWTException <ul> | 2818 * @exception DWTException <ul> |
2819 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> | 2819 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
2820 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> | 2820 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
2821 * </ul> | 2821 * </ul> |
2822 * @exception IllegalArgumentException <ul> | 2822 * @exception IllegalArgumentException <ul> |
2823 * <li>ERROR_NULL_ARGUMENT - if the item order is null</li> | |
2824 * <li>ERROR_INVALID_ARGUMENT - if the item order is not the same length as the number of items</li> | 2823 * <li>ERROR_INVALID_ARGUMENT - if the item order is not the same length as the number of items</li> |
2825 * </ul> | 2824 * </ul> |
2826 * | 2825 * |
2827 * @see Tree#getColumnOrder() | 2826 * @see Tree#getColumnOrder() |
2828 * @see TreeColumn#getMoveable() | 2827 * @see TreeColumn#getMoveable() |
2831 * | 2830 * |
2832 * @since 3.2 | 2831 * @since 3.2 |
2833 */ | 2832 */ |
2834 public void setColumnOrder (int [] order) { | 2833 public void setColumnOrder (int [] order) { |
2835 checkWidget (); | 2834 checkWidget (); |
2836 if (order is null) error (DWT.ERROR_NULL_ARGUMENT); | 2835 // DWT extension: allow null for zero length string |
2836 //if (order is null) error (DWT.ERROR_NULL_ARGUMENT); | |
2837 if (columnCount is 0) { | 2837 if (columnCount is 0) { |
2838 if (order.length > 0) error (DWT.ERROR_INVALID_ARGUMENT); | 2838 if (order.length > 0) error (DWT.ERROR_INVALID_ARGUMENT); |
2839 return; | 2839 return; |
2840 } | 2840 } |
2841 if (order.length !is columnCount) error (DWT.ERROR_INVALID_ARGUMENT); | 2841 if (order.length !is columnCount) error (DWT.ERROR_INVALID_ARGUMENT); |
2971 * </p> | 2971 * </p> |
2972 * | 2972 * |
2973 * @param items the array of items | 2973 * @param items the array of items |
2974 * | 2974 * |
2975 * @exception IllegalArgumentException <ul> | 2975 * @exception IllegalArgumentException <ul> |
2976 * <li>ERROR_NULL_ARGUMENT - if the array of items is null</li> | |
2977 * <li>ERROR_INVALID_ARGUMENT - if one of the items has been disposed</li> | 2976 * <li>ERROR_INVALID_ARGUMENT - if one of the items has been disposed</li> |
2978 * </ul> | 2977 * </ul> |
2979 * @exception DWTException <ul> | 2978 * @exception DWTException <ul> |
2980 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> | 2979 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
2981 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> | 2980 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
2983 * | 2982 * |
2984 * @see Tree#deselectAll() | 2983 * @see Tree#deselectAll() |
2985 */ | 2984 */ |
2986 public void setSelection (TreeItem [] items) { | 2985 public void setSelection (TreeItem [] items) { |
2987 checkWidget (); | 2986 checkWidget (); |
2988 if (items is null) error (DWT.ERROR_NULL_ARGUMENT); | 2987 // DWT extension: allow null for zero length string |
2988 //if (items is null) error (DWT.ERROR_NULL_ARGUMENT); | |
2989 deselectAll (); | 2989 deselectAll (); |
2990 int length = items.length; | 2990 int length = items.length; |
2991 if (length is 0 || ((style & DWT.SINGLE) !is 0 && length > 1)) return; | 2991 if (length is 0 || ((style & DWT.SINGLE) !is 0 && length > 1)) return; |
2992 bool fixColumn = showFirstColumn (); | 2992 bool fixColumn = showFirstColumn (); |
2993 auto selection = OS.gtk_tree_view_get_selection (handle); | 2993 auto selection = OS.gtk_tree_view_get_selection (handle); |