]> git.saurik.com Git - wxWidgets.git/blobdiff - tests/controls/virtlistctrltest.cpp
No changes, just refactor wxMSW background brush methods.
[wxWidgets.git] / tests / controls / virtlistctrltest.cpp
index ea049042f4617452410f0977f430904df9da6564..1d52ce5df5f642acd2308c9760f7210a08d41425 100644 (file)
@@ -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()