Commit 96ed854d authored by Alexandre Julliard's avatar Alexandre Julliard

comctl32/datetime: Fix incorrect use of the ScreenToClient function.

parent 4b4c1a00
...@@ -787,6 +787,7 @@ DATETIME_LButtonDown (DATETIME_INFO *infoPtr, INT x, INT y) ...@@ -787,6 +787,7 @@ DATETIME_LButtonDown (DATETIME_INFO *infoPtr, INT x, INT y)
if (infoPtr->select == DTHT_MCPOPUP) { if (infoPtr->select == DTHT_MCPOPUP) {
RECT rcMonthCal; RECT rcMonthCal;
POINT pos;
SendMessageW(infoPtr->hMonthCal, MCM_GETMINREQRECT, 0, (LPARAM)&rcMonthCal); SendMessageW(infoPtr->hMonthCal, MCM_GETMINREQRECT, 0, (LPARAM)&rcMonthCal);
/* FIXME: button actually is only depressed during dropdown of the */ /* FIXME: button actually is only depressed during dropdown of the */
...@@ -795,17 +796,16 @@ DATETIME_LButtonDown (DATETIME_INFO *infoPtr, INT x, INT y) ...@@ -795,17 +796,16 @@ DATETIME_LButtonDown (DATETIME_INFO *infoPtr, INT x, INT y)
/* recalculate the position of the monthcal popup */ /* recalculate the position of the monthcal popup */
if(infoPtr->dwStyle & DTS_RIGHTALIGN) if(infoPtr->dwStyle & DTS_RIGHTALIGN)
infoPtr->monthcal_pos.x = infoPtr->calbutton.left - pos.x = infoPtr->calbutton.left - (rcMonthCal.right - rcMonthCal.left);
(rcMonthCal.right - rcMonthCal.left);
else else
/* FIXME: this should be after the area reserved for the checkbox */ /* FIXME: this should be after the area reserved for the checkbox */
infoPtr->monthcal_pos.x = infoPtr->rcDraw.left; pos.x = infoPtr->rcDraw.left;
infoPtr->monthcal_pos.y = infoPtr->rcClient.bottom; pos.y = infoPtr->rcClient.bottom;
ClientToScreen (infoPtr->hwndSelf, &(infoPtr->monthcal_pos)); OffsetRect( &rcMonthCal, pos.x, pos.y );
SetWindowPos(infoPtr->hMonthCal, 0, infoPtr->monthcal_pos.x, MapWindowPoints( infoPtr->hwndSelf, 0, (POINT *)&rcMonthCal, 2 );
infoPtr->monthcal_pos.y, rcMonthCal.right - rcMonthCal.left, SetWindowPos(infoPtr->hMonthCal, 0, rcMonthCal.left, rcMonthCal.top,
rcMonthCal.bottom - rcMonthCal.top, 0); rcMonthCal.right - rcMonthCal.left, rcMonthCal.bottom - rcMonthCal.top, 0);
if(IsWindowVisible(infoPtr->hMonthCal)) { if(IsWindowVisible(infoPtr->hMonthCal)) {
ShowWindow(infoPtr->hMonthCal, SW_HIDE); ShowWindow(infoPtr->hMonthCal, SW_HIDE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment