Merge branch 'msw-listctrl-image-fix'

Fix resetting images of wxMSW wxListCtrl columns.
This commit is contained in:
Vadim Zeitlin
2019-10-08 02:12:38 +02:00

View File

@@ -3656,15 +3656,6 @@ static void wxConvertToMSWListCol(HWND hwndList,
{
lvCol.mask |= LVCF_IMAGE;
// we use LVCFMT_BITMAP_ON_RIGHT because the images on the right
// seem to be generally nicer than on the left and the generic
// version only draws them on the right (we don't have a flag to
// specify the image location anyhow)
//
// we don't use LVCFMT_COL_HAS_IMAGES because it doesn't seem to
// make any difference in my tests -- but maybe we should?
if ( item.m_image != -1 )
{
// as we're going to overwrite the format field, get its
// current value first -- unless we want to overwrite it anyhow
if ( !(lvCol.mask & LVCF_FMT) )
@@ -3680,8 +3671,16 @@ static void wxConvertToMSWListCol(HWND hwndList,
lvCol.mask |= LVCF_FMT;
}
lvCol.fmt |= LVCFMT_BITMAP_ON_RIGHT | LVCFMT_IMAGE;
}
// we use LVCFMT_BITMAP_ON_RIGHT because the images on the right
// seem to be generally nicer than on the left and the generic
// version only draws them on the right (we don't have a flag to
// specify the image location anyhow)
const int fmtImage = LVCFMT_BITMAP_ON_RIGHT | LVCFMT_COL_HAS_IMAGES;
if ( item.m_image != -1 )
lvCol.fmt |= fmtImage;
else // remove any existing image
lvCol.fmt &= ~fmtImage;
lvCol.iImage = item.m_image;
}