Class ActionContext

3DS Max Plug-In SDK

Class ActionContext

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

class ActionContext

Description:

This class is available in release 4.0 and later only.

Every ActionTable also has an ActionContextId associated with it. This ActionContextId can be shared with other tables.

When assigning keyboard shortcuts to items in an ActionTable, tables that share a unique context id are forced to have unique shortcuts. Tables with different context ids can have overlapping keyboard shortcut assignments.

An ActionContext is an identifer of a group of keyboard shortcuts. Examples are the Main 3ds max UI, Track View, and the Editable Mesh. They are registered using IActionManager::RegisterActionContext().

Note: typedef DWORD ActionContextId;

Methods:

public:

Prototype:

ActionContext(ActionContextId contextId, TCHAR *pName);

Remarks:

Constructor. The context ID and the name are initialized from the data passed.

Parameters:

ActionContextId contextId

The ID for the ActionContext.

TCHAR *pName

The name for the ActionContext.

Prototype:

TCHAR* GetName();

Remarks:

Returns the name of this ActionContext.

Prototype:

ActionContextId GetContextId();

Remarks:

Returns the ID of this ActionContext.

Prototype:

bool IsActive();

Remarks:

Returns true if this ActionContext is active; otherwise false. An active ActionContext means that it uses its keyboard accelerators. This corresponds to the "Active" checkbox in the keyboard customization UI.

Prototype:

void SetActive(bool active);

Remarks:

Sets the active state of this ActionContext.

Parameters:

bool active

Pass true for active; false for inactive.