- Added wxGenericStaticBitmap suitable for display of large bitmaps.
- Support wxListCtrl::GetViewRect() in report view too.
- Implement wxListCtrl::GetSubItemRect() in generic version (David Barnard).
+- Add column parameter to wxListCtrl::GetItemText() (Allann Jones).
- Added wxVListBox::GetItemRect() (Javier Urien).
- Show busy cursor in wxLaunchDefaultBrowser and add wxBROWSER_NOBUSYCURSOR.
- Added wxFlexGridSizer::Is{Row,Col}Growable() (Marcin Wojdyr).
bool SetItemState( long item, long state, long stateMask);
bool SetItemImage( long item, int image, int selImage = -1 );
bool SetItemColumnImage( long item, long column, int image );
- wxString GetItemText( long item ) const;
+ wxString GetItemText( long item, int col = 0 ) const;
void SetItemText( long item, const wxString& str );
wxUIntPtr GetItemData( long item ) const;
bool SetItemPtrData(long item, wxUIntPtr data);
bool SetItemColumnImage(long item, long column, int image);
// Gets the item text
- wxString GetItemText(long item) const;
+ wxString GetItemText(long item, int col = 0) const;
// Sets the item text
void SetItemText(long item, const wxString& str);
/**
Gets the item text for this item.
+
+ @param item
+ Item (zero-based) index.
+ @param col
+ Item column (zero-based) index. Column 0 is the default. This
+ parameter is new in wxWidgets 2.9.1.
*/
- wxString GetItemText(long item) const;
+ wxString GetItemText(long item, int col = 0) const;
/**
Returns the colour for this item.
return true;
}
-wxString wxGenericListCtrl::GetItemText( long item ) const
+wxString wxGenericListCtrl::GetItemText( long item, int col ) const
{
- return m_mainWin->GetItemText(item);
+ return m_mainWin->GetItemText(item, col);
}
void wxGenericListCtrl::SetItemText( long item, const wxString& str )
}
// Gets the item text
-wxString wxListCtrl::GetItemText(long item) const
+wxString wxListCtrl::GetItemText(long item, int col) const
{
wxListItem info;
info.m_mask = wxLIST_MASK_TEXT;
info.m_itemId = item;
+ info.m_col = col;
if (!GetItem(info))
return wxEmptyString;
CPPUNIT_TEST( ColumnsOrder );
#endif // wxHAS_LISTCTRL_COLUMN_ORDER
CPPUNIT_TEST( ItemRect );
+ CPPUNIT_TEST( ItemText );
CPPUNIT_TEST( ChangeMode );
CPPUNIT_TEST_SUITE_END();
void ColumnsOrder();
#endif // wxHAS_LISTCTRL_COLUMN_ORDER
void ItemRect();
+ void ItemText();
void ChangeMode();
wxListCtrl *m_list;
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");