comparison dwt/widgets/CoolBar.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
813 * @exception DWTException <ul> 813 * @exception DWTException <ul>
814 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 814 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
815 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> 815 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
816 * </ul> 816 * </ul>
817 * @exception IllegalArgumentException <ul> 817 * @exception IllegalArgumentException <ul>
818 * <li>ERROR_NULL_ARGUMENT - if item order or sizes is null</li>
819 * <li>ERROR_INVALID_ARGUMENT - if item order or sizes is not the same length as the number of items</li> 818 * <li>ERROR_INVALID_ARGUMENT - if item order or sizes is not the same length as the number of items</li>
820 * </ul> 819 * </ul>
821 */ 820 */
822 public void setItemLayout (int [] itemOrder, int [] wrapIndices, Point [] sizes) { 821 public void setItemLayout (int [] itemOrder, int [] wrapIndices, Point [] sizes) {
823 checkWidget (); 822 checkWidget ();
839 * @exception DWTException <ul> 838 * @exception DWTException <ul>
840 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 839 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
841 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> 840 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
842 * </ul> 841 * </ul>
843 * @exception IllegalArgumentException <ul> 842 * @exception IllegalArgumentException <ul>
844 * <li>ERROR_NULL_ARGUMENT - if the item order is null</li>
845 * <li>ERROR_INVALID_ARGUMENT - if the item order is not the same length as the number of items</li> 843 * <li>ERROR_INVALID_ARGUMENT - if the item order is not the same length as the number of items</li>
846 * </ul> 844 * </ul>
847 */ 845 */
848 void setItemOrder (int [] itemOrder) { 846 void setItemOrder (int [] itemOrder) {
849 if (itemOrder is null) error (DWT.ERROR_NULL_ARGUMENT); 847 // DWT extension: allow null array
848 //if (itemOrder is null) error (DWT.ERROR_NULL_ARGUMENT);
850 int itemCount = OS.SendMessage (handle, OS.RB_GETBANDCOUNT, 0, 0); 849 int itemCount = OS.SendMessage (handle, OS.RB_GETBANDCOUNT, 0, 0);
851 if (itemOrder.length !is itemCount) error (DWT.ERROR_INVALID_ARGUMENT); 850 if (itemOrder.length !is itemCount) error (DWT.ERROR_INVALID_ARGUMENT);
852 851
853 /* Ensure that itemOrder does not contain any duplicates. */ 852 /* Ensure that itemOrder does not contain any duplicates. */
854 bool [] set = new bool [itemCount]; 853 bool [] set = new bool [itemCount];
903 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 902 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
904 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> 903 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
905 * </ul> 904 * </ul>
906 */ 905 */
907 void setItemSizes (Point [] sizes) { 906 void setItemSizes (Point [] sizes) {
908 if (sizes is null) error (DWT.ERROR_NULL_ARGUMENT); 907 // DWT extension: allow null array
908 //if (sizes is null) error (DWT.ERROR_NULL_ARGUMENT);
909 int count = OS.SendMessage (handle, OS.RB_GETBANDCOUNT, 0, 0); 909 int count = OS.SendMessage (handle, OS.RB_GETBANDCOUNT, 0, 0);
910 if (sizes.length !is count) error (DWT.ERROR_INVALID_ARGUMENT); 910 if (sizes.length !is count) error (DWT.ERROR_INVALID_ARGUMENT);
911 REBARBANDINFO rbBand; 911 REBARBANDINFO rbBand;
912 rbBand.cbSize = REBARBANDINFO.sizeof; 912 rbBand.cbSize = REBARBANDINFO.sizeof;
913 rbBand.fMask = OS.RBBIM_ID; 913 rbBand.fMask = OS.RBBIM_ID;