3ds Max C++ API Reference
MaxBmpFileIcon Class Reference

Implements icon support for icon images stored as image files on disk, or compiled resources in .rcc files. More...

#include <maxicon.h>

+ Inheritance diagram for MaxBmpFileIcon:

Public Member Functions

CoreExport ~MaxBmpFileIcon ()
 Default Destructor. More...
 
CoreExport MaxBmpFileIcon (const MCHAR *pFilePrefix, int index)
 
CoreExport MaxBmpFileIcon (const MCHAR *iconName)
 
CoreExport MaxBmpFileIcon (SClass_ID sid, Class_ID cid)
 
CoreExport HIMAGELIST GetDefaultImageList ()
 
CoreExport HIMAGELIST GetSmallImageList ()
 
CoreExport HIMAGELIST GetLargeImageList ()
 
CoreExport int GetSmallImageIndex (bool enabledVersion=true, COLORREF backgroundColor=GetCustSysColor(COLOR_BTNFACE))
 
CoreExport int GetLargeImageIndex (bool enabledVersion=true, COLORREF backgroundColor=GetCustSysColor(COLOR_BTNFACE))
 
CoreExport bool UsesAlphaMask ()
 
CoreExport MSTRGetFilePrefix ()
 
CoreExport int GetIndex ()
 
CoreExport const MSTRGetIconName () const
 
CoreExport void SetKeepColor ()
 
CoreExport bool GetKeepColor ()
 
CoreExport MSTR GetIconPath ()
 /return Returns the full path of a Bmp icon file. More...
 
- Public Member Functions inherited from MaxIcon
virtual CoreExport ~MaxIcon ()
 Destructor. More...
 
int GetDefaultImageIndex (bool enabledVersion=true, COLORREF backgroundColor=GetCustSysColor(COLOR_BTNFACE))
 
- Public Member Functions inherited from InterfaceServer
virtual UtilExport ~InterfaceServer ()
 Destructor. More...
 
virtual UtilExport BaseInterfaceGetInterface (Interface_ID id)
 
template<class InterfaceType >
InterfaceType * GetTypedInterface ()
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

Detailed Description

Implements icon support for icon images stored as image files on disk, or compiled resources in .rcc files.

This class supports two types of icons: legacy icons that are stored as image list ".bmp" files in 3ds Max's UI directory, and multi-resoution icons that support 4K / high DPI displays.

This class is used by the macroScript facility in MAXScript to specify icons. See the MAXScript documentation for "macroScript" for the exact meaning of the filename and index and details.

See also
Class MaxIcon, Class ICustButton.

Constructor & Destructor Documentation

◆ ~MaxBmpFileIcon()

Default Destructor.

◆ MaxBmpFileIcon() [1/3]

CoreExport MaxBmpFileIcon ( const MCHAR pFilePrefix,
int  index 
)
Remarks
Constructor.
Parameters
pFilePrefixThe file prefix to initialize with.
indexThe index of the icon.
Note
This constructor is for legacy icons stored as image list .bmp files in the UI_ln directory.

◆ MaxBmpFileIcon() [2/3]

CoreExport MaxBmpFileIcon ( const MCHAR iconName)
Remarks
Constructor. Creates a MaxBmpFileIcon which refers to a multi-resolution icon.
Parameters
iconNameThe name of the icon.
See also
QIcon MaxSDK::LoadMaxMultiResIcon( const QString& iconName ) for more details about how to specify the icon path and how to register resources to load icons from.
The howto/ui/menudemo sample contains an example of how to use this API.
// mi1 = std::make_unique<MaxBmpFileIcon>(_T("MenuDemo/Test1"));
// This is PNG file on disk at:
// <3dsmax.exe>\UI_ln\Icons\Dark[Light]\MenuDemo
m_MaxIcons[0] = std::make_unique<MaxBmpFileIcon>(_T(":/MenuDemo/Icons/Test1"));
// This is inside RCC file on disk, or embedded at location
// registered in RegisterDynamicResources method.

◆ MaxBmpFileIcon() [3/3]

Remarks
Constructor.
Parameters
sidThe superclass ID

cidThe class ID/

Member Function Documentation

◆ GetDefaultImageList()

CoreExport HIMAGELIST GetDefaultImageList ( )
virtual
Remarks
Returns the handle to the image list for the size of icons that the user has chosen.

Implements MaxIcon.

◆ GetSmallImageList()

CoreExport HIMAGELIST GetSmallImageList ( )
virtual
Remarks
Returns the image list for small icons.

Implements MaxIcon.

◆ GetLargeImageList()

CoreExport HIMAGELIST GetLargeImageList ( )
virtual
Remarks
Returns the image list for large icons.

Implements MaxIcon.

◆ GetSmallImageIndex()

CoreExport int GetSmallImageIndex ( bool  enabledVersion = true,
COLORREF  backgroundColor = GetCustSysColor(COLOR_BTNFACE) 
)
virtual
Remarks
Returns the zero based index into the image list for the small version of this particular icon.
Parameters
enabledVersionPass true for the enabled version of the icon; false for the disabled version.
backgroundColorThe background color for use in alpha blending. The files that define these icons always have an alpha mask, and so a background color is needed to blend it with.

Implements MaxIcon.

◆ GetLargeImageIndex()

CoreExport int GetLargeImageIndex ( bool  enabledVersion = true,
COLORREF  backgroundColor = GetCustSysColor(COLOR_BTNFACE) 
)
virtual
Remarks
Returns the zero based index into the image list for the large version of this particular icon.
Parameters
enabledVersionPass true for the enabled version of the icon; false for the disabled version.
backgroundColorThe background color for use in alpha blending. The files that define these icons always have an alpha mask, and so a background color is needed to blend it with.

Implements MaxIcon.

◆ UsesAlphaMask()

CoreExport bool UsesAlphaMask ( )
virtual
Remarks
Returns true if the icon uses an alpha mask; otherwise false.

Implements MaxIcon.

◆ GetFilePrefix()

CoreExport MSTR& GetFilePrefix ( )
inline
Remarks
Returns the directory of the icon.
180 { return mFilePrefix; }

◆ GetIndex()

CoreExport int GetIndex ( )
inline
Remarks
Returns the index of the icon in the image file list.
182 { return mIndex; }

◆ GetIconName()

CoreExport const MSTR& GetIconName ( ) const
Remarks
Returns the name of the multi-resolution icon.
See also
QIcon MaxSDK::LoadMaxMultiResIcon( const QString& iconName )

◆ SetKeepColor()

CoreExport void SetKeepColor ( )
inline
Remarks
Tells the icon to limit color correction.
190 { mKeepColor = true; }

◆ GetKeepColor()

CoreExport bool GetKeepColor ( )
inline
Returns
Tells the icon to limit color correction.
193 { return mKeepColor; }

◆ GetIconPath()

CoreExport MSTR GetIconPath ( )

/return Returns the full path of a Bmp icon file.