]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/calctrl.cpp
wxEVT_MOUSEWHEEL is always defined, no #if needed
[wxWidgets.git] / src / generic / calctrl.cpp
index e18a64a0314a6d2823ca034c6bb72c81a4b51be9..6e6bf645b0066c9f377799cf6d227133531ed28c 100644 (file)
 
 #include "wx/spinctrl.h"
 
+// if wxDatePickerCtrl code doesn't define the date event, do it here as we
+// need it as well
+#if !wxUSE_DATEPICKCTRL
+    #define _WX_DEFINE_DATE_EVENTS_
+#endif
+
 #include "wx/calctrl.h"
 
 #define DEBUG_PAINT 0
@@ -162,7 +168,7 @@ wxCONSTRUCTOR_6( wxCalendarCtrl , wxWindow* , Parent , wxWindowID , Id , wxDateT
 #else
 IMPLEMENT_DYNAMIC_CLASS(wxCalendarCtrl, wxControl)
 #endif
-IMPLEMENT_DYNAMIC_CLASS(wxCalendarEvent, wxCommandEvent)
+IMPLEMENT_DYNAMIC_CLASS(wxCalendarEvent, wxDateEvent)
 
 // ----------------------------------------------------------------------------
 // events
@@ -200,10 +206,10 @@ wxMonthComboBox::wxMonthComboBox(wxCalendarCtrl *cal)
     }
 
     SetSelection(m_cal->GetDate().GetMonth());
-    SetSize(wxDefaultPosition.x,
-            wxDefaultPosition.y,
-            wxDefaultSize.x,
-            wxDefaultSize.y,
+    SetSize(wxDefaultCoord,
+            wxDefaultCoord,
+            wxDefaultCoord,
+            wxDefaultCoord,
             wxSIZE_AUTO_WIDTH|wxSIZE_AUTO_HEIGHT);
 }
 
@@ -312,7 +318,11 @@ bool wxCalendarCtrl::Create(wxWindow *parent,
     // above it
     SetBestSize(size);
     SetPosition(pos);
-        
+
+    // Since we don't paint the whole background make sure that the platform
+    // will use the right one.
+    SetBackgroundColour(GetBackgroundColour());
+    
     SetHolidayAttrs();
 
     return true;
@@ -1816,22 +1826,5 @@ wxCalendarCtrl::GetClassDefaultAttributes(wxWindowVariant variant)
     return wxListBox::GetClassDefaultAttributes(variant);
 }
 
-
-// ----------------------------------------------------------------------------
-// wxCalendarEvent
-// ----------------------------------------------------------------------------
-
-void wxCalendarEvent::Init()
-{
-    m_wday = wxDateTime::Inv_WeekDay;
-}
-
-wxCalendarEvent::wxCalendarEvent(wxCalendarCtrl *cal, wxEventType type)
-               : wxCommandEvent(type, cal->GetId())
-{
-    m_date = cal->GetDate();
-    SetEventObject(cal);
-}
-
 #endif // wxUSE_CALENDARCTRL