void ButtonTestCase::Click()
{
- wxTestableFrame* frame = wxStaticCast(wxTheApp->GetTopWindow(),
- wxTestableFrame);
-
//We use the internal class EventCounter which handles connecting and
//disconnecting the control to the wxTestableFrame
- EventCounter count(m_button, wxEVT_COMMAND_BUTTON_CLICKED);
+ EventCounter clicked(m_button, wxEVT_BUTTON);
wxUIActionSimulator sim;
sim.MouseClick();
wxYield();
- CPPUNIT_ASSERT_EQUAL( 1, frame->GetEventCount() );
+ CPPUNIT_ASSERT_EQUAL( 1, clicked.GetCount() );
}
void ButtonTestCase::Disabled()
{
- wxTestableFrame* frame = wxStaticCast(wxTheApp->GetTopWindow(),
- wxTestableFrame);
-
- EventCounter count(m_button, wxEVT_COMMAND_BUTTON_CLICKED);
+ EventCounter clicked(m_button, wxEVT_BUTTON);
wxUIActionSimulator sim;
sim.MouseClick();
wxYield();
- CPPUNIT_ASSERT_EQUAL( 0, frame->GetEventCount() );
+ CPPUNIT_ASSERT_EQUAL( 0, clicked.GetCount() );
}
#endif // wxUSE_UIACTIONSIMULATOR