X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2b5f62a0b2db198609b45dec622a018dae37008e..d5e64615977c6839abe565919e8da50ffda40604:/src/os2/radiobut.cpp diff --git a/src/os2/radiobut.cpp b/src/os2/radiobut.cpp index 76e9a65dde..8d1b543ad8 100644 --- a/src/os2/radiobut.cpp +++ b/src/os2/radiobut.cpp @@ -53,9 +53,7 @@ bool wxRadioButton::Create( , const wxPoint& rPos , const wxSize& rSize , long lStyle -#if wxUSE_VALIDATORS , const wxValidator& rValidator -#endif , const wxString& rsName ) { @@ -64,9 +62,7 @@ bool wxRadioButton::Create( ,rPos ,rSize ,lStyle -#if wxUSE_VALIDATORS ,rValidator -#endif ,rsName)) return FALSE; @@ -231,36 +227,42 @@ void wxRadioButton::SetValue( wxCHECK_RET(pNodeThis, _T("radio button not a child of its parent?")); - // - // Turn off all radio buttons before this one // - for ( wxWindowList::Node* pNodeBefore = pNodeThis->GetPrevious(); - pNodeBefore; - pNodeBefore = pNodeBefore->GetPrevious() ) + // If it's not the first item of the group ... + // + if ( !HasFlag(wxRB_GROUP) ) { - wxRadioButton* pBtn = wxDynamicCast( pNodeBefore->GetData() + // + // ...turn off all radio buttons before this one + // + for ( wxWindowList::Node* pNodeBefore = pNodeThis->GetPrevious(); + pNodeBefore; + pNodeBefore = pNodeBefore->GetPrevious() ) + { + wxRadioButton* pBtn = wxDynamicCast( pNodeBefore->GetData() ,wxRadioButton ); - if (!pBtn) - { - // - // The radio buttons in a group must be consecutive, so there - // are no more of them - // - break; - } - pBtn->SetValue(FALSE); - if (pBtn->HasFlag(wxRB_GROUP)) - { - // - // Even if there are other radio buttons before this one, - // they're not in the same group with us - // - break; + if (!pBtn) + { + // + // The radio buttons in a group must be consecutive, so there + // are no more of them + // + break; + } + pBtn->SetValue(FALSE); + if (pBtn->HasFlag(wxRB_GROUP)) + { + // + // Even if there are other radio buttons before this one, + // they're not in the same group with us + // + break; + } } } - // + // // ... and all after this one // for (wxWindowList::Node* pNodeAfter = pNodeThis->GetNext(); @@ -273,7 +275,7 @@ void wxRadioButton::SetValue( if (!pBtn || pBtn->HasFlag(wxRB_GROUP) ) { - // + // // No more buttons or the first button of the next group // break;