Add column parameter to wxListCtrl::GetItemText().

Allow retrieving the text from columns other than the first one directly.

Add implementations for MSW and generic versions, documentation and a unit
test.

Closes #11597.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64281 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-05-10 21:22:16 +00:00
parent 654e324628
commit b6812a6f19
7 changed files with 29 additions and 6 deletions

View File

@@ -41,6 +41,7 @@ private:
CPPUNIT_TEST( ColumnsOrder );
#endif // wxHAS_LISTCTRL_COLUMN_ORDER
CPPUNIT_TEST( ItemRect );
CPPUNIT_TEST( ItemText );
CPPUNIT_TEST( ChangeMode );
CPPUNIT_TEST_SUITE_END();
@@ -48,6 +49,7 @@ private:
void ColumnsOrder();
#endif // wxHAS_LISTCTRL_COLUMN_ORDER
void ItemRect();
void ItemText();
void ChangeMode();
wxListCtrl *m_list;
@@ -178,6 +180,19 @@ void ListCtrlTestCase::ItemRect()
WX_ASSERT_FAILS_WITH_ASSERT( m_list->GetSubItemRect(0, 3, r) );
}
void ListCtrlTestCase::ItemText()
{
m_list->InsertColumn(0, "First");
m_list->InsertColumn(1, "Second");
m_list->InsertItem(0, "0,0");
CPPUNIT_ASSERT_EQUAL( "0,0", m_list->GetItemText(0) );
CPPUNIT_ASSERT_EQUAL( "", m_list->GetItemText(0, 1) );
m_list->SetItem(0, 1, "0,1");
CPPUNIT_ASSERT_EQUAL( "0,1", m_list->GetItemText(0, 1) );
}
void ListCtrlTestCase::ChangeMode()
{
m_list->InsertColumn(0, "Header");