X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/681694bca959aa25670a22ee70833f5a71e39fca..f321d0bc0caf4d78ccc5426e926fc25c46297439:/tests/controls/virtlistctrltest.cpp diff --git a/tests/controls/virtlistctrltest.cpp b/tests/controls/virtlistctrltest.cpp index ea049042f4..78137b31d8 100644 --- a/tests/controls/virtlistctrltest.cpp +++ b/tests/controls/virtlistctrltest.cpp @@ -52,7 +52,7 @@ private: // register in the unnamed registry so that these tests are run by default CPPUNIT_TEST_SUITE_REGISTRATION( VirtListCtrlTestCase ); -// also include in it's own registry so that these tests can be run alone +// also include in its own registry so that these tests can be run alone CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( VirtListCtrlTestCase, "VirtListCtrlTestCase" ); // ---------------------------------------------------------------------------- @@ -61,9 +61,26 @@ CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( VirtListCtrlTestCase, "VirtListCtrlTestCa void VirtListCtrlTestCase::setUp() { - m_list = new wxListCtrl(wxTheApp->GetTopWindow(), wxID_ANY, - wxPoint(0, 0), wxSize(400, 200), - wxLC_REPORT | wxLC_VIRTUAL); + // Define a class overriding OnGetItemText() which must be overridden for + // any virtual list control. + class VirtListCtrl : public wxListCtrl + { + public: + VirtListCtrl() + : wxListCtrl(wxTheApp->GetTopWindow(), wxID_ANY, + wxPoint(0, 0), wxSize(400, 200), + wxLC_REPORT | wxLC_VIRTUAL) + { + } + + protected: + virtual wxString OnGetItemText(long item, long column) const + { + return wxString::Format("Row %ld, col %ld", item, column); + } + }; + + m_list = new VirtListCtrl; } void VirtListCtrlTestCase::tearDown()