FBGenericMenu Class Reference

FBGenericMenu Class Reference

#include <mobu-python-api.h>

Class Description

A GenericMenu class.

You can use this class either to create a new menu in the menu bar (or in a menuitem in the menu bar) or you can use this class to create a pop-up menu.

#to start a pop up menu use the Execute method
def mouseClick(x, y):
item = menu.Execute(x, y)
if item.Id == 10:
[do this]
else if item.Id == 100:
[do that...]

There are 4 ways to insert new item in a menu. Each method needs the name of the menuitem as well as it's unique id. You can also optionally sets a new menu for a specific item.

embeededMenu = FBGenericMenu()
menu.InsertLast("new new item", 67, embeddedMenu)
#A genericMenu contains a GenericMenuItem for each entry. You can iterate on the different menuitem
#using GetFirstITem/GetNextItem or if you already know the id of the item you can get it with GetItem.
item = menu.GetFirstItem()
while item:
print item.Name
item = menu.GetNextItem(item)
# This example shows how to list the Caption/Id of all the menu items of the Edit menu
menuManager = FBMenuManager()
editMenu = menuManager.GetMenu( "Edit" )
item = editMenu.GetFirstItem()
while item:
print "'" + item.Caption + "' (id: " + str( item.Id ) + ")"
item = editMenu.GetNextItem( item )

You can also delete a Menu item: this will remove the item from the menu as well as freeing its memory. To be notified when a menuitem is clicked, you can register using OnMenuActivate. This will send a FBEventMenu containing the name and the Id of the menu item that was clicked.

+ Inheritance diagram for FBGenericMenu:

Public Member Functions

 __reduce__ ()
 
 FBDelete (FBGenericMenu arg1)
 Virtual FBDelete function. More...
 
 __init__ (object arg1)
 Default constructor. More...
 
object GetFirstItem (FBGenericMenu arg1)
 Returns the first menu item (if existing) in this menu. More...
 
object GetLastItem (FBGenericMenu arg1)
 Returns the last menu item (if existing) in this menu. More...
 
object GetNextItem (FBGenericMenu arg1, FBGenericMenuItem arg2)
 Returns the menu item following an other item. More...
 
object GetPrevItem (FBGenericMenu arg1, FBGenericMenuItem arg2)
 Returns the menu item preceding an other item. More...
 
object InsertFirst (FBGenericMenu arg1, str arg2, object arg3, FBGenericMenu arg4)
 Inserts a new menu Item at the first position in the menu list. More...
 
object InsertLast (FBGenericMenu arg1, str arg2, object arg3, FBGenericMenu arg4)
 Inserts a new menu Item at the last position in the menu list. More...
 
object InsertAfter (FBGenericMenu arg1, FBGenericMenuItem arg2, str arg3, object arg4, FBGenericMenu arg5)
 Inserts a new menu Item AFTER another item. More...
 
object InsertBefore (FBGenericMenu arg1, FBGenericMenuItem arg2, str arg3, object arg4, FBGenericMenu arg5)
 Inserts a new menu Item BEFORE another item. More...
 
object Execute (FBGenericMenu arg1, object arg2, object arg3, object arg4)
 Starts the menu as a pop-up menu at a specific location on screen. More...
 
object GetItem (FBGenericMenu arg1, object arg2)
 Returns the menu item corresponding to an id. More...
 
 DeleteItem (FBGenericMenu arg1, FBGenericMenuItem arg2)
 Remove a menu item from the menu and delete it. More...
 
- Public Member Functions inherited from FBComponent
 __reduce__ ()
 
FBPropertyList PropertyGetModifiedList (FBComponent arg1, FBPlugModificationFlag arg2)
 Get list of properties which have been modified since last loading. More...
 
str ClassName (FBComponent arg1)
 Get the class name. More...
 
 DisableObjectFlags (FBComponent arg1, FBObjectFlag arg2)
 Disable a specific Object Flags. More...
 
 EnableObjectFlags (FBComponent arg1, FBObjectFlag arg2)
 Enable a specific Object Flags. More...
 
bool FBCreate (FBComponent arg1)
 Open Reality Creation function. More...
 
 FBDelete (FBComponent arg1)
 Open Reality deletion function. More...
 
 FBDestroy (FBComponent arg1)
 Open Reality destruction function. More...
 
FBObjectFlag GetObjectFlags (FBComponent arg1)
 Get all Object Flags (concatenated). More...
 
bool GetObjectStatus (FBComponent arg1, FBObjectStatus arg2)
 Check to see if an object status is enabled. More...
 
bool HasObjectFlags (FBComponent arg1, FBObjectFlag arg2)
 Check whether a specific object flag is enabled. More...
 
bool Is (FBComponent arg1, object arg2)
 Returns true if object is of type TypeId. More...
 
bool ProcessNamespaceHierarchy (FBComponent arg1, FBNamespaceAction arg2, str arg3, str arg4, object arg5)
 ProcessNamespaceHierarchy. More...
 
bool ProcessObjectNamespace (FBComponent arg1, FBNamespaceAction arg2, str arg3, str arg4, object arg5)
 ProcessObjectNamespace. More...
 
int PropertyAdd (FBComponent arg1, FBProperty arg2)
 Add a property to the component's property manager. More...
 
bool PropertyAddReferenceProperty (FBComponent arg1, FBProperty arg2)
 Add a reference property to the component's property manager. More...
 
object PropertyCreate (FBComponent arg1, str arg2, FBPropertyType arg3, str arg4, object arg5, object arg6, FBProperty arg7)
 Create user or dynamic property. More...
 
 PropertyRemove (FBComponent arg1, FBProperty arg2)
 Remove a Property from the component's Property manager. More...
 
 SetObjectFlags (FBComponent arg1, FBObjectFlag arg2)
 SetObjectFlags. More...
 
 SetObjectStatus (FBComponent arg1, FBObjectStatus arg2, object arg3)
 Enable/Disable a specific Object Status. More...
 
 HardSelect (FBComponent arg1)
 HardSelect. More...
 
object GetOwnerFileReference (FBComponent arg1)
 Get the owner FileReference object. More...
 
 __init__ (...)
 Constructor. More...
 
- Public Member Functions inherited from FBPlug
 __reduce__ ()
 
bool BeginChange (FBPlug arg1)
 Begins a change on multiple plugs. More...
 
str ClassName (FBPlug arg1)
 internal System vars. More...
 
bool ConnectDst (FBPlug arg1, FBPlug arg2, FBConnectionType arg3)
 Add a destination connection. More...
 
bool ConnectDstAt (FBPlug arg1, object arg2, FBPlug arg3, FBConnectionType arg4)
 Add a destination connection. More...
 
bool ConnectSrc (FBPlug arg1, FBPlug arg2, FBConnectionType arg3)
 Add a source connection. More...
 
bool ConnectSrcAt (FBPlug arg1, object arg2, FBPlug arg3, FBConnectionType arg4)
 Add a source connection. More...
 
 DisconnectAllDst (FBPlug arg1)
 Remove all destination connections. More...
 
 DisconnectAllSrc (FBPlug arg1)
 Remove all source connections. More...
 
bool DisconnectDst (FBPlug arg1, FBPlug arg2)
 Remove a destination connection. More...
 
bool DisconnectDstAt (FBPlug arg1, object arg2)
 Remove a destination connection at a specified index. More...
 
bool DisconnectSrc (FBPlug arg1, FBPlug arg2)
 Remove a source connection. More...
 
bool DisconnectSrcAt (FBPlug arg1, object arg2)
 Remove a source connection at a specified index. More...
 
 EndChange (FBPlug arg1)
 Ends a change on multiple plugs. More...
 
object GetDst (FBPlug arg1, object arg2)
 Get a destination connection's plug at specified index. More...
 
int GetDstCount (FBPlug arg1)
 Get destination connection count. More...
 
FBConnectionType GetDstType (FBPlug arg1, object arg2)
 Get a destination connection's type at specified index. More...
 
object GetOwned (FBPlug arg1, object arg2)
 Get the owned plug at specified index. More...
 
int GetOwnedCount (FBPlug arg1)
 Get the owned plug count. More...
 
object GetOwner (FBPlug arg1)
 Get the owner of this plug. More...
 
object GetSrc (FBPlug arg1, object arg2)
 Get a source connection's plug at specified index. More...
 
int GetSrcCount (FBPlug arg1)
 Get source connection count. More...
 
FBConnectionType GetSrcType (FBPlug arg1, object arg2)
 Get a source connection's type at specified index. More...
 
bool Is (FBPlug arg1, object arg2)
 Is( int pTypeId ) More...
 
bool IsSDKComponent (FBPlug arg1)
 Return whether or not item is an SDK component. More...
 
 MoveSrcAt (...)
 
bool ReplaceDstAt (FBPlug arg1, object arg2, FBPlug arg3)
 Replace a destination connection at a specified index. More...
 
bool ReplaceSrcAt (FBPlug arg1, object arg2, FBPlug arg3)
 Replace a source connection at a specified index. More...
 
bool SwapSrc (FBPlug arg1, object arg2, object arg3)
 Swap source connection at index A with source connection at index B. More...
 
 SetSelfModified (FBPlug arg1, FBPlugModificationFlag arg2, object arg3)
 Set the plug's self modification flag. More...
 
bool GetSelfModified (FBPlug arg1, FBPlugModificationFlag arg2)
 Tell if the plug's self has changed. More...
 
 SetContentModified (FBPlug arg1, FBPlugModificationFlag arg2, object arg3)
 Set the plug's owned property/object's modification flag. More...
 
bool GetContentModified (FBPlug arg1, FBPlugModificationFlag arg2)
 Tell if the plug's content has changed. More...
 
int GetPlugConnectionModifiedList (FBPlug arg1, FBPlugList arg2, FBPlugModificationFlag arg3, object arg4)
 Get plug's modified src/dst property/object connection added/removed List. More...
 
bool RevertModification (FBPlug arg1, FBPlugModificationFlag arg2)
 Revert the plug's modification to original status. More...
 
 __init__ (...)
 
method staticmethod (function)
 
- Public Member Functions inherited from FBPythonWrapper
 __reduce__ ()
 
 __init__ (...)
 

Public Attributes

ORSDK2018::FBPropertyEvent OnMenuActivate
 Event Property: Register on this property to be notified when a menu item is clicked by the user. More...
 
- Public Attributes inherited from FBComponent
object OwnerNamespace
 
ORSDK2018::FBPropertyListComponent Components
 List: List of components. More...
 
ORSDK2018::FBPropertyString Name
 Read Write Property: Unique name of object. More...
 
ORSDK2018::FBPropertyString LongName
 Read Write Property: Name and namespace for object. More...
 
object FullName
 
ORSDK2018::FBPropertyListComponent Parents
 List: Parents. More...
 
ORSDK2018::FBPropertyManager PropertyList
 Read Only Property: Manages all of the properties for the component. More...
 
FBPropertyBool Selected
 Read Write Property: Selected property. More...
 
- Public Attributes inherited from FBPythonWrapper
object OnUnbind
 

Member Function Documentation

__init__ ( object  arg1)

Default constructor.

Python Docstring:

__init__( (object)arg1) -> None 

C++ Signature:

 FBGenericMenu(HIObject pObject = ((void *) 0)) 

Used to create embedded menu (inside another menu item) or pop-up menu.

__reduce__ ( )
DeleteItem ( FBGenericMenu  arg1,
FBGenericMenuItem  arg2 
)

Remove a menu item from the menu and delete it.

Python Docstring:

DeleteItem( (FBGenericMenu)arg1, (FBGenericMenuItem)arg2) -> None 

C++ Signature:

void DeleteItem(ORSDK2018::FBGenericMenuItem * pToDelete) 
Parameters
pToDeleteThe item to remove.
object Execute ( FBGenericMenu  arg1,
object  arg2,
object  arg3,
object  arg4 
)

Starts the menu as a pop-up menu at a specific location on screen.

Python Docstring:

Execute( (FBGenericMenu)arg1, (object)arg2, (object)arg3 [, (object)arg4]) -> object 

C++ Signature:

ORSDK2018::FBGenericMenuItem * Execute(int pX, int pY, bool pRightAlign = true) 

It returns the item that was clicked by the user.

Parameters
pXX location in pixel on screen where the menu is to be popped.
pYY location in pixel on screen where the menu is to be popped.
pRightAlignAll menu item will be align to the right justified (if true) or left justified (if false)
Returns
The selected item by the user. Null if the user clicks outside the menu.
FBDelete ( FBGenericMenu  arg1)

Virtual FBDelete function.

Python Docstring:

FBDelete( (FBGenericMenu)arg1) -> None 

C++ Signature:

void FBDelete() 
object GetFirstItem ( FBGenericMenu  arg1)

Returns the first menu item (if existing) in this menu.

Python Docstring:

GetFirstItem( (FBGenericMenu)arg1) -> object 

C++ Signature:

ORSDK2018::FBGenericMenuItem * GetFirstItem() 

You can then use GetNextItem to iterate on other menu items.

Returns
The first menu item in this Menu.
object GetItem ( FBGenericMenu  arg1,
object  arg2 
)

Returns the menu item corresponding to an id.

Python Docstring:

GetItem( (FBGenericMenu)arg1, (object)arg2) -> object 

C++ Signature:

ORSDK2018::FBGenericMenuItem * GetItem(int pItemId) 
Parameters
pItemIdId of the item we are looking for.
Returns
Will return the Item corresponding to an id (null if not found).
object GetLastItem ( FBGenericMenu  arg1)

Returns the last menu item (if existing) in this menu.

Python Docstring:

GetLastItem( (FBGenericMenu)arg1) -> object 

C++ Signature:

ORSDK2018::FBGenericMenuItem * GetLastItem() 

You can then use GetPrevItem to reverse iterate on other menu items.

Returns
The last menu item in this Menu.
object GetNextItem ( FBGenericMenu  arg1,
FBGenericMenuItem  arg2 
)

Returns the menu item following an other item.

Python Docstring:

GetNextItem( (FBGenericMenu)arg1, (FBGenericMenuItem)arg2) -> object 

C++ Signature:

ORSDK2018::FBGenericMenuItem * GetNextItem(ORSDK2018::FBGenericMenuItem * pItem) 

Returns null if this is the last item in menu.

Parameters
pItemWill return the item after pItem
Returns
Will return the item after pItem. Null if pItem is the last item.
object GetPrevItem ( FBGenericMenu  arg1,
FBGenericMenuItem  arg2 
)

Returns the menu item preceding an other item.

Python Docstring:

GetPrevItem( (FBGenericMenu)arg1, (FBGenericMenuItem)arg2) -> object 

C++ Signature:

ORSDK2018::FBGenericMenuItem * GetPrevItem(ORSDK2018::FBGenericMenuItem * pItem) 

Returns null if this is the first item in menu.

Parameters
pItemWill return the item BEFORE pItem
Returns
Will return the item BEFORE pItem. Null if pItem is the first item.
object InsertAfter ( FBGenericMenu  arg1,
FBGenericMenuItem  arg2,
str  arg3,
object  arg4,
FBGenericMenu  arg5 
)

Inserts a new menu Item AFTER another item.

Python Docstring:

InsertAfter( (FBGenericMenu)arg1, (FBGenericMenuItem)arg2, (str)arg3, (object)arg4 [, (FBGenericMenu)arg5]) -> object 

C++ Signature:

ORSDK2018::FBGenericMenuItem * InsertAfter(ORSDK2018::FBGenericMenuItem * pBeforeItem, const char * pItemName, int pItemId, ORSDK2018::FBGenericMenu * pMenu = ((void *) 0)) 
Parameters
pBeforeItemThe reference item. We will create a new item AFTER this one.
pItemNameCaption of the newly added item.
pItemIdUnique id of this menu item.
pMenuOptional. If this Item leads to another menu (embedded) it can be specified here.
Returns
Will return the menu item created from this insertion.
object InsertBefore ( FBGenericMenu  arg1,
FBGenericMenuItem  arg2,
str  arg3,
object  arg4,
FBGenericMenu  arg5 
)

Inserts a new menu Item BEFORE another item.

Python Docstring:

InsertBefore( (FBGenericMenu)arg1, (FBGenericMenuItem)arg2, (str)arg3, (object)arg4 [, (FBGenericMenu)arg5]) -> object 

C++ Signature:

ORSDK2018::FBGenericMenuItem * InsertBefore(ORSDK2018::FBGenericMenuItem * pAfterItem, const char * pItemName, int pItemId, ORSDK2018::FBGenericMenu * pMenu = ((void *) 0)) 
Parameters
pAfterItemThe reference item. We will create a new item BEFORE this one.
pItemNameCaption of the newly added item.
pItemIdUnique id of this menu item.
pMenuOptional. If this Item leads to another menu (embedded) it can be specified here.
Returns
Will return the menu item created from this insertion.
object InsertFirst ( FBGenericMenu  arg1,
str  arg2,
object  arg3,
FBGenericMenu  arg4 
)

Inserts a new menu Item at the first position in the menu list.

Python Docstring:

InsertFirst( (FBGenericMenu)arg1, (str)arg2, (object)arg3 [, (FBGenericMenu)arg4]) -> object 

C++ Signature:

ORSDK2018::FBGenericMenuItem * InsertFirst(const char * pItemName, int pItemId, ORSDK2018::FBGenericMenu * pMenu = ((void *) 0)) 
Parameters
pItemNameCaption of the newly added item.
pItemIdUnique id of this menu item.
pMenuOptional. If this Item leads to another menu (embedded) it can be specified here.
Returns
Will return the menu item created from this insertion.
object InsertLast ( FBGenericMenu  arg1,
str  arg2,
object  arg3,
FBGenericMenu  arg4 
)

Inserts a new menu Item at the last position in the menu list.

Python Docstring:

InsertLast( (FBGenericMenu)arg1, (str)arg2, (object)arg3 [, (FBGenericMenu)arg4]) -> object 

C++ Signature:

ORSDK2018::FBGenericMenuItem * InsertLast(const char * pItemName, int pItemId, ORSDK2018::FBGenericMenu * pMenu = ((void *) 0)) 
Parameters
pItemNameCaption of the newly added item.
pItemIdUnique id of this menu item.
pMenuOptional. If this Item leads to another menu (embedded) it can be specified here.
Returns
Will return the menu item created from this insertion.

Member Data Documentation

ORSDK2018::FBPropertyEvent OnMenuActivate

Event Property: Register on this property to be notified when a menu item is clicked by the user.