From edc0f733a7af21014fb6077acb70ac9952259a74 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 20 Sep 2010 13:10:49 +0000 Subject: [PATCH] Ignore time component of SYSTEMTIME in wxMSW wxDatePickerCtrl. This is similar to the fix of r64208 for wxCalendarCtrl and ignores the time component of SYSTEMTIME objects returned by the native functions in wxDatePickerCtrl too to ensure that we operate with pure dates only. Closes #12493. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65573 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/datectrl.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/msw/datectrl.cpp b/src/msw/datectrl.cpp index 9551d86b92..31952163c8 100644 --- a/src/msw/datectrl.cpp +++ b/src/msw/datectrl.cpp @@ -210,7 +210,7 @@ wxDateTime wxDatePickerCtrl::GetValue() const SYSTEMTIME st; if ( DateTime_GetSystemtime(GetHwnd(), &st) == GDT_VALID ) { - dt.SetFromMSWSysTime(st); + dt.SetFromMSWSysDate(st); } wxASSERT_MSG( m_date.IsValid() == dt.IsValid() && @@ -252,7 +252,7 @@ bool wxDatePickerCtrl::GetRange(wxDateTime *dt1, wxDateTime *dt2) const if ( dt1 ) { if ( flags & GDTR_MIN ) - dt1->SetFromMSWSysTime(st[0]); + dt1->SetFromMSWSysDate(st[0]); else *dt1 = wxDefaultDateTime; } @@ -260,7 +260,7 @@ bool wxDatePickerCtrl::GetRange(wxDateTime *dt1, wxDateTime *dt2) const if ( dt2 ) { if ( flags & GDTR_MAX ) - dt2->SetFromMSWSysTime(st[1]); + dt2->SetFromMSWSysDate(st[1]); else *dt2 = wxDefaultDateTime; } @@ -283,7 +283,7 @@ wxDatePickerCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) NMDATETIMECHANGE *dtch = (NMDATETIMECHANGE *)hdr; wxDateTime dt; if ( dtch->dwFlags == GDT_VALID ) - dt.SetFromMSWSysTime(dtch->st); + dt.SetFromMSWSysDate(dtch->st); // filter out duplicate DTN_DATETIMECHANGE events which the native // control sends us when using wxDP_DROPDOWN style -- 2.45.2