event.x = clipRect.left; event.y = clipRect.top; event.width = clipRect.right - clipRect.left; event.height = clipRect.bottom - clipRect.top;
event.x = rect.left; event.y = rect.top; event.width = width; event.height = height;
LRESULT WM_PAINT (int wParam, int lParam) {	PAINTSTRUCT ps = new PAINTSTRUCT ();	GCData data = new GCData ();	data.ps = ps;	data.hwnd = handle;	GC gc = new_GC (data);	if (gc != null) {		if ((ps.right - ps.left) != 0 && (ps.bottom - ps.top) != 0) {			int hTheme = 0;			if (OS.COMCTL32_MAJOR >= 6 && OS.IsAppThemed ()) {				hTheme = OS.OpenThemeData (handle, EXPLORERBAR); 			}			RECT clipRect = new RECT ();			OS.SetRect (clipRect, ps.left, ps.top, ps.right, ps.bottom);			if (hTheme != 0) {				RECT rect = new RECT ();				OS.GetClientRect (handle, rect);				OS.DrawThemeBackground (hTheme, gc.handle, OS.EBP_HEADERBACKGROUND, 0, rect, clipRect);							} else {				drawBackground (gc.handle);			}			boolean drawFocus = false;			if (handle == OS.GetFocus ()) {				int uiState = OS.SendMessage (handle, OS.WM_QUERYUISTATE, 0, 0);				drawFocus = (uiState & OS.UISF_HIDEFOCUS) == 0;			}			for (int i = 0; i < itemCount; i++) {				ExpandItem item = items[i];				item.drawItem (gc, hTheme, clipRect, i == focusIndex && drawFocus);					}			if (hTheme != 0) OS.CloseThemeData (hTheme);			if (hooks (SWT.Paint) || filters (SWT.Paint)) {				Event event = new Event ();				event.gc = gc;				event.x = clipRect.left;				event.y = clipRect.top;				event.width = clipRect.right - clipRect.left;				event.height = clipRect.bottom - clipRect.top;				sendEvent (SWT.Paint, event);				event.gc = null;			}		}		gc.dispose ();	}	return LRESULT.ZERO;}