rbBand.cx = MAX_WIDTH; rbBand.fMask = OS.RBBIM_SIZE; OS.SendMessage (handle, OS.RB_SETBANDINFO, i, rbBand);
resizeToMaximumWidth (i);
void setItemOrder (int [] itemOrder) {	if (itemOrder == null) error (SWT.ERROR_NULL_ARGUMENT);	int itemCount = OS.SendMessage (handle, OS.RB_GETBANDCOUNT, 0, 0);	if (itemOrder.length != itemCount) error (SWT.ERROR_INVALID_ARGUMENT);		/* Ensure that itemOrder does not contain any duplicates. */	boolean [] set = new boolean [itemCount];	for (int i=0; i<itemOrder.length; i++) {		int index = itemOrder [i];		if (index < 0 || index >= itemCount) error (SWT.ERROR_INVALID_RANGE);		if (set [index]) error (SWT.ERROR_INVALID_ARGUMENT);		set [index] = true;	}		REBARBANDINFO rbBand = new REBARBANDINFO ();	rbBand.cbSize = REBARBANDINFO.sizeof;	for (int i=0; i<itemOrder.length; i++) {		int id = originalItems [itemOrder [i]].id;		int index = OS.SendMessage (handle, OS.RB_IDTOINDEX, id, 0);		if (index != i) {			/*			* If the item that is about to be moved is the last item			* on the row, resize it to the ideal size.  Force the next			* to last item on the same row to be the maximum size.			*/			int lastItemSrcRow = getLastIndexOfRow (index);			int lastItemDstRow = getLastIndexOfRow (i);						if (index == lastItemSrcRow) {				rbBand.fMask = OS.RBBIM_IDEALSIZE;				OS.SendMessage (handle, OS.RB_GETBANDINFO, index, rbBand);				//TEMPORARY CODE//				RECT rect = new RECT ();//				OS.SendMessage (handle, OS.RB_GETBANDBORDERS, index, rect);//				rbBand.cx = rbBand.cxIdeal + rect.left + rect.right;				rbBand.cx = rbBand.cxIdeal; 				rbBand.fMask = OS.RBBIM_SIZE;				OS.SendMessage (handle, OS.RB_SETBANDINFO, index, rbBand);				if (index - 1 >= 0) {					rbBand.cx = MAX_WIDTH;					rbBand.fMask = OS.RBBIM_SIZE;					OS.SendMessage (handle, OS.RB_SETBANDINFO, index - 1, rbBand);				}						} 						/* Move the item */			OS.SendMessage (handle, OS.RB_MOVEBAND, index, i);						/*			* If the item that has just been moved now the last item			* on the row, resize it to the maximum size.			*/			if (i == lastItemDstRow) {				rbBand.cx = MAX_WIDTH;				rbBand.fMask = OS.RBBIM_SIZE;				OS.SendMessage (handle, OS.RB_SETBANDINFO, i, rbBand);			}			}		}}