Class IMenuManager
See Also: Class IMenu, Class IMenuBarContext, Class IQuadMenuContext, Class Interface.
class IMenuManager
Description:
This class is available in release 4.0 and later only.
To get an interface for calling the methods of this class use Interface::GetMenuManager().
Methods:
public:
Prototype:
virtual bool RegisterMenu(IMenu* pMenu, DWORD flags = 0) = 0;
Remarks:
This method allows you to add a menu to the manager.
Parameters:
IMenu* pMenu
Points to the menu to register.
DWORD flags = 0
Not used.
Return Value:
Returns false if the menu is already registered; true if not.
Prototype:
virtual bool UnRegisterMenu(IMenu* pMenu) = 0;
Remarks:
This method allows you to remove a menu form the mananger.
Parameters:
IMenu* pMenu
Points to the menu to unregister.
Return Value:
FALSE if the menu was not registered, TRUE if successfully unregistered.
Prototype:
virtual IMenu* FindMenu(TCHAR* pTitle) = 0;
Remarks:
This method will return a pointer to a menu based on its name.
Parameters:
TCHAR* pTitle
The name of the menu to return.
Return Value:
A pointer to the menu or NULL if the menu wasn’t found.
Prototype:
virtual IQuadMenu* FindQuadMenu(TCHAR* pTitle) = 0;
Remarks:
This method will return a pointer to a quad menu based on its name.
Parameters:
TCHAR* pTitle
The name of the menu to return.
Return Value:
A pointer to the quad menu or NULL if the menu wasn’t found.
Prototype:
virtual bool RegisterMenuBarContext(MenuContextId contextId, TCHAR* pName) = 0;
Remarks:
This method allows you to register a new menu bar context
Parameters:
MenuContextId contextId
The menu context ID.
TCHAR* pName
The name of the menu bar.
Return Value:
TRUE if the new menu is registered, FALSE if the menu was already registered.
Prototype:
virtual bool RegisterQuadMenuContext(MenuContextId contextId, TCHAR* pName) = 0;
Remarks:
This method allows you to register a new quad menu context.
Parameters:
MenuContextId contextId
The menu context ID.
TCHAR* pName
The name of the quad menu.
Return Value:
TRUE if the new quad menu is registered, FALSE if the quad menu was already registered.
Prototype:
virtual int NumContexts() = 0;
Remarks:
This method returns the number of contexts registered.
Prototype:
virtual IMenuContext* GetContextByIndex(int index) = 0;
Remarks:
This method returns a pointer to a menu context by the specified index.
Parameters:
int index
The index of the menu context to retrieve.
Prototype:
virtual IMenuContext* GetContext(MenuContextId contextId) = 0;
Remarks:
This method returns a pointer to a menu context by the specified menu context ID. This method returns NULL if the context does not exist.
Parameters:
MenuContextId contextId
The menu context ID.
Prototype:
virtual void UpdateMenuBar() = 0;
Remarks:
This method can be called to update 3ds max’ main menu bar after adding sub-menu’s or menu items.
Prototype:
virtual BOOL LoadMenuFile(TCHAR* pMenuFile) = 0;
Remarks:
This method allows you to load a menu file from disk and automatically update the UI accordingly.
Parameters:
TCHAR* pMenuFile
The path and filename of the menu file to load.
Return Value:
TRUE if the menu file was loaded, otherwise FALSE.
Prototype:
virtual BOOL SaveMenuFile(TCHAR* pMenuFile) = 0;
Remarks:
This method allows you to save a menu file to disk.
Parameters:
TCHAR* pMenuFile
The path and filename of the menu file to save.
Return Value:
TRUE if the menu file was saved, otherwise FALSE.
Prototype:
virtual TCHAR* GetMenuFile() = 0;
Remarks:
This method returns the file name of the currently loaded and active menu file.
Prototype:
virtual BOOL SetMainMenuBar(IMenu* pMenu) = 0;
Remarks:
This method allows you to set the main menu bar.
Parameters:
IMenu* pMenu
A pointer to the menu you wish to set as the main menu bar.
Return Value:
TRUE if it was set successfully.
Prototype:
virtual IMenu* GetMainMenuBar() = 0;
Remarks:
This method returns a pointer to the main menu bar.
Prototype:
virtual BOOL SetViewportRightClickMenu(IQuadMenuContext::RightClickContext context, IQuadMenu* pQuadMenu) = 0;
Remarks:
This method allows you to set the viewport right-click menu to the specified quad menu.
Parameters:
IQuadMenuContext::RightClickContext context
See the List of Right-Click Contexts.
IQuadMenu* pQuadMenu
A pointer to the quad menu you wish to set.
Return Value:
TRUE if it was set successfully.
Prototype:
virtual IQuadMenu* GetViewportRightClickMenu(IQuadMenuContext::RightClickContext context) = 0;
Remarks:
This method returns a pointer to the current viewport right-click quad menu.
Parameters:
IQuadMenuContext::RightClickContext context
See the List of Right-Click Contexts..
Prototype:
virtual bool GetShowAllQuads(IQuadMenu* pQuadMenu) = 0;
Remarks:
This method is available in release 4.0 and later only.
This method checks if the "Show All Quads" flag is set for a specific QuadMenu and will return TRUE if the flag is set or FALSE if the flag is not set.
Parameters:
IQuadMenu* pQuadMenu
A pointer to the QuadMenu you wish to check the flag for.
Prototype:
virtual void SetShowAllQuads(IQuadMenu* pQuadMenu, bool showAll) = 0;
Remarks:
This method is available in release 4.0 and later only.
This method sets the "Show All Quads" flag for a specific QuadMenu.
Parameters:
IQuadMenu* pQuadMenu
A pointer to the QuadMenu you wish to set the flag for.
bool showAll
TRUE to set the flag to on, FALSE to set the flag off.
Prototype:
virtual TCHAR* GetQuadMenuName(IQuadMenu* pQuadMenu) = 0;
Remarks:
This method is available in release 4.0 and later only.
This method returns the name given to a specific QuadMenu as a string.
Parameters:
IQuadMenu* pQuadMenu
A pointer to the QuadMenu for which you wish to retrieve the name.
Prototype:
virtual void SetQuadMenuName(IQuadMenu* pQuadMenu, TCHAR* pName) = 0;
Remarks:
This method is available in release 4.0 and later only.
This method allows you to set the name of a specific QuadMenu.
Parameters:
IQuadMenu* pQuadMenu
A pointer to the QuadMenu for which you wish to set the name.
TCHAR* pName
The string containing the name for the QuadMenu.