]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/calctrl.cpp
removed wxListEvent::m_oldItemIndex from docs, it is not used for anything anyhow
[wxWidgets.git] / src / generic / calctrl.cpp
index a6a877999414a208eab84f075c641dec9f87956c..37a0ab77135e94be97185edaf0bdd7656f0e6a49 100644 (file)
@@ -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);
 
@@ -472,10 +477,9 @@ wxSize wxCalendarCtrl::DoGetBestSize() const
     wxCoord width = 7*m_widthCol,
             height = 7*m_heightRow;
 
-    wxSize sizeCombo = m_comboMonth->GetBestSize(),
-           sizeSpin = m_spinYear->GetBestSize();
-
-    height += VERT_MARGIN + wxMax(sizeCombo.y, sizeSpin.y);
+    // the combobox doesn't report its height correctly (it returns the
+    // height including the drop down list) so don't use it
+    height += VERT_MARGIN + m_spinYear->GetBestSize().y;
 
     if ( GetWindowStyle() & (wxRAISED_BORDER | wxSUNKEN_BORDER) )
     {
@@ -1059,5 +1063,5 @@ wxCalendarEvent::wxCalendarEvent(wxCalendarCtrl *cal, wxEventType type)
     m_date = cal->GetDate();
 }
 
-#endif // wxUSE_SPINBTN
+#endif // wxUSE_CALENDARCTRL