From 17408188c51c8c137e497669a25aefce604ceec6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Wed, 12 Jul 2006 11:27:04 +0000 Subject: [PATCH] SetValue now avoids itself switching off also added an ASSERT to check the current radio button is still on after the switching off process this fixes the weird behavior in the password window of the ScreenSaver prefapp git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18107 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/RadioButton.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/kits/interface/RadioButton.cpp b/src/kits/interface/RadioButton.cpp index 906e0d7a11..8cfb7dcb88 100644 --- a/src/kits/interface/RadioButton.cpp +++ b/src/kits/interface/RadioButton.cpp @@ -14,6 +14,7 @@ */ +#include #include #include #include @@ -295,7 +296,7 @@ BRadioButton::SetValue(int32 value) while (child) { BRadioButton *radio = dynamic_cast(child); - if (child != this && radio) + if (radio && (radio != this)) radio->SetValue(B_CONTROL_OFF); else { // If the child is a BBox, check if the label is a radiobutton @@ -304,13 +305,15 @@ BRadioButton::SetValue(int32 value) if (box && box->LabelView()) { radio = dynamic_cast(box->LabelView()); - if (radio) + if (radio && (radio != this)) radio->SetValue(B_CONTROL_OFF); } } child = child->NextSibling(); } + + ASSERT(Value() == B_CONTROL_ON); }