From 4965c3d7f68309cf8c676cfcd493b85c7b9c8484 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 30 Sep 2001 14:46:30 +0000 Subject: [PATCH] fix for wxCalendarCtrl::Create() (bug 458167) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11742 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/generic/calctrl.h | 6 ++---- src/generic/calctrl.cpp | 14 ++++++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/include/wx/generic/calctrl.h b/include/wx/generic/calctrl.h index feabc86fa4..076fff2d7b 100644 --- a/include/wx/generic/calctrl.h +++ b/include/wx/generic/calctrl.h @@ -42,10 +42,8 @@ public: const wxDateTime& date = wxDefaultDateTime, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxCAL_SHOW_HOLIDAYS, + long style = wxCAL_SHOW_HOLIDAYS | wxWANTS_CHARS, const wxString& name = wxCalendarNameStr) - : wxControl(parent, id, pos, size, - style | wxWANTS_CHARS, wxDefaultValidator, name) { Init(); @@ -57,7 +55,7 @@ public: const wxDateTime& date = wxDefaultDateTime, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxCAL_SHOW_HOLIDAYS, + long style = wxCAL_SHOW_HOLIDAYS | wxWANTS_CHARS, const wxString& name = wxCalendarNameStr); virtual ~wxCalendarCtrl(); diff --git a/src/generic/calctrl.cpp b/src/generic/calctrl.cpp index 04facbffb1..37a0ab7713 100644 --- a/src/generic/calctrl.cpp +++ b/src/generic/calctrl.cpp @@ -180,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); -- 2.45.2