]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/withimages.h
Don't define __STRICT_ANSI__, we should build both with and without it.
[wxWidgets.git] / include / wx / withimages.h
index 6ca0c902e93b0686b14979c4d2233e5f65030eec..89120d3eb7e87b6e4fcff6314f7ba75412dd5297 100644 (file)
@@ -3,7 +3,6 @@
 // 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
 ///////////////////////////////////////////////////////////////////////////////
@@ -12,6 +11,7 @@
 #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;
@@ -55,13 +60,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: