From a096ba4c5b444110e734612dfa61af27373cd88f Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Sun, 11 Oct 2009 18:12:46 +0400 Subject: [PATCH] comctl32/datetime: Fix wrong assumption about DTN_DATETIMECHANGE flags, add DTN_CLOSEUP notifications. --- dlls/comctl32/datetime.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/dlls/comctl32/datetime.c b/dlls/comctl32/datetime.c index 5cd8b19ee06..65f700505e8 100644 --- a/dlls/comctl32/datetime.c +++ b/dlls/comctl32/datetime.c @@ -31,7 +31,6 @@ * TODO: * -- DTS_APPCANPARSE * -- DTS_SHORTDATECENTURYFORMAT - * -- DTN_CLOSEUP * -- DTN_FORMAT * -- DTN_FORMATQUERY * -- DTN_USERSTRING @@ -811,20 +810,23 @@ DATETIME_LButtonDown (DATETIME_INFO *infoPtr, INT x, INT y) if(IsWindowVisible(infoPtr->hMonthCal)) { ShowWindow(infoPtr->hMonthCal, SW_HIDE); + infoPtr->bDropdownEnabled = FALSE; + DATETIME_SendSimpleNotify (infoPtr, DTN_CLOSEUP); } else { const SYSTEMTIME *lprgSysTimeArray = &infoPtr->date; TRACE("update calendar %04d/%02d/%02d\n", lprgSysTimeArray->wYear, lprgSysTimeArray->wMonth, lprgSysTimeArray->wDay); SendMessageW(infoPtr->hMonthCal, MCM_SETCURSEL, 0, (LPARAM)(&infoPtr->date)); - if (infoPtr->bDropdownEnabled) + if (infoPtr->bDropdownEnabled) { ShowWindow(infoPtr->hMonthCal, SW_SHOW); + DATETIME_SendSimpleNotify (infoPtr, DTN_DROPDOWN); + } infoPtr->bDropdownEnabled = TRUE; } TRACE ("dt:%p mc:%p mc parent:%p, desktop:%p\n", infoPtr->hwndSelf, infoPtr->hMonthCal, infoPtr->hwndNotify, GetDesktopWindow ()); - DATETIME_SendSimpleNotify (infoPtr, DTN_DROPDOWN); } InvalidateRect(infoPtr->hwndSelf, NULL, TRUE); @@ -944,6 +946,7 @@ DATETIME_Notify (DATETIME_INFO *infoPtr, LPNMHDR lpnmh) SendMessageW (infoPtr->hwndCheckbut, BM_SETCHECK, BST_CHECKED, 0); InvalidateRect(infoPtr->hwndSelf, NULL, TRUE); DATETIME_SendDateTimeChangeNotify (infoPtr); + DATETIME_SendSimpleNotify(infoPtr, DTN_CLOSEUP); } if ((lpnmh->hwndFrom == infoPtr->hUpdown) && (lpnmh->code == UDN_DELTAPOS)) { LPNMUPDOWN lpnmud = (LPNMUPDOWN)lpnmh; @@ -1188,7 +1191,7 @@ DATETIME_SendDateTimeChangeNotify (const DATETIME_INFO *infoPtr) dtdtc.nmhdr.idFrom = GetWindowLongPtrW(infoPtr->hwndSelf, GWLP_ID); dtdtc.nmhdr.code = DTN_DATETIMECHANGE; - dtdtc.dwFlags = (infoPtr->dwStyle & DTS_SHOWNONE) ? GDT_NONE : GDT_VALID; + dtdtc.dwFlags = infoPtr->dateValid ? GDT_VALID : GDT_NONE; dtdtc.st = infoPtr->date; return (BOOL) SendMessageW (infoPtr->hwndNotify, WM_NOTIFY, -- 2.11.4.GIT