]> git.saurik.com Git - wxWidgets.git/blobdiff - tests/controls/radiobuttontest.cpp
Ensure that detached menus don't keep focus grab in wxGTK.
[wxWidgets.git] / tests / controls / radiobuttontest.cpp
index f242614aae3f183dc6827fb4031b8f51c99a92c3..ce4f7989a492607e960a106744ece11703127734 100644 (file)
@@ -71,10 +71,7 @@ void RadioButtonTestCase::Click()
 {
     // GTK does not support selecting a single radio button
 #if wxUSE_UIACTIONSIMULATOR && !defined(__WXGTK__)
-    wxTestableFrame* frame = wxStaticCast(wxTheApp->GetTopWindow(),
-                                          wxTestableFrame);
-
-    EventCounter count(m_radio, wxEVT_COMMAND_RADIOBUTTON_SELECTED);
+    EventCounter selected(m_radio, wxEVT_RADIOBUTTON);
 
     wxUIActionSimulator sim;
 
@@ -83,17 +80,14 @@ void RadioButtonTestCase::Click()
 
     wxYield();
 
-    CPPUNIT_ASSERT_EQUAL( 1, frame->GetEventCount() );
+    CPPUNIT_ASSERT_EQUAL( 1, selected.GetCount() );
 #endif
 }
 
 void RadioButtonTestCase::Value()
 {
 #ifndef __WXGTK__
-    wxTestableFrame* frame = wxStaticCast(wxTheApp->GetTopWindow(),
-                                          wxTestableFrame);
-
-    EventCounter count(m_radio, wxEVT_COMMAND_RADIOBUTTON_SELECTED);
+    EventCounter selected(m_radio, wxEVT_RADIOBUTTON);
 
     m_radio->SetValue(true);
 
@@ -103,7 +97,7 @@ void RadioButtonTestCase::Value()
 
     CPPUNIT_ASSERT(!m_radio->GetValue());
 
-    CPPUNIT_ASSERT_EQUAL(0, frame->GetEventCount());
+    CPPUNIT_ASSERT_EQUAL(0, selected.GetCount());
 #endif
 }