]> git.saurik.com Git - wxWidgets.git/commitdiff
fix for wxCalendarCtrl::Create() (bug 458167)
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 30 Sep 2001 14:46:30 +0000 (14:46 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 30 Sep 2001 14:46:30 +0000 (14:46 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11742 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/generic/calctrl.h
src/generic/calctrl.cpp

index feabc86fa4166c5bf4c6373fc3d76193fb0e3b7d..076fff2d7b4578c858eb1b4dec86ed88a814c29e 100644 (file)
@@ -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();
index 04facbffb19ee93513f206be31730f78277fe602..37a0ab77135e94be97185edaf0bdd7656f0e6a49 100644 (file)
@@ -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);