if (imageList == null) imageList = display.getImageListTooBar (bounds.width, bounds.height);
if (imageList == null) imageList = display.getImageListToolBar (bounds.width, bounds.height);
void updateImages (boolean enabled) {	int hwnd = parent.handle;	TBBUTTONINFO info = new TBBUTTONINFO ();	info.cbSize = TBBUTTONINFO.sizeof;	info.dwMask = OS.TBIF_IMAGE;	OS.SendMessage (hwnd, OS.TB_GETBUTTONINFO, id, info);	if (info.iImage == OS.I_IMAGENONE && image == null) return;	ImageList imageList = parent.getImageList ();	ImageList hotImageList = parent.getHotImageList ();	ImageList disabledImageList = parent.getDisabledImageList();	if (info.iImage == OS.I_IMAGENONE) {		Rectangle bounds = image.getBounds ();		if (imageList == null) imageList = display.getImageListTooBar (bounds.width, bounds.height);		if (disabledImageList == null) {			disabledImageList = display.getImageListToolBarDisabled (bounds.width, bounds.height);		}		if (hotImageList == null) {			hotImageList = display.getImageListToolBarHot (bounds.width, bounds.height);		}		Image disabled = disabledImage;		if (disabledImage == null) {			if (disabledImage2 != null) disabledImage2.dispose ();			disabledImage2 = null;			disabled = image;			if (!enabled) {				Color color = parent.getBackground ();				disabled = disabledImage2 = createDisabledImage (image, color);			}		}		/*		* Bug in Windows.  When a tool item with the style		* BTNS_CHECK or BTNS_CHECKGROUP is selected and then		* disabled, the item does not draw using the disabled		* image.  The fix is to assign the disabled image in		* all image lists.		*/		Image image2 = image, hot = hotImage;		if ((style & (SWT.CHECK | SWT.RADIO)) != 0) {			if (!enabled) image2 = hot = disabled;		}		info.iImage = imageList.add (image2);		disabledImageList.add (disabled);		hotImageList.add (hot != null ? hot : image2);		parent.setImageList (imageList);		parent.setDisabledImageList (disabledImageList);		parent.setHotImageList (hotImageList);	} else {		Image disabled = null;		if (disabledImageList != null) {			if (image != null) {				if (disabledImage2 != null) disabledImage2.dispose ();				disabledImage2 = null;				disabled = disabledImage;				if (disabledImage == null) {					disabled = image;					if (!enabled) {						Color color = parent.getBackground ();						disabled = disabledImage2 = createDisabledImage (image, color);					}				}			}			disabledImageList.put (info.iImage, disabled);		}		/*		* Bug in Windows.  When a tool item with the style		* BTNS_CHECK or BTNS_CHECKGROUP is selected and then		* disabled, the item does not draw using the disabled		* image.  The fix is to use the disabled image in all		* image lists.		*/		Image image2 = image, hot = hotImage;		if ((style & (SWT.CHECK | SWT.RADIO)) != 0) {			if (!enabled) image2 = hot = disabled;		}		if (imageList != null) imageList.put (info.iImage, image2);		if (hotImageList != null) {			hotImageList.put (info.iImage, hot != null ? hot : image2);		}		if (image == null) info.iImage = OS.I_IMAGENONE;	}	/*	* Bug in Windows.  If the width of an item has already been	* calculated, the tool bar control will not recalculate it to 	* include the space for the image.  The fix is to set the width	* to zero, forcing the control recalculate the width for the item.	*/	info.dwMask |= OS.TBIF_SIZE;	info.cx = 0;		OS.SendMessage (hwnd, OS.TB_SETBUTTONINFO, id, info);		parent.layoutItems ();}