Weekly updates.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17982 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -224,6 +224,63 @@ void wxRadioButton::SetValue(
|
||||
)
|
||||
{
|
||||
::WinSendMsg((HWND)GetHWND(), BM_SETCHECK, (MPARAM)bValue, (MPARAM)0);
|
||||
if (bValue)
|
||||
{
|
||||
const wxWindowList& rSiblings = GetParent()->GetChildren();
|
||||
wxWindowList::Node* pNodeThis = rSiblings.Find(this);
|
||||
|
||||
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() )
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// ... and all after this one
|
||||
//
|
||||
for (wxWindowList::Node* pNodeAfter = pNodeThis->GetNext();
|
||||
pNodeAfter;
|
||||
pNodeAfter = pNodeAfter->GetNext())
|
||||
{
|
||||
wxRadioButton* pBtn = wxDynamicCast( pNodeAfter->GetData()
|
||||
,wxRadioButton
|
||||
);
|
||||
|
||||
if (!pBtn || pBtn->HasFlag(wxRB_GROUP) )
|
||||
{
|
||||
//
|
||||
// No more buttons or the first button of the next group
|
||||
//
|
||||
break;
|
||||
}
|
||||
pBtn->SetValue(FALSE);
|
||||
}
|
||||
}
|
||||
} // end of wxRadioButton::SetValue
|
||||
|
||||
MRESULT wxRadioButton::OS2WindowProc(
|
||||
|
Reference in New Issue
Block a user