Class RightClickMenuManager

3DS Max Plug-In SDK

Class RightClickMenuManager

See Also: Class RightClickMenu, Class Interface.

class RightClickMenuManager

Description:

Methods of this class allow a developer to extend the menu presented when a user right clicks on an item in the viewports. All methods of this class are implemented by the system.

Methods:

Prototype:

void Register(RightClickMenu *menu);

Remarks:

This method is used to register an instance of a class derived from RightClickMenu. This allows its methods to be called when the user right clicks on an object in a viewport.

Parameters:

RightClickMenu *menu

The menu to set as register.

Prototype:

void Unregister(RightClickMenu *menu);

Remarks:

This method is used to un-register a registered right click menu.

Parameters:

RightClickMenu *menu

The menu to set as un-register.

Prototype:

int AddMenu(RightClickMenu *menu, UINT flags, UINT id, LPCTSTR data);

Remarks:

This method is called to add items to the right click menu passed. A string or separator may be added. Strings may be checked or unchecked. They may also be disabled and grayed.

Parameters:

RightClickMenu *menu

The menu to add the item to.

UINT flags

Describes the item being added. One or more of the following values:

MF_CHECKED

MF_UNCHECKED

MF_STRING

MF_DISABLED

MF_GRAYED

MF_SEPARATOR

UINT id

The id of the selection. This is the id passed to the RightClickMenu::Selected() method when the user makes a selection from the menu.

LPCTSTR data

The string to display in the menu (or NULL if adding a separator).

Return Value:

Nonzero if the item was added; otherwise 0.

Prototype:

int BeginSubMenu(LPCTSTR name);

Remarks:

This method is available in release 3.0 and later only.

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

Parameters:

LPCTSTR name

The name to appear for the sub menu item.

Return Value:

Always returns TRUE.

Prototype:

int EndSubMenu();

Remarks:

This method is available in release 3.0 and later only.

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

Return Value:

Always returns TRUE.

Prototype:

void CleanUp();

Remarks:

This method is available in release 3.0 and later only.

This removes all sub menus from the right click menu.

Prototype:

void Init(HMENU menu, int startId, int limit, HWND hWnd, IPoint2 m);

Remarks:

This method is used internally.

Prototype:

void Process(UINT id);

Remarks:

This method is used internally.