Applied patch [ 705441 ] Radio button consecutive groups bug
Backported from head git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@20027 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -217,6 +217,7 @@ wxMSW:
|
||||
- fixes for wxLocale::Init and Borland C++
|
||||
- Fix for bug whereby owner-drawn buttons didn't draw multiline labels correctly
|
||||
- Alt-letter didn't switch focus to a spin ctrl following static control with hotkey
|
||||
- Fix for multiple consecutive groups of radiobuttons
|
||||
|
||||
wxMotif:
|
||||
|
||||
|
@@ -117,7 +117,10 @@ void wxRadioButton::SetValue(bool value)
|
||||
wxWindowList::Node *nodeThis = siblings.Find(this);
|
||||
wxCHECK_RET( nodeThis, _T("radio button not a child of its parent?") );
|
||||
|
||||
// turn off all radio buttons before this one
|
||||
// if it's not the first item of the group ...
|
||||
if ( !HasFlag(wxRB_GROUP) )
|
||||
{
|
||||
// ... turn off all radio buttons before it
|
||||
for ( wxWindowList::Node *nodeBefore = nodeThis->GetPrevious();
|
||||
nodeBefore;
|
||||
nodeBefore = nodeBefore->GetPrevious() )
|
||||
@@ -126,8 +129,8 @@ void wxRadioButton::SetValue(bool value)
|
||||
wxRadioButton);
|
||||
if ( !btn )
|
||||
{
|
||||
// the radio buttons in a group must be consecutive, so there
|
||||
// are no more of them
|
||||
// the radio buttons in a group must be consecutive, so
|
||||
// there are no more of them
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -140,8 +143,9 @@ void wxRadioButton::SetValue(bool value)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ... and all after this one
|
||||
// ... and also turn off all buttons after this one
|
||||
for ( wxWindowList::Node *nodeAfter = nodeThis->GetNext();
|
||||
nodeAfter;
|
||||
nodeAfter = nodeAfter->GetNext() )
|
||||
|
Reference in New Issue
Block a user