FBMenuManager Class Reference

#include <fbgenericmenu.h>
FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager FBMenuManager
Inheritance diagram for FBMenuManager:
Inheritance graph
[legend]

List of all members.


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")

It is to be noted that menu item already inserted in MoBu menu bar and that have a shortcut assign to them have a "&" in their name (which make their retrieval not trivial). For reference here is the real name of each of the root menus: "&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")

    # Insert a new keyboard:
    menuMgr.InsertLast("&Settings/&Keyboard Configuration", "New keyboard")

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

Definition at line 252 of file fbgenericmenu.h.


Public Member Functions

  FBMenuManager ()
  Constructor.
FBGenericMenu GetMenu (char *pPath)
  Get the Menu (NOT menu item) corresponding to a menu path.
FBGenericMenuItem InsertFirst (char *pMenuPath, char *pMenuName)
  Insert a new menu at the first position of a specific path.
FBGenericMenuItem InsertLast (char *pMenuPath, char *pMenuName)
  Insert a new menu at the last position of a specific path.
FBGenericMenuItem InsertBefore (char *pMenuPath, char *pAfterMenuName, char *pMenuName)
  Insert a new menu at a specific path BEFORE another item.
FBGenericMenuItem InsertAfter (char *pMenuPath, char *pBeforeMenuName, char *pMenuName)
  Insert a new menu at a specific path AFTER another item.
void  SetItemEnable (char *pMenuPath, int pItemId, bool pEnable)
  Enable or disable a specific menu item.
bool  IsItemEnable (char *pMenuPath, int pItemId)
  Check if a particular item is enabled or disabled.

Constructor & Destructor Documentation

FBMenuManager (  ) 

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 ( 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 (&Help, &Settings). You have to use / as a separator in the specified men u path (ex: "&Settings/&Keyboard Configuration").

Parameters:
pPath  Path of the menu to retrieve
Returns:
the FBGenericMenu at this path./

FBGenericMenuItem* InsertFirst ( char *  pMenuPath,
char *  pMenuName  
)

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

Parameters:
pMenuPath  Path where to insert the menu. If this is NULL (None) it will insert a new root menu.
pMenuName  Name (Caption) of the newly inserted menu.
Returns:
Returns the menu item corresponding to the newly inserted menu.

FBGenericMenuItem* InsertLast ( char *  pMenuPath,
char *  pMenuName  
)

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

Parameters:
pMenuPath  Path where to insert the menu. If this is NULL (None) it will insert a new root menu.
pMenuName  Name (Caption) of the newly inserted menu.
Returns:
Returns the menu item corresponding to the newly inserted menu.

FBGenericMenuItem* InsertBefore ( char *  pMenuPath,
char *  pAfterMenuName,
char *  pMenuName  
)

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

Parameters:
pMenuPath  Path where to insert the menu. If this is NULL (None) it will insert a new root menu.
pAfterMenuName  Name 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 ( char *  pMenuPath,
char *  pBeforeMenuName,
char *  pMenuName  
)

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

Parameters:
pMenuPath  Path where to insert the menu. If this is NULL (None) it will insert a new root menu.
pBeforeMenuName  Name 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 ( 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:
pMenuPath  Path where to find the menu to enable/disable
pItemId  Id of the item in the menu to disable.
pEnable  Enable (true) or disable (false) a menu item.

bool IsItemEnable ( 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:
pMenuPath  Path where to find the menu to check
pItemId  Id of the item to check.
Returns:
Is the item enable or not.

Please send us your comments about this page.