+void wxRadioButton::SetFocus()
+{
+ // when the radio button receives a WM_SETFOCUS message it generates a
+ // BN_CLICKED which is totally unexpected and leads to catastrophic results
+ // if you pop up a dialog from the radio button event handler as, when the
+ // dialog is dismissed, the focus is returned to the radio button which
+ // generates BN_CLICKED which leads to showing another dialog and so on
+ // without end!
+ //
+ // to aviod this, we drop the pseudo BN_CLICKED events generated when the
+ // button gains focus
+ m_bFocusJustSet = TRUE;
+
+ wxControl::SetFocus();
+}
+