always update the column icon field when updating the item as it could be reset to nothing
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57208 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -168,17 +168,16 @@ void wxHeaderCtrl::DoSetOrInsertItem(Operation oper, unsigned int idx)
|
|||||||
|
|
||||||
// notice that we need to store the string we use the pointer to until we
|
// notice that we need to store the string we use the pointer to until we
|
||||||
// pass it to the control
|
// pass it to the control
|
||||||
wxWxCharBuffer buf;
|
|
||||||
if ( !col.GetTitle().empty() )
|
|
||||||
{
|
|
||||||
hdi.mask |= HDI_TEXT;
|
hdi.mask |= HDI_TEXT;
|
||||||
|
wxWxCharBuffer buf = col.GetTitle().wx_str();
|
||||||
buf = col.GetTitle().wx_str();
|
|
||||||
hdi.pszText = buf.data();
|
hdi.pszText = buf.data();
|
||||||
hdi.cchTextMax = wxStrlen(buf);
|
hdi.cchTextMax = wxStrlen(buf);
|
||||||
}
|
|
||||||
|
|
||||||
const wxBitmap bmp = col.GetBitmap();
|
const wxBitmap bmp = col.GetBitmap();
|
||||||
|
if ( bmp.IsOk() || oper == Set )
|
||||||
|
{
|
||||||
|
hdi.mask |= HDI_IMAGE;
|
||||||
|
|
||||||
if ( bmp.IsOk() )
|
if ( bmp.IsOk() )
|
||||||
{
|
{
|
||||||
const int bmpWidth = bmp.GetWidth(),
|
const int bmpWidth = bmp.GetWidth(),
|
||||||
@@ -201,11 +200,15 @@ void wxHeaderCtrl::DoSetOrInsertItem(Operation oper, unsigned int idx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_imageList->Add(bmp);
|
m_imageList->Add(bmp);
|
||||||
hdi.mask |= HDI_IMAGE;
|
|
||||||
hdi.iImage = m_imageList->GetImageCount() - 1;
|
hdi.iImage = m_imageList->GetImageCount() - 1;
|
||||||
}
|
}
|
||||||
|
else // no bitmap but we still need to update the item
|
||||||
|
{
|
||||||
|
hdi.iImage = I_IMAGENONE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ( col.GetAlignment() != wxALIGN_NOT )
|
if ( col.GetAlignment() != wxALIGN_NOT || oper == Set )
|
||||||
{
|
{
|
||||||
hdi.mask |= HDI_FORMAT;
|
hdi.mask |= HDI_FORMAT;
|
||||||
switch ( col.GetAlignment() )
|
switch ( col.GetAlignment() )
|
||||||
|
Reference in New Issue
Block a user