maxicon.h

Go to the documentation of this file.
00001  /**********************************************************************
00002  *<
00003    FILE: MaxIcon.h
00004 
00005    DESCRIPTION: Max Icon and Icon Table definitions
00006 
00007    CREATED BY: Scott Morrison
00008 
00009    HISTORY: Created 15 March, 2000,
00010 
00011  *>   Copyright (c) 2000, All Rights Reserved.
00012  **********************************************************************/
00013 
00014 #pragma once
00015 
00016 #include "object.h"
00017 #include "iColorMan.h"
00018 #include "strbasic.h"
00019 
00020 class ICustButton;
00021 
00029 class MaxIcon : public InterfaceServer {
00030 public:
00032     CoreExport virtual ~MaxIcon();
00033     // Get the image list for the size of icons that the user has chose
00036     virtual HIMAGELIST GetDefaultImageList()  = 0;
00037     // Get the image list for small icons
00039     virtual HIMAGELIST GetSmallImageList()  = 0;
00040     // Get the image list for large icons
00042     virtual HIMAGELIST GetLargeImageList()  = 0;
00043 
00044     // Get the index into the image list for the small version of this
00045     // particular icon.
00057     virtual int GetSmallImageIndex(bool enabledVersion = true,
00058                                    COLORREF backgroundColor =
00059                                    GetCustSysColor( COLOR_BTNFACE) ) = 0;
00060     // Get the index into the image list for the large version of this
00061     // particular icon.
00073     virtual int GetLargeImageIndex(bool enabledVersion = true,
00074                                    COLORREF backgroundColor =
00075                                    GetCustSysColor( COLOR_BTNFACE) ) = 0;
00076     // Get the index into the image list for the default version of this
00077     // particular icon.
00089             int GetDefaultImageIndex(bool enabledVersion = true,
00090                                      COLORREF backgroundColor =
00091                                      GetCustSysColor( COLOR_BTNFACE) );
00092 
00093     // returns true if the icons has an alpha mask that needs to be blended
00094     // with the background color.
00098     virtual bool UsesAlphaMask() = 0;
00099 };
00100 
00101 // This implementation of MaxIcon is for the icon images that are stored
00102 // as ".bmp" files in MAX's UI directory.  This is used by the macroScript
00103 // facility in MAXSrcipt to specify icons.  See the documentation for
00104 // "macroScript" for the exact meaning of the filename and index.
00105 
00113 class MaxBmpFileIcon: public MaxIcon {
00114 public:
00116     CoreExport ~MaxBmpFileIcon();
00123     CoreExport MaxBmpFileIcon(const MCHAR* pFilePrefix, int index);
00130     CoreExport MaxBmpFileIcon(SClass_ID sid, Class_ID cid);
00131 
00134     CoreExport HIMAGELIST GetDefaultImageList();
00136     CoreExport HIMAGELIST GetSmallImageList();
00138     CoreExport HIMAGELIST GetLargeImageList();
00139 
00150     CoreExport int GetSmallImageIndex(bool enabledVersion = true,
00151                                       COLORREF backgroundColor =
00152                                       GetCustSysColor( COLOR_BTNFACE) );
00163     CoreExport int GetLargeImageIndex(bool enabledVersion = true,
00164                                       COLORREF backgroundColor =
00165                                       GetCustSysColor( COLOR_BTNFACE) );
00166 
00169     CoreExport bool UsesAlphaMask();
00171     CoreExport MSTR& GetFilePrefix() { return mFilePrefix; }
00173     CoreExport int GetIndex() { return mIndex; }
00174 
00176     CoreExport void SetKeepColor() { mKeepColor = true; }
00177 
00179     CoreExport bool GetKeepColor() { return mKeepColor; }
00180 
00181 private:
00182     int     mIndex;
00183     MSTR    mFilePrefix;
00184     bool    mKeepColor;
00185 };
00186 
00187 CoreExport HIMAGELIST GetIconManDefaultImageList();
00188 CoreExport HIMAGELIST GetIconManSmallImageList();
00189 CoreExport HIMAGELIST GetIconManLargeImageList();
00190 
00191 CoreExport BOOL LoadMAXFileIcon(MCHAR* pFile, HIMAGELIST hImageList, ColorId color, BOOL disabled);
00192