void RadioButtonTestCase::setUp() { m_radio = new wxRadioButton(wxTheApp->GetTopWindow(), wxID_ANY, "wxRadioButton"); m_radio->Update(); m_radio->Refresh(); }
int getChoice() { if (rb_doom->GetValue()) return 1; else if (rb_hexen->GetValue()) return 2; else return 0; }
void RadioButtonTestCase::Value() { #ifndef __WXGTK__ EventCounter selected(m_radio, wxEVT_RADIOBUTTON); m_radio->SetValue(true); CPPUNIT_ASSERT(m_radio->GetValue()); m_radio->SetValue(false); CPPUNIT_ASSERT(!m_radio->GetValue()); CPPUNIT_ASSERT_EQUAL(0, selected.GetCount()); #endif }
void RadioButtonTestCase::Click() { // GTK and OS X do not support selecting a single radio button #if wxUSE_UIACTIONSIMULATOR && !defined(__WXGTK__) && !defined(__WXOSX__) EventCounter selected(m_radio, wxEVT_RADIOBUTTON); wxUIActionSimulator sim; wxYield(); sim.MouseMove(m_radio->GetScreenPosition() + wxPoint(10, 10)); sim.MouseClick(); wxYield(); CPPUNIT_ASSERT_EQUAL( 1, selected.GetCount() ); #endif }