]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/radiobut.cpp
Correctd orientation of sash handle.
[wxWidgets.git] / src / msw / radiobut.cpp
index df5468f0002cbfadf976b711a4caaaa6c184529b..2b3b4925cca385208aab87af2b2f59d5ca6f74cb 100644 (file)
@@ -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);
         }
     }
 }