]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/withimages.h
Don't create multiple parent-less top level frames in layout sample.
[wxWidgets.git] / include / wx / withimages.h
index 6ca0c902e93b0686b14979c4d2233e5f65030eec..5d38ce410ddc180ab009234dcb0cf7265e11b9e2 100644 (file)
@@ -12,6 +12,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 +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: