+#if wxUSE_UIACTIONSIMULATOR && defined(__WXMSW__)
+ delete m_text;
+ m_text = new wxTextCtrl(wxTheApp->GetTopWindow(), wxID_ANY, "",
+ wxDefaultPosition, wxDefaultSize,
+ wxTE_MULTILINE | wxTE_RICH | wxTE_AUTO_URL);
+
+ wxTestableFrame* frame = wxStaticCast(wxTheApp->GetTopWindow(),
+ wxTestableFrame);
+
+ EventCounter count(m_text, wxEVT_COMMAND_TEXT_URL);
+
+ m_text->AppendText("http://www.wxwidgets.org");
+
+ wxUIActionSimulator sim;
+ sim.MouseMove(m_text->ClientToScreen(wxPoint(5, 5)));
+ sim.MouseClick();
+ wxYield();
+
+ CPPUNIT_ASSERT_EQUAL(1, frame->GetEventCount());
+#endif
+}
+
+void TextCtrlTestCase::Style()
+{
+#ifndef __WXOSX__
+ delete m_text;
+ // We need wxTE_RICH under windows for style support
+ m_text = new wxTextCtrl(wxTheApp->GetTopWindow(), wxID_ANY, "",
+ wxDefaultPosition, wxDefaultSize, wxTE_RICH);
+
+ // Red text on a white background
+ m_text->SetDefaultStyle(wxTextAttr(*wxRED, *wxWHITE));
+
+ CPPUNIT_ASSERT_EQUAL(m_text->GetDefaultStyle().GetTextColour(), *wxRED);
+ CPPUNIT_ASSERT_EQUAL(m_text->GetDefaultStyle().GetBackgroundColour(),
+ *wxWHITE);
+
+ m_text->AppendText("red on white ");
+
+ // Red text on a grey background
+ m_text->SetDefaultStyle(wxTextAttr(wxNullColour, *wxLIGHT_GREY));
+
+ CPPUNIT_ASSERT_EQUAL(m_text->GetDefaultStyle().GetTextColour(), *wxRED);
+ CPPUNIT_ASSERT_EQUAL(m_text->GetDefaultStyle().GetBackgroundColour(),
+ *wxLIGHT_GREY);
+
+ m_text->AppendText("red on grey ");
+
+ // Blue text on a grey background
+ m_text->SetDefaultStyle(wxTextAttr(*wxBLUE));
+
+
+ CPPUNIT_ASSERT_EQUAL(m_text->GetDefaultStyle().GetTextColour(), *wxBLUE);
+ CPPUNIT_ASSERT_EQUAL(m_text->GetDefaultStyle().GetBackgroundColour(),
+ *wxLIGHT_GREY);
+
+ m_text->AppendText("blue on grey");
+
+ // Get getting the style at a specific location
+ wxTextAttr style;
+
+ // We have to check that styles are supported
+ if(m_text->GetStyle(3, style))