]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/calctrl.cpp
added xpmdecod.cpp
[wxWidgets.git] / src / generic / calctrl.cpp
index f2ecd265a11c072bfe3d3141844fad8ee39021db..a6a877999414a208eab84f075c641dec9f87956c 100644 (file)
@@ -97,6 +97,17 @@ END_EVENT_TABLE()
 IMPLEMENT_DYNAMIC_CLASS(wxCalendarCtrl, wxControl)
 IMPLEMENT_DYNAMIC_CLASS(wxCalendarEvent, wxCommandEvent)
 
+// ----------------------------------------------------------------------------
+// events
+// ----------------------------------------------------------------------------
+
+DEFINE_EVENT_TYPE(wxEVT_CALENDAR_SEL_CHANGED)
+DEFINE_EVENT_TYPE(wxEVT_CALENDAR_DAY_CHANGED)
+DEFINE_EVENT_TYPE(wxEVT_CALENDAR_MONTH_CHANGED)
+DEFINE_EVENT_TYPE(wxEVT_CALENDAR_YEAR_CHANGED)
+DEFINE_EVENT_TYPE(wxEVT_CALENDAR_DOUBLECLICKED)
+DEFINE_EVENT_TYPE(wxEVT_CALENDAR_WEEKDAY_CLICKED)
+
 // ============================================================================
 // implementation
 // ============================================================================
@@ -469,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);
@@ -637,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);