Class DynamicMenu

3DS Max Plug-In SDK

Class DynamicMenu

See Also: Class DynamicMenuCallback, Class IMenu, Class ActionTable, Class ActionItem, Class ActionCallback, Class ActionContext, Class IActionManager, Class Interface.

class DynamicMenu

Description:

This class is available in release 4.0 and later only.

This class provides a simple way 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 GetMenu() method returns the appropriate IMenu pointer.

Methods:

public:

Prototype:

DynamicMenu(DynamicMenuCallback* pCallback);

Remarks:

Constructor.

Parameters:

DynamicMenuCallback* pCallback

Points to the instance of the DynamicMenuCallback class that handles the menu selection.

Prototype:

IMenu* GetMenu();

Remarks:

Returns a pointer to the IMenu. This method may be called after menu creation to get a pointer to the IMenu created. This is the required value to return from ActionItem::GetDynamicMenu().

Prototype:

void AddItem(DWORD flags, UINT itemId, TCHAR* pItemTitle);

Remarks:

This method adds an item to the dynamic menu.

Parameters:

DWORD flags

One or more of the following values:

kDisabled

Item is disabled (can't be selected)

kChecked

Item has a check mark beside it.

kSeparator

Item is a seperator between the previous menu item and the next one.

UINT itemId

The ID for the menu item.

TCHAR* pItemTitle

The name to appear for the menu item.

Prototype:

void BeginSubMenu(TCHAR* pTitle);

Remarks:

This begins a new sub menu. Items added after this call will appear as sub choices of this one until EndSubMenu() is called.

Parameters:

TCHAR* pTitle

The name to appear for the sub menu item.

Prototype:

void EndSubMenu();

Remarks:

This ends a sub menu. Items added after this call will appear as they did prior to calling BeginSubMenu().