Interface: CuiMenuMgr
The CuiMenuMgr
interface exposes properties and methods for creating and customizing menus for plug-ins.
Menus can only be created in response to the #cuiRegisterMenus
callback notification, which is sent at startup and whenever a menu definition file (.mnx
) is loaded. Menus can be queried at any time.
Properties:
.topLevelMenus : Interface array : Read
An array of CuiMenu objects representing the system menus currently registered with 3ds Max.
.mainMenuBar : Interface : Read
Holds the CuiMenu object representing the main menu bar.
Methods:
<Interface>CreateTopLevelMenu <guid>id <string>title
CreateTopLevelMenu - no automatic redraw after invoked
Creates a new new top-level menu with the specified title
text and id
, and returns it as a CuiMenu
object.
<Interface>GetMenuById <guid>id
GetMenuById - no automatic redraw after invoked
Returns the CuiMenu
or CuiDynamicMenu
with the specified id
.
<Interface>GetMenuItemById <guid>id
GetMenuItemById - no automatic redraw after invoked
Returns the CuiMenuItem
or CuiActionMenuItem
specified by id
.
<boolean>LoadConfiguration <filename>menuFile logMsgsToLogFile:<boolean>
LoadConfiguration - no automatic redraw after invoked
logMsgsToLogFile default value: true
Loads the menu configuration file specified by menuFile
, optionally logging information and error messages to a log file. See GetMessageLogFile()
below. This file must be a properly formed .mnx file.
<string>GetDefaultConfiguration()
GetDefaultConfiguration - no automatic redraw after invoked
Returns the path to the default menu configuration file (.mnx) used by 3ds Max.
<boolean>SetCurrentConfiguration <filename>menuFile logMsgsToLogFile:<boolean>
SetCurrentConfiguration - no automatic redraw after invoked
logMsgsToLogFile default value: true
Sets the current menu configuration to the specified menuFile
, optionally logging information and error messages to a log file. See GetMessageLogFile()
below.
<string>GetCurrentConfiguration()
GetCurrentConfiguration - no automatic redraw after invoked
Returns the path to the currently used menu configuration file (.mnx) used by 3ds Max.
<string>GetMessageLogFile()
GetMessageLogFile - no automatic redraw after invoked
Returns the path to the menu configuration log file.
<boolean>CreateLocalizationFile <filename>menuFileName <&string>outputFileName pathOrEmpty:<filename>
CreateLocalizationFile - no automatic redraw after invoked
outputFileName is Out parameter
pathOrEmpty default value: undefined
Generates a localization file for the specified menu configuration menuFileName
and saves it to the specified filename
(appending the .res
suffix), returning the saved file name in the by reference parameter outputFileName
. The optional pathOrEmpty
parameter can specify a path to save the localization file to.
A localization resource file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<Resources>
<Resource Id="b4779ebb-a6f0-4815-9777-57c01c0b584c" Text="Main Menu Bar"/>
<Resource Id="eed3eaef-ea24-4342-aacc-9dfd87f9a4f4" Text="&File" LocHint="Menu in: MainMenuBar"/>
...
</Resources>
The ID is the identifier for the menu, menu item, or action, and Text is the title or text to show. This resource file can be translated into multiple languages and the corresponding language version can be loaded automatically according to the 3ds Max language settings.
Actions: