+#if wxHAS_TEXT_WINDOW_STREAM && wxUSE_STD_IOSTREAM
+
+ wxStreamToTextRedirector redirect(m_text);
+
+ std::cout << "stringinput"
+ << 10
+ << 1000L
+ << 3.14f
+ << 2.71
+ << 'a';
+
+ CPPUNIT_ASSERT_EQUAL("stringinput1010003.142.71a", m_text->GetValue());
+
+#endif
+}
+
+#if 0
+void TextCtrlTestCase::ProcessEnter()
+{
+#if wxUSE_UIACTIONSIMULATOR
+ wxTestableFrame* frame = wxStaticCast(wxTheApp->GetTopWindow(),
+ wxTestableFrame);
+
+ EventCounter count(m_text, wxEVT_COMMAND_TEXT_ENTER);
+
+ m_text->SetFocus();
+
+ wxUIActionSimulator sim;
+ sim.Char(WXK_RETURN);
+ wxYield();
+
+ CPPUNIT_ASSERT_EQUAL(0, frame->GetEventCount(wxEVT_COMMAND_TEXT_ENTER));
+
+ // we need a text control with wxTE_PROCESS_ENTER for this test
+ delete m_text;
+ CreateText(wxTE_PROCESS_ENTER);
+
+ m_text->SetFocus();
+
+ sim.Char(WXK_RETURN);
+ wxYield();
+
+ CPPUNIT_ASSERT_EQUAL(1, frame->GetEventCount(wxEVT_COMMAND_TEXT_ENTER));
+#endif
+}
+#endif
+
+void TextCtrlTestCase::Url()
+{
+#if wxUSE_UIACTIONSIMULATOR && defined(__WXMSW__)
+ delete m_text;
+ CreateText(wxTE_RICH | wxTE_AUTO_URL);
+
+ EventCounter url(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, url.GetCount());
+#endif
+}
+
+void TextCtrlTestCase::Style()
+{
+#ifndef __WXOSX__
+ delete m_text;
+ // We need wxTE_RICH under windows for style support
+ CreateText(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))
+ {
+ CPPUNIT_ASSERT_EQUAL(style.GetTextColour(), *wxRED);
+ CPPUNIT_ASSERT_EQUAL(style.GetBackgroundColour(), *wxWHITE);
+ }
+
+ // And then setting the style
+ if(m_text->SetStyle(15, 18, style))
+ {
+ m_text->GetStyle(17, style);
+
+ CPPUNIT_ASSERT_EQUAL(style.GetTextColour(), *wxRED);
+ CPPUNIT_ASSERT_EQUAL(style.GetBackgroundColour(), *wxWHITE);
+ }
+#endif
+}
+
+void TextCtrlTestCase::FontStyle()
+{
+ // We need wxTE_RICH under MSW and wxTE_MULTILINE under GTK for style
+ // support so recreate the control with these styles.
+ delete m_text;
+ CreateText(wxTE_RICH);
+
+ // Check that we get back the same font from GetStyle() after setting it
+ // with SetDefaultStyle().
+ wxFont fontIn(14,
+ wxFONTFAMILY_DEFAULT,
+ wxFONTSTYLE_NORMAL,
+ wxFONTWEIGHT_NORMAL);
+ wxTextAttr attrIn;
+ attrIn.SetFont(fontIn);
+ if ( !m_text->SetDefaultStyle(attrIn) )