X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4d08943ee49205d7d184a514cdd40de182aaa1eb..26364344e58ae9c384965ff25c6920a75c55184e:/src/msw/radiobut.cpp diff --git a/src/msw/radiobut.cpp b/src/msw/radiobut.cpp index df5468f000..c49c960045 100644 --- a/src/msw/radiobut.cpp +++ b/src/msw/radiobut.cpp @@ -182,20 +182,22 @@ void wxRadioButton::SetValue(bool value) { wxRadioButton *btn = wxDynamicCast(nodeBefore->GetData(), wxRadioButton); - if ( !btn ) + if ( btn && btn->HasFlag(wxRB_SINGLE) ) { - // the radio buttons in a group must be consecutive, so - // there are no more of them + // A wxRB_SINGLE button isn't part of this group break; } - - btn->SetValue(false); - - if ( btn->HasFlag(wxRB_GROUP) ) + + if (btn) { - // even if there are other radio buttons before this one, - // they're not in the same group with us - break; + btn->SetValue(false); + + if ( btn->HasFlag(wxRB_GROUP) ) + { + // even if there are other radio buttons before this one, + // they're not in the same group with us + break; + } } } } @@ -208,13 +210,14 @@ void wxRadioButton::SetValue(bool value) wxRadioButton *btn = wxDynamicCast(nodeAfter->GetData(), wxRadioButton); - if ( !btn || btn->HasFlag(wxRB_GROUP) ) + if ( btn && (btn->HasFlag(wxRB_GROUP) || btn->HasFlag(wxRB_SINGLE) ) ) { // no more buttons or the first button of the next group break; } - btn->SetValue(false); + if (btn) + btn->SetValue(false); } } } @@ -234,7 +237,7 @@ bool wxRadioButton::GetValue() const void wxRadioButton::Command (wxCommandEvent& event) { - SetValue(event.m_commandInt != 0); + SetValue(event.GetInt() != 0); ProcessCommand(event); }