From: Mattia Barbon Date: Tue, 2 Apr 2002 17:46:45 +0000 (+0000) Subject: wxCalendarCtrl::Destroy() now deletes year spin control and X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/b70462f4f790b87f51e34c279837efb75545be28 wxCalendarCtrl::Destroy() now deletes year spin control and month combo box; tested in MSW and GTK . git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14914 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/generic/calctrl.h b/include/wx/generic/calctrl.h index 12a10c43f5..7b8f072fb9 100644 --- a/include/wx/generic/calctrl.h +++ b/include/wx/generic/calctrl.h @@ -60,6 +60,8 @@ public: virtual ~wxCalendarCtrl(); + virtual bool Destroy(); + // set/get the current date // ------------------------ diff --git a/src/generic/calctrl.cpp b/src/generic/calctrl.cpp index 14c60e5267..9c70985528 100644 --- a/src/generic/calctrl.cpp +++ b/src/generic/calctrl.cpp @@ -253,6 +253,18 @@ wxCalendarCtrl::~wxCalendarCtrl() // forward wxWin functions to subcontrols // ---------------------------------------------------------------------------- +bool wxCalendarCtrl::Destroy() +{ + if( m_staticYear ) m_staticYear->Destroy(); + if( m_spinYear ) m_spinYear->Destroy(); + if( m_comboMonth ) m_comboMonth->Destroy(); + if( m_staticMonth ) m_staticMonth->Destroy(); + + m_staticYear = 0; m_spinYear = 0; m_comboMonth = 0; m_staticMonth = 0; + + return wxControl::Destroy(); +} + bool wxCalendarCtrl::Show(bool show) { if ( !wxControl::Show(show) )