Ignore time component of SYSTEMTIME in wxCalendarCtrl.

Native month calendar functions doesn't always return correct values in the
time part of SYSTEMTIME so ignore it and use just the date component.

To simplify doing it, add helper (MSW-specific) SetFromMSWSysDate() and
GetAsMSWSysDate() functions which convert between wxDateTime and SYSTEMTIME
but take only date component into account.

This commit partially replaces changes of r63560 and closes #11276.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64208 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-05-04 21:59:17 +00:00
parent 79309be9db
commit 10acc3ef6a
3 changed files with 40 additions and 14 deletions

View File

@@ -947,12 +947,15 @@ public:
// SYSTEMTIME format
// ------------------------------------------------------------------------
#ifdef __WXMSW__
// convert SYSTEMTIME to wxDateTime
wxDateTime& SetFromMSWSysTime(const struct _SYSTEMTIME&);
wxDateTime& SetFromMSWSysTime(const struct _SYSTEMTIME& st);
// convert wxDateTime to SYSTEMTIME
void GetAsMSWSysTime(struct _SYSTEMTIME*) const;
void GetAsMSWSysTime(struct _SYSTEMTIME* st) const;
// same as above but only take date part into account, time is always zero
wxDateTime& SetFromMSWSysDate(const struct _SYSTEMTIME& st);
void GetAsMSWSysDate(struct _SYSTEMTIME* st) const;
#endif // __WXMSW__
// comparison (see also functions below for operator versions)