3ds Max C++ API Reference
DynamicMenu Class Reference

Provides an easy mechanism for plug-ins to produce the menu needed in the ActionItem::GetDynamicMenu() method. More...

#include <actiontable.h>

+ Inheritance diagram for DynamicMenu:

Public Types

enum  DynamicMenuFlags { kDisabled = 1 << 0 , kChecked = 1 << 1 , kSeparator = 1 << 2 }
 Constants used in AddItem. More...
 

Public Member Functions

CoreExport DynamicMenu (DynamicMenuCallback *pCallback)
 Constructor. More...
 
CoreExport IMenuGetMenu ()
 This is the value returned from ActionItem::GetDynamicMenu(). More...
 
CoreExport void AddItem (DWORD flags, UINT itemId, const MCHAR *pItemTitle)
 Adds an item to the dynamic menu. More...
 
CoreExport void BeginSubMenu (const MCHAR *pTitle)
 This begins a new sub menu. More...
 
CoreExport void EndSubMenu ()
 Ends construction of a sub menu. More...
 

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

Provides an easy mechanism for plug-ins to produce the menu needed in the ActionItem::GetDynamicMenu() method.

The constructor of this class is used to create the menu and the ActionItem::GetMenu() method returns the appropriate IMenu pointer.

Version
4.0
See also
Class DynamicMenuCallback, Class IMenu, Class ActionTable, Class ActionItem, Class ActionCallback, Class ActionContext, Class IActionManager, Class Interface.

Member Enumeration Documentation

◆ DynamicMenuFlags

Constants used in AddItem.

Enumerator
kDisabled 
kChecked 
kSeparator 
1085  {
1086  kDisabled = 1 << 0, //< Item is disabled (can't be selected)
1087  kChecked = 1 << 1, //< Item has a check mark beside it or is pressed
1088  kSeparator = 1 << 2, //< Item is a seperator between the previous menu item and the next one.
1089  };
@ kDisabled
Definition: actiontable.h:1086
@ kSeparator
Definition: actiontable.h:1088
@ kChecked
Definition: actiontable.h:1087

Constructor & Destructor Documentation

◆ DynamicMenu()

Constructor.

Parameters
pCallbackPoints to the instance of the DynamicMenuCallback class that handles the menu selection.

Member Function Documentation

◆ GetMenu()

CoreExport IMenu* GetMenu ( )

This is the value returned from ActionItem::GetDynamicMenu().

This method may be called after menu creation to get a pointer to the IMenu created.

Returns
A pointer to Imenu that can be returned from ActionItem::GetDynamicMenu(*)

◆ AddItem()

CoreExport void AddItem ( DWORD  flags,
UINT  itemId,
const MCHAR pItemTitle 
)

Adds an item to the dynamic menu.

Parameters
flagsOne or more of the DynamicMenuFlags.
itemIdThe ID for the menu item.
pItemTitleThe name to appear for the menu item.

◆ BeginSubMenu()

CoreExport void BeginSubMenu ( const MCHAR pTitle)

This begins a new sub menu.

Items added after this call will appear as sub choices of this one until EndSubMenu() is called.

Parameters
pTitleThe name to appear for the sub menu item.

◆ EndSubMenu()

CoreExport void EndSubMenu ( )

Ends construction of a sub menu.

Items added after this call will appear as they did prior to calling BeginSubMenu().