X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/226ee022131332b2d1aaf63e5bcc80a670f6c6ee..2c667cb8d84f9b7304938c6a9356673c6002880e:/src/generic/calctrl.cpp diff --git a/src/generic/calctrl.cpp b/src/generic/calctrl.cpp index 40259f8b94..40e2dd3bc3 100644 --- a/src/generic/calctrl.cpp +++ b/src/generic/calctrl.cpp @@ -36,8 +36,7 @@ #include "wx/stattext.h" #endif //WX_PRECOMP -// Can only use wxSpinEvent if this is enabled -#if wxUSE_SPINBTN +#if wxUSE_CALENDARCTRL #include "wx/calctrl.h" @@ -181,14 +180,20 @@ void wxCalendarCtrl::Init() m_colHeaderBg = *wxLIGHT_GREY; } -bool wxCalendarCtrl::Create(wxWindow * WXUNUSED(parent), - wxWindowID WXUNUSED(id), +bool wxCalendarCtrl::Create(wxWindow *parent, + wxWindowID id, const wxDateTime& date, - const wxPoint& WXUNUSED(pos), + const wxPoint& pos, const wxSize& size, long style, - const wxString& WXUNUSED(name)) + const wxString& name) { + if ( !wxControl::Create(parent, id, pos, size, + style | wxWANTS_CHARS, wxDefaultValidator, name) ) + { + return FALSE; + } + // needed to get the arrow keys normally used for the dialog navigation SetWindowStyle(style | wxWANTS_CHARS); @@ -1056,7 +1061,8 @@ wxCalendarEvent::wxCalendarEvent(wxCalendarCtrl *cal, wxEventType type) : wxCommandEvent(type, cal->GetId()) { m_date = cal->GetDate(); + SetEventObject(cal); } -#endif // wxUSE_SPINBTN +#endif // wxUSE_CALENDARCTRL