Don't use any icon for items inserted without one in wxMSW wxListCtrl.
Previously we erroneously used the first icon in the image list for them instead. This was inconsistent with wxGTK and didn't make much sense, even if it is the default behaviour of the native control, so don't do this any more and explicitly specify I_IMAGENONE for the icon if it wasn't given. Closes #15421. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74716 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -952,7 +952,7 @@ bool wxListCtrl::SetItemColumnImage(long item, long column, int image)
|
||||
|
||||
info.m_mask = wxLIST_MASK_IMAGE;
|
||||
info.m_image = image;
|
||||
info.m_itemId = item;
|
||||
info.m_itemId = item == -1 ? I_IMAGENONE : image;
|
||||
info.m_col = column;
|
||||
|
||||
return SetItem(info);
|
||||
@@ -1751,11 +1751,9 @@ long wxListCtrl::InsertItem(long index, int imageIndex)
|
||||
long wxListCtrl::InsertItem(long index, const wxString& label, int imageIndex)
|
||||
{
|
||||
wxListItem info;
|
||||
info.m_image = imageIndex;
|
||||
info.m_image = imageIndex == -1 ? I_IMAGENONE : imageIndex;
|
||||
info.m_text = label;
|
||||
info.m_mask = wxLIST_MASK_TEXT;
|
||||
if (imageIndex > -1)
|
||||
info.m_mask |= wxLIST_MASK_IMAGE;
|
||||
info.m_mask = wxLIST_MASK_TEXT | wxLIST_MASK_IMAGE;
|
||||
info.m_itemId = index;
|
||||
return InsertItem(info);
|
||||
}
|
||||
|
Reference in New Issue
Block a user