Public Member Functions

FBMenuManager Class Reference

This reference page is linked to from the following overview topics: MotionBuilder 2013.


Search for all occurrences

Detailed Description

The menu manager allows access to MotionBuilder menu bar.

It can be used to retrieve the item corresponding to a menu path in the menu bar. A menu path is similar to a file path but it specifies the location of menu item in a hierarchy of menu. ex: to retrieve the item corresponding to MoBu Save item: item = menuMgr.GetMenu("File/Save")

Other menu items in MoBu menu bar include the following: "File", "Edit","Animation","Window","Settings", "Layout","Help"

The menu manager can be used to insert new menu item in the menubar. You have to specify the menu path at which to insert the menu (to insert a new root menu, use NULL or None as the menu path)

    #Insert a new Root Menu before the Help menu
    menuMgr.InsertBefore(None, "Help", "before menu")

    #Insert a new Root Menu after the Help menu
    menuMgr.InsertAfter(None, "Help", "After menu")

As a convenience operation, you can from the menu manager enable and disable menu item (instead of retrieving their corresponding item).

Definition at line 248 of file fbgenericmenu.h.

#include <fbgenericmenu.h>

Inheritance diagram for FBMenuManager:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 FBMenuManager ()
 Constructor.
FBGenericMenuGetMenu (const char *pPath)
 Get the Menu (NOT menu item) corresponding to a menu path.
FBGenericMenuItemInsertFirst (const char *pMenuPath, const char *pMenuName)
 Insert a new menu at the first position of a specific path.
FBGenericMenuItemInsertLast (const char *pMenuPath, const char *pMenuName)
 Insert a new menu at the last position of a specific path.
FBGenericMenuItemInsertBefore (const char *pMenuPath, const char *pAfterMenuName, const char *pMenuName)
 Insert a new menu at a specific path BEFORE another item.
FBGenericMenuItemInsertAfter (const char *pMenuPath, const char *pBeforeMenuName, const char *pMenuName)
 Insert a new menu at a specific path AFTER another item.
void SetItemEnable (const char *pMenuPath, int pItemId, bool pEnable)
 Enable or disable a specific menu item.
bool IsItemEnable (const char *pMenuPath, int pItemId)
 Check if a particular item is enabled or disabled.

Constructor & Destructor Documentation

Constructor.

There is only one MenuManager in MotionBuilder, creating multiple FBMenuManager always return the same handle to the same global menu manager.


Member Function Documentation

FBGenericMenu* GetMenu ( const char *  pPath)

Get the Menu (NOT menu item) corresponding to a menu path.

Don't forget that most menu path already in MotionBuilder have a "&"as the first letter of their name. You have to use / as a separator in the specified menu path (ex: "Settings/&Preferences...").

Parameters:
pPathPath of the menu to retrieve
Returns:
the FBGenericMenu at this path./
FBGenericMenuItem* InsertFirst ( const char *  pMenuPath,
const char *  pMenuName 
)

Insert a new menu at the first position of a specific path.

Parameters:
pMenuPathPath where to insert the menu. If this is NULL (None) it will insert a new root menu.
pMenuNameName (Caption) of the newly inserted menu.
Returns:
Returns the menu item corresponding to the newly inserted menu.
FBGenericMenuItem* InsertLast ( const char *  pMenuPath,
const char *  pMenuName 
)

Insert a new menu at the last position of a specific path.

Parameters:
pMenuPathPath where to insert the menu. If this is NULL (None) it will insert a new root menu.
pMenuNameName (Caption) of the newly inserted menu.
Returns:
Returns the menu item corresponding to the newly inserted menu.
FBGenericMenuItem* InsertBefore ( const char *  pMenuPath,
const char *  pAfterMenuName,
const char *  pMenuName 
)

Insert a new menu at a specific path BEFORE another item.

Parameters:
pMenuPathPath where to insert the menu. If this is NULL (None) it will insert a new root menu.
pAfterMenuNameName of the menu item BEFORE which we will insert the new item.
Returns:
Returns the menu item corresponding to the newly inserted menu.
FBGenericMenuItem* InsertAfter ( const char *  pMenuPath,
const char *  pBeforeMenuName,
const char *  pMenuName 
)

Insert a new menu at a specific path AFTER another item.

Parameters:
pMenuPathPath where to insert the menu. If this is NULL (None) it will insert a new root menu.
pBeforeMenuNameName of the menu item AFTER which we will insert the new item.
Returns:
Returns the menu item corresponding to the newly inserted menu.
void SetItemEnable ( const char *  pMenuPath,
int  pItemId,
bool  pEnable 
)

Enable or disable a specific menu item.

The menu path specifies the menu where we find the item to be enabled/disabled. The Id specifies which item in the menu.

Parameters:
pMenuPathPath where to find the menu to enable/disable
pItemIdId of the item in the menu to disable.
pEnableEnable (true) or disable (false) a menu item.
bool IsItemEnable ( const char *  pMenuPath,
int  pItemId 
)

Check if a particular item is enabled or disabled.

The menu path specifies the menu where we find the item to be enabled/disabled. The Id specifies which item in the menu.

Parameters:
pMenuPathPath where to find the menu to check
pItemIdId of the item to check.
Returns:
Is the item enable or not.

The documentation for this class was generated from the following file:

FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager
FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager