Add wxListCtrl::Set{Normal,Small}Images()
These new functions allow to use wxBitmapBundle for the images in this control instead of wxImageList. Update the sample to use the new API.
This commit is contained in:
@@ -315,11 +315,11 @@ bool wxListCtrl::Create(wxWindow *parent,
|
||||
|
||||
// If SetImageList() had been called before the control was created, take
|
||||
// it into account now.
|
||||
if ( wxImageList* const iml = GetImageList(wxIMAGE_LIST_NORMAL) )
|
||||
if ( wxImageList* const iml = GetUpdatedImageList(wxIMAGE_LIST_NORMAL) )
|
||||
ListView_SetImageList(GetHwnd(), GetHimagelistOf(iml), LVSIL_NORMAL);
|
||||
if ( wxImageList* const iml = GetImageList(wxIMAGE_LIST_SMALL) )
|
||||
if ( wxImageList* const iml = GetUpdatedImageList(wxIMAGE_LIST_SMALL) )
|
||||
ListView_SetImageList(GetHwnd(), GetHimagelistOf(iml), LVSIL_SMALL);
|
||||
if ( wxImageList* const iml = GetImageList(wxIMAGE_LIST_STATE) )
|
||||
if ( wxImageList* const iml = GetUpdatedImageList(wxIMAGE_LIST_STATE) )
|
||||
ListView_SetImageList(GetHwnd(), GetHimagelistOf(iml), LVSIL_STATE);
|
||||
|
||||
return true;
|
||||
@@ -1509,7 +1509,7 @@ long wxListCtrl::GetNextItem(long item, int geom, int state) const
|
||||
}
|
||||
|
||||
|
||||
void wxListCtrl::DoSetImageList(wxImageList *imageList, int which)
|
||||
void wxListCtrl::DoUpdateImages(int which)
|
||||
{
|
||||
// It's possible that this function is called before the control is
|
||||
// created, don't do anything else in this case -- the image list will be
|
||||
@@ -1537,6 +1537,8 @@ void wxListCtrl::DoSetImageList(wxImageList *imageList, int which)
|
||||
return;
|
||||
}
|
||||
|
||||
wxImageList* const imageList = GetUpdatedImageList(which);
|
||||
|
||||
(void) ListView_SetImageList(GetHwnd(), (HIMAGELIST) imageList ? imageList->GetHIMAGELIST() : 0, flags);
|
||||
|
||||
// For ComCtl32 prior 6.0 we need to re-assign all existing
|
||||
|
||||
Reference in New Issue
Block a user