Classes Involved in the Action System
 
 
 

The following are the primary classes involved in the ACtion System.

ActionTable - This class is a generalization of ShortcutTable. An ActionTable holds a set of ActionItems, which are operations that can be tied to various UI elements, such as keyboard shortcuts, custom user interface buttons, the 3ds Max main menu and the quad menu. 3ds Max's core code exports several action tables for built-in operations in 3ds Max. Plug-ins can also export their own action tables via methods available in ClassDesc.

ActionItem - The ActionItem class is used to represent a single operation that lives in an ActionTable. ActionItem is an abstract class with operations to support various UI operations. The system provides a default implementation of this class that works when the table is build with the ActionTable::BuildActionTable() method. However, developers may want to specialize this class for more specific-purpose applications. For example, MAXScript uses this mechanism to export macro scripts to an ActionTable.

ActionDescription - This structure is used when creating action tables. An array of these structures is created with one element for each action in the table to be built. This array is then passed as a parameter to the ActionTable constructor.

ActionCallback - This is the callback class that executes an action in response to a user request. The ActionCallback::ExecuteAction() method is overridden by the developer to perform the specific work associated with the action. This usually consists of a case statement which switches on the ID of the command being executed.

ActionContext - This class functions as an identifier for a group of actions. Several action tables can share a single ActionContext. The class maintains an ID, a name, and an active state for the context and has methods to retrieve these. When an action context is active all of the action tables that use that context are active as well.

IActionManager - This class provides methods to work with the available action tables. There are methods to get the number of and a pointer to specific action tables, activate and deactivate action tables, work with action contexts and determine if they are active. A pointer which may be used to call the methods of this class is returned from Interface::GetActionManager().

DynamicMenu - This is a helper class used in dynamically displaying additional quad or toolbar menus. This class has a few methods related to adding new menu items, beginning and ending sub-menus, checking menu flags, and getting a pointer to the menu after it has been created. The dynamic menu created by this class is provided to the method ActionItem::GetDynamicMenu().

DynamicMenuCallback - This is a callback used when creating dynamic menus. An instance of this class is passed to the constructor of the helper class DynamicMenu. This class has a single method called DynamicMenuCallback::MenuItemSelected() which is called when the user has chosen an item from the menu.

MAXIcon - This is an abstract class that represents an icon image for toolbar buttons, icons in list boxes, etc. The class is based on Win32 ImageLists. A MaxIcon must provide an image list and index into the list for both large (24x24) and small (16x15) icons

ClassDesc - When a plug-in wants to make its keyboard accelerators available it uses the methods ClassDesc::NumActionTables() and ClassDesc::GetActionTable().

Interface - The Interface class provides the method Interface::GetActionManager() to access the IActionManager interface.