]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed bug in wxCalendarCtrl (132199) and bug in wxDateTime::IsSameDate() this fix...
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 13 Feb 2001 17:55:26 +0000 (17:55 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 13 Feb 2001 17:55:26 +0000 (17:55 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9368 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
include/wx/datetime.inl
src/generic/calctrl.cpp

index 61aa14bb5aaf3e6535495d5bb76bcf7f1eae1fd9..665ee2b71f696d7025bc6299679b52b8b2c6157d 100644 (file)
@@ -12,10 +12,12 @@ wxBase:
 - wxMimeTypesManager now can create file associations too
 - wxCopyFile() respects the file permissions (Roland Scholz)
 - wxFTP::GetFileSize() added (Søren Erland Vestø)
+- wxDateTime::IsSameDate() bug fixed
 
 All (GUI):
 
 - new wxToggleButton class (John Norris, Axel Schlueter)
+- wxCalendarCtrl now highlighting the date with time part bug fixed
 
 wxMSW:
 
index 3089b32111297999d0e26057bb59a5aae267aa46..450a11fc1387473956a788bc3feb4eec7d51be3d 100644 (file)
@@ -249,7 +249,12 @@ inline bool wxDateTime::IsBetween(const wxDateTime& t1,
 
 inline bool wxDateTime::IsSameDate(const wxDateTime& dt) const
 {
-    return (m_time - dt.m_time).Abs() < MILLISECONDS_PER_DAY;
+    Tm tm1 = GetTm(),
+       tm2 = dt.GetTm();
+
+    return tm1.year == tm2.year &&
+           tm1.mon == tm2.mon &&
+           tm1.mday == tm2.mday;
 }
 
 inline bool wxDateTime::IsSameTime(const wxDateTime& dt) const
index bc800036523ea2888c4cdc821f1d5ca1c51c8092..a6a877999414a208eab84f075c641dec9f87956c 100644 (file)
@@ -480,7 +480,7 @@ wxSize wxCalendarCtrl::DoGetBestSize() const
     if ( GetWindowStyle() & (wxRAISED_BORDER | wxSUNKEN_BORDER) )
     {
         // the border would clip the last line otherwise
-        height += 4;
+        height += 6;
     }
 
     return wxSize(width, height);
@@ -648,7 +648,7 @@ void wxCalendarCtrl::OnPaint(wxPaintEvent& WXUNUSED(event))
 
                 wxCalendarDateAttr *attr = m_attrs[day - 1];
 
-                bool isSel = m_date == date;
+                bool isSel = date.IsSameDate(m_date);
                 if ( isSel )
                 {
                     dc.SetTextForeground(m_colHighlightFg);