X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3dee36ae33edfa99460ce71e928678e1282df844..b16de7461ac6d97b0b04a5ce4e73447925e93416:/src/mac/carbon/radiobut.cpp diff --git a/src/mac/carbon/radiobut.cpp b/src/mac/carbon/radiobut.cpp index e7f983642d..936b8a54e8 100644 --- a/src/mac/carbon/radiobut.cpp +++ b/src/mac/carbon/radiobut.cpp @@ -9,10 +9,6 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma implementation "radiobut.h" -#endif - #include "wx/wxprec.h" #if wxUSE_RADIOBTN @@ -72,6 +68,11 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id, return true; } +wxRadioButton::~wxRadioButton() +{ + RemoveFromCycle(); +} + void wxRadioButton::SetValue(bool val) { wxRadioButton *cycle; @@ -150,4 +151,20 @@ wxRadioButton *wxRadioButton::AddInCycle(wxRadioButton *cycle) } } +void wxRadioButton::RemoveFromCycle() +{ + if (m_cycle==NULL || m_cycle == this) + { + return; + } + else + { + // Find the previous one and make it point to the next one + wxRadioButton* prev = this; + while (prev->m_cycle != this) + prev = prev->m_cycle; + prev->m_cycle = m_cycle; + } +} + #endif