// Purpose: Declaration of a simple wxWithImages class.
// Author: Vadim Zeitlin
// Created: 2011-08-17
-// RCS-ID: $Id: wxhead.h,v 1.12 2010-04-22 12:44:51 zeitlin Exp $
// Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#define _WX_WITHIMAGES_H_
#include "wx/defs.h"
+#include "wx/icon.h"
#include "wx/imaglist.h"
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxWithImages
{
public:
+ enum
+ {
+ NO_IMAGE = -1
+ };
+
wxWithImages()
{
m_imageList = NULL;
// Return the image with the given index from the image list.
//
- // If there is no image list or if index == -1 (which traditionally means
- // that no image should be used for the given item), silently returns
+ // If there is no image list or if index == NO_IMAGE, silently returns
// wxNullIcon.
wxIcon GetImage(int iconIndex) const
{
- return m_imageList && iconIndex != -1 ? m_imageList->GetIcon(iconIndex)
- : wxNullIcon;
+ return m_imageList && iconIndex != NO_IMAGE
+ ? m_imageList->GetIcon(iconIndex)
+ : wxNullIcon;
}
private: