X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/abfdefede3209ac777bdac8a65bae8bf008f327b..ab67e8874db324fab5223cc8d5dff8a8de3e2b77:/include/wx/withimages.h diff --git a/include/wx/withimages.h b/include/wx/withimages.h index 6ca0c902e9..5d38ce410d 100644 --- a/include/wx/withimages.h +++ b/include/wx/withimages.h @@ -12,6 +12,7 @@ #define _WX_WITHIMAGES_H_ #include "wx/defs.h" +#include "wx/icon.h" #include "wx/imaglist.h" // ---------------------------------------------------------------------------- @@ -21,6 +22,11 @@ class WXDLLIMPEXP_CORE wxWithImages { public: + enum + { + NO_IMAGE = -1 + }; + wxWithImages() { m_imageList = NULL; @@ -55,13 +61,13 @@ protected: // 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: