Merge branch 'msw-listctrl-image-fix'
Fix resetting images of wxMSW wxListCtrl columns.
This commit is contained in:
@@ -3656,32 +3656,31 @@ static void wxConvertToMSWListCol(HWND hwndList,
|
|||||||
{
|
{
|
||||||
lvCol.mask |= LVCF_IMAGE;
|
lvCol.mask |= LVCF_IMAGE;
|
||||||
|
|
||||||
|
// 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) )
|
||||||
|
{
|
||||||
|
LV_COLUMN lvColOld;
|
||||||
|
wxZeroMemory(lvColOld);
|
||||||
|
lvColOld.mask = LVCF_FMT;
|
||||||
|
if ( ListView_GetColumn(hwndList, col, &lvColOld) )
|
||||||
|
{
|
||||||
|
lvCol.fmt = lvColOld.fmt;
|
||||||
|
}
|
||||||
|
|
||||||
|
lvCol.mask |= LVCF_FMT;
|
||||||
|
}
|
||||||
|
|
||||||
// we use LVCFMT_BITMAP_ON_RIGHT because the images on the right
|
// we use LVCFMT_BITMAP_ON_RIGHT because the images on the right
|
||||||
// seem to be generally nicer than on the left and the generic
|
// 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
|
// version only draws them on the right (we don't have a flag to
|
||||||
// specify the image location anyhow)
|
// specify the image location anyhow)
|
||||||
//
|
const int fmtImage = LVCFMT_BITMAP_ON_RIGHT | LVCFMT_COL_HAS_IMAGES;
|
||||||
// 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 )
|
if ( item.m_image != -1 )
|
||||||
{
|
lvCol.fmt |= fmtImage;
|
||||||
// as we're going to overwrite the format field, get its
|
else // remove any existing image
|
||||||
// current value first -- unless we want to overwrite it anyhow
|
lvCol.fmt &= ~fmtImage;
|
||||||
if ( !(lvCol.mask & LVCF_FMT) )
|
|
||||||
{
|
|
||||||
LV_COLUMN lvColOld;
|
|
||||||
wxZeroMemory(lvColOld);
|
|
||||||
lvColOld.mask = LVCF_FMT;
|
|
||||||
if ( ListView_GetColumn(hwndList, col, &lvColOld) )
|
|
||||||
{
|
|
||||||
lvCol.fmt = lvColOld.fmt;
|
|
||||||
}
|
|
||||||
|
|
||||||
lvCol.mask |= LVCF_FMT;
|
|
||||||
}
|
|
||||||
|
|
||||||
lvCol.fmt |= LVCFMT_BITMAP_ON_RIGHT | LVCFMT_IMAGE;
|
|
||||||
}
|
|
||||||
|
|
||||||
lvCol.iImage = item.m_image;
|
lvCol.iImage = item.m_image;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user