imagelst.h

Go to the documentation of this file.
00001 /****************************************************************************
00002  * \file mgui/imagelst.h
00003  * \brief MGUI::IMAGELIST class definitions
00004  *
00005  * \if NODOC
00006  * $Id: imagelst.h_v 1.11 2004/07/29 15:11:48 mju Exp $
00007  *
00008  * $Log: imagelst.h_v $
00009  * Revision 1.11  2004/07/29 15:11:48  mju
00010  * Add op= for X.
00011  * Make X methods non-inline.
00012  *
00013  * Revision 1.10  2003/10/03 19:58:19  linux32build!build
00014  * Doxygen
00015  *
00016  * Revision 1.9  2003/09/15 13:49:32  fileserver!dwilliss
00017  * Doxygen
00018  *
00019  * Revision 1.8  2003/07/25 22:22:55  dwilliss
00020  * Added an AddIcon method that takes a background color
00021  *
00022  * Revision 1.7  2002/10/09 15:53:29  mju
00023  * Moved to 'mgui' folder.
00024  *
00025  * Revision 1.6  2002/08/13 21:01:28  mju
00026  * Use mi32 instead of miwin.
00027  *
00028  * Revision 1.5  2002/03/15 23:31:32  dwilliss
00029  * When copying an image list, increment refcount of all icons (X only)
00030  *
00031  * Revision 1.4  2002/03/15 20:48:07  dwilliss
00032  * Gave a copy constructor for X
00033  *
00034  * Revision 1.3  2002/02/14 15:08:08  mju
00035  * Add comments.
00036  *
00037  * Revision 1.2  2002/02/06 22:22:09  dwilliss
00038  * Use ICONIDs which are portable between X and Windows
00039  *
00040  * Revision 1.1  2002/02/05 21:08:29  dwilliss
00041  * Initial revision
00042  * \endif
00043 ****************************************************************************/
00044 
00045 #ifndef INC_MGUI_IMAGELST_H
00046 #define INC_MGUI_IMAGELST_H
00047 
00048 
00049 #ifndef MGUI_IMAGELST_H
00050 #define MGUI_IMAGELST_H
00051 
00052 
00053 #ifndef INC_MI32_STDDEFNS_H
00054 #include <mi32/stddefns.h>
00055 #endif
00056 
00057 #ifdef WIN32_MFC
00058 #ifndef INC_MI32_STDAFX_H
00059 #include <mi32/stdafx.h>
00060 #endif
00061 #endif   //!< MFC
00062 
00063 
00064 #ifdef X_NATIVE
00065 #ifndef INC_MI32_SIMPLEAR_H
00066 #include <mi32/simplear.h>
00067 #endif
00068 #ifndef INC_MI32_MICON_H
00069 #include <mi32/micon.h>
00070 #endif
00071 #endif   //!< X Native
00072 
00073 
00074 enum ICONID;
00075 struct COLOR;
00076 
00077 namespace MGUI {
00078 
00079 
00080 //! Image list for icons, bitmaps, etc.
00081 class IMAGELIST 
00082 #ifdef WIN32_MFC
00083    : public CImageList
00084 #endif
00085    {
00086    public:
00087 
00088       //! Constructor.
00089       IMAGELIST (
00090          ) { }
00091 
00092    #ifdef X_NATIVE
00093       // Copy constructor.
00094       IMAGELIST (
00095          const IMAGELIST& rhs
00096          );
00097    #endif
00098 
00099       //! Destructor.
00100       ~IMAGELIST (); 
00101 
00102    #ifdef X_NATIVE
00103       // Assignment.
00104       IMAGELIST& operator= (
00105          const IMAGELIST& rhs
00106          );
00107    #endif
00108 
00109       //! Add an icon given an ICONID.
00110       //! @return Icon index in the image list or < 0 if an error
00111       int AddIcon (
00112          ICONID id,                       //!< Icon ID
00113          int size = 16                    //!< Icon size
00114          );
00115 
00116       //! Add an icon given an ICONID.
00117       //! @return Icon index in the image list or < 0 if an error
00118       int AddIcon (
00119          ICONID id,                       //!< Icon ID
00120          const COLOR& bgcolor,            //!< Color to use for background
00121          int size = 16                    //!< Icon size
00122          );
00123 
00124    #ifdef X_NATIVE
00125       //! Get MICON pointer for image list entry (X only).
00126       //! @return Icon pointer for use in other X functions.
00127       MICON GetIcon (
00128          int index
00129          ) const;
00130    #endif
00131 
00132    private:
00133    #ifndef GENERATING_DOXYGEN_OUTPUT
00134 
00135    #ifdef X_NATIVE
00136       SIMPLE_ARRAY<MICON> m_Icons;
00137       void AddRef ();
00138       void Free ();
00139    #endif
00140    #endif // GENERATING_DOXYGEN_OUTPUT
00141    };
00142 
00143 } // End of MGUI namespace
00144 
00145 
00146 #endif
00147 
00148 
00149 #endif  // INC_MGUI_IMAGELST_H

Generated on Tue Dec 14 13:18:17 2004 for TNTsdk by  doxygen 1.3.8-20040913