COMCTL32: Minor fixes (take 2)
Filip Navara
xnavara at volny.cz
Sat Dec 4 18:27:18 CST 2004
Use GetSystemMetrics(SM_C[XY]EDGE) instead of hardcoded values as per
Rob Shearman's suggestion.
Add minor fix to REBAR_Destroy.
Changelog:
- Don't use DrawEdge with NULL device context, it's invalid call and
sets last error.
- Tooltip icons must be destroyed with DestroyIcon and not with
DeleteObject.
- Rebar cursors must be destroyed with DestroyCursor and not with
DeleteObject.
-------------- next part --------------
Index: dlls/comctl32/datetime.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/datetime.c,v
retrieving revision 1.49
diff -u -r1.49 datetime.c
--- dlls/comctl32/datetime.c 24 Nov 2004 18:28:31 -0000 1.49
+++ dlls/comctl32/datetime.c 5 Dec 2004 00:20:01 -0000
@@ -814,10 +814,11 @@
TRACE("Height=%ld, Width=%ld\n", infoPtr->rcClient.bottom, infoPtr->rcClient.right);
- /* use DrawEdge to adjust the size of rcEdge to get rcDraw */
memcpy((&infoPtr->rcDraw), (&infoPtr->rcClient), sizeof(infoPtr->rcDraw));
- DrawEdge(NULL, &(infoPtr->rcDraw), EDGE_SUNKEN, BF_RECT | BF_ADJUST);
+ /* subract the size of the edge drawn by DrawEdge */
+ InflateRect(&infoPtr->rcDraw, -GetSystemMetrics(SM_CXEDGE),
+ -GetSystemMetrics(SM_CYEDGE));
/* set the size of the button that drops the calendar down */
/* FIXME: account for style that allows button on left side */
Index: dlls/comctl32/rebar.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/rebar.c,v
retrieving revision 1.100
diff -u -r1.100 rebar.c
--- dlls/comctl32/rebar.c 24 Nov 2004 18:28:31 -0000 1.100
+++ dlls/comctl32/rebar.c 5 Dec 2004 00:19:31 -0000
@@ -3786,10 +3786,10 @@
infoPtr->bands = NULL;
}
- DeleteObject (infoPtr->hcurArrow);
- DeleteObject (infoPtr->hcurHorz);
- DeleteObject (infoPtr->hcurVert);
- DeleteObject (infoPtr->hcurDrag);
+ DestroyCursor (infoPtr->hcurArrow);
+ DestroyCursor (infoPtr->hcurHorz);
+ DestroyCursor (infoPtr->hcurVert);
+ DestroyCursor (infoPtr->hcurDrag);
if(infoPtr->hDefaultFont) DeleteObject (infoPtr->hDefaultFont);
SetWindowLongPtrW (infoPtr->hwndSelf, 0, 0);
Index: dlls/comctl32/tooltips.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/tooltips.c,v
retrieving revision 1.74
diff -u -r1.74 tooltips.c
--- dlls/comctl32/tooltips.c 25 Oct 2004 21:44:50 -0000 1.74
+++ dlls/comctl32/tooltips.c 5 Dec 2004 00:19:31 -0000
@@ -2836,7 +2836,7 @@
TOOLTIPS_Unregister (void)
{
int i;
- for (i = 0; i < TTI_ERROR+1; i++)
- DeleteObject(hTooltipIcons[i]);
+ for (i = TTI_INFO; i <= TTI_ERROR; i++)
+ DestroyIcon(hTooltipIcons[i]);
UnregisterClassW (TOOLTIPS_CLASSW, NULL);
}
More information about the wine-patches
mailing list