]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/radiobut.cpp
added test for wxScopeGuard
[wxWidgets.git] / src / mac / carbon / radiobut.cpp
index f67e7c68b2be0c7d609b7449689fc6beae2bb1dc..a265da4e8ce1133c29340ec4d0bef4c6549bc317 100644 (file)
@@ -108,28 +108,21 @@ wxInt32 wxRadioButton::MacControlHit(WXEVENTHANDLERREF WXUNUSED(handler) , WXEVE
 {
     // if already set -> no action
     if ( GetValue() )
-      return noErr;
+        return noErr;
       
-      wxRadioButton *cycle, *old = NULL ;
+    wxRadioButton *cycle;
     cycle=this->NextInCycle();
     if (cycle!=NULL) {
-          while (cycle!=this) {
+        while (cycle!=this) {
             if ( cycle->GetValue() ) {
-              old = cycle ;
                 cycle->SetValue(false);
-              }
-              cycle=cycle->NextInCycle();
             }
+            cycle=cycle->NextInCycle();
+        }
     }
 
-      SetValue(true) ;
+    SetValue(true) ;
 
-    if ( old ) {
-      wxCommandEvent event(wxEVT_COMMAND_RADIOBUTTON_SELECTED, old->m_windowId );
-      event.SetEventObject(old);
-      event.SetInt( false );
-      old->ProcessCommand(event);
-    }
     wxCommandEvent event2(wxEVT_COMMAND_RADIOBUTTON_SELECTED, m_windowId );
     event2.SetEventObject(this);
     event2.SetInt( true );