X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d9abe7f2f9fdf31c7c9756d78601022f6a2462dc..d9a4a0d022f4a2d03422411eb93e5b9dc28d5d4c:/tests/controls/textctrltest.cpp diff --git a/tests/controls/textctrltest.cpp b/tests/controls/textctrltest.cpp index 61dd87347c..dee9da5822 100644 --- a/tests/controls/textctrltest.cpp +++ b/tests/controls/textctrltest.cpp @@ -188,7 +188,7 @@ void TextCtrlTestCase::ReadOnly() delete m_text; CreateText(wxTE_READONLY); - EventCounter updated(m_text, wxEVT_COMMAND_TEXT_UPDATED); + EventCounter updated(m_text, wxEVT_TEXT); m_text->SetFocus(); @@ -201,6 +201,11 @@ void TextCtrlTestCase::ReadOnly() // SetEditable() is supposed to override wxTE_READONLY m_text->SetEditable(true); + +#ifdef __WXOSX__ + // a ready only text field might not have been focusable at all + m_text->SetFocus(); +#endif sim.Text("abcdef"); wxYield(); @@ -213,8 +218,8 @@ void TextCtrlTestCase::ReadOnly() void TextCtrlTestCase::MaxLength() { #if wxUSE_UIACTIONSIMULATOR - EventCounter updated(m_text, wxEVT_COMMAND_TEXT_UPDATED); - EventCounter maxlen(m_text, wxEVT_COMMAND_TEXT_MAXLEN); + EventCounter updated(m_text, wxEVT_TEXT); + EventCounter maxlen(m_text, wxEVT_TEXT_MAXLEN); m_text->SetFocus(); m_text->SetMaxLength(10); @@ -319,7 +324,7 @@ void TextCtrlTestCase::ProcessEnter() wxTestableFrame* frame = wxStaticCast(wxTheApp->GetTopWindow(), wxTestableFrame); - EventCounter count(m_text, wxEVT_COMMAND_TEXT_ENTER); + EventCounter count(m_text, wxEVT_TEXT_ENTER); m_text->SetFocus(); @@ -327,7 +332,7 @@ void TextCtrlTestCase::ProcessEnter() sim.Char(WXK_RETURN); wxYield(); - CPPUNIT_ASSERT_EQUAL(0, frame->GetEventCount(wxEVT_COMMAND_TEXT_ENTER)); + CPPUNIT_ASSERT_EQUAL(0, frame->GetEventCount(wxEVT_TEXT_ENTER)); // we need a text control with wxTE_PROCESS_ENTER for this test delete m_text; @@ -338,7 +343,7 @@ void TextCtrlTestCase::ProcessEnter() sim.Char(WXK_RETURN); wxYield(); - CPPUNIT_ASSERT_EQUAL(1, frame->GetEventCount(wxEVT_COMMAND_TEXT_ENTER)); + CPPUNIT_ASSERT_EQUAL(1, frame->GetEventCount(wxEVT_TEXT_ENTER)); #endif } #endif @@ -349,7 +354,7 @@ void TextCtrlTestCase::Url() delete m_text; CreateText(wxTE_RICH | wxTE_AUTO_URL); - EventCounter url(m_text, wxEVT_COMMAND_TEXT_URL); + EventCounter url(m_text, wxEVT_TEXT_URL); m_text->AppendText("http://www.wxwidgets.org");