Add wxWithImages::GetImageCount() and HasImages() helpers
These functions allow avoiding using wxImageList explicitly in a couple of places. No real changes, this just prepares for adding new API not based on wxImageList.
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
#include "wx/imaglist.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxWithImages: mix-in class providing access to wxImageList.
|
||||
// wxWithImages: mix-in for classes using indices for image access
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxWithImages
|
||||
@@ -37,6 +37,18 @@ public:
|
||||
FreeIfNeeded();
|
||||
}
|
||||
|
||||
// Return the number of images, possibly 0.
|
||||
int GetImageCount() const
|
||||
{
|
||||
return m_imageList ? m_imageList->GetImageCount() : 0;
|
||||
}
|
||||
|
||||
// Return true if we have any images at all.
|
||||
bool HasImages() const
|
||||
{
|
||||
return GetImageCount() != 0;
|
||||
}
|
||||
|
||||
// Sets the image list to use, it is *not* deleted by the control.
|
||||
virtual void SetImageList(wxImageList* imageList)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user