Properties¶
Property | Description |
---|---|
NumberOfEntries | Returns the number of MenuBar.ContextMenuEntry objects in this menu. |
Methods¶
Method | Description |
---|---|
AddMenuButton | Adds a menu bar button to the context menu. |
AddMenuLabel | Adds a label to the context menu. |
AddSeparator | Adds a separator to the context menu. |
AddSubmenu | Adds a submenu to the context menu. |
Dispose | Frees the object from memory. |
GetEntry | Returns the MenuBar.ContextMenuEntry at the specified index in the menu. |
GetEntryWithName | Given the name of a menu entry, returns the first MenuBar.ContextMenuEntry in this menu which matches. |
GetIndexOfEntry | Returns the index of the MenuBar.ContextMenuEntry object within this menu. |
GetSubmenu | Returns the submenu for the entry at the specified index in the menu. |
HasEntryWithName | Indicates whether or not this menu contains a MenuBar.ContextMenuEntry which has the given name. |
HideEntry | Prevents the indicated menu entry from being shown on the menu. |
MoveEntry | Reorders the menu to move a menu entry to a new position in the list. |
SetDefaultEntry | Makes a specified menu entry the default for the menu. |
Property Detail¶
Method Detail¶
AddSeparator¶
-
ContextMenu.
AddSeparator
¶ Adds a separator to the context menu.
Signature
AddSeparator(index)
Parameters: index (int) – position at which to create the separator. Use -1 to add the separator to the end of the menu. New in version NX8.5.0.
License requirements: None.
Dispose¶
-
ContextMenu.
Dispose
¶ Frees the object from memory.
After this method is called, it is illegal to use the object. In .NET, this method is automatically called when the object is deleted by the garbage collector.
Signature
Dispose()
New in version NX8.5.0.
License requirements: None.
GetEntry¶
-
ContextMenu.
GetEntry
¶ Returns the
MenuBar.ContextMenuEntry
at the specified index in the menu.Signature
GetEntry(index)
Parameters: index (int) – index of menu entry to return Returns: the menu entry at this position Return type: NXOpen.MenuBar.ContextMenuEntry
New in version NX8.5.0.
License requirements: None.
GetEntryWithName¶
-
ContextMenu.
GetEntryWithName
¶ Given the name of a menu entry, returns the first
MenuBar.ContextMenuEntry
in this menu which matches.Signature
GetEntryWithName(name)
Parameters: name (str) – name of menu entry to search for Returns: the menu entry with this name Return type: NXOpen.MenuBar.ContextMenuEntry
New in version NX8.5.0.
License requirements: None.
GetIndexOfEntry¶
-
ContextMenu.
GetIndexOfEntry
¶ Returns the index of the
MenuBar.ContextMenuEntry
object within this menu.Signature
GetIndexOfEntry(entry)
Parameters: entry ( NXOpen.MenuBar.ContextMenuEntry
) – an entry in the menuReturns: the index for that menu entry Return type: int New in version NX8.5.0.
License requirements: None.
HasEntryWithName¶
-
ContextMenu.
HasEntryWithName
¶ Indicates whether or not this menu contains a
MenuBar.ContextMenuEntry
which has the given name.Signature
HasEntryWithName(name)
Parameters: name (str) – name of menu entry to search for Returns: the menu entry with this name Return type: bool New in version NX8.5.0.
License requirements: None.
HideEntry¶
-
ContextMenu.
HideEntry
¶ Prevents the indicated menu entry from being shown on the menu.
Signature
HideEntry(entry)
Parameters: entry ( NXOpen.MenuBar.ContextMenuEntry
) – the menu entry to hideNew in version NX8.5.0.
License requirements: None.
MoveEntry¶
-
ContextMenu.
MoveEntry
¶ Reorders the menu to move a menu entry to a new position in the list.
Signature
MoveEntry(entry, index)
Parameters: - entry (
NXOpen.MenuBar.ContextMenuEntry
) – the menu entry to be moved - index (int) – the new position
New in version NX8.5.0.
License requirements: None.
- entry (
SetDefaultEntry¶
-
ContextMenu.
SetDefaultEntry
¶ Makes a specified menu entry the default for the menu.
This entry will be displayed in bold text on the menu. It will be the action that is performed in response to a double-click event in the UI.
The menu entry must have a type of
MenuBar.ContextMenuEntryType.PushButton
orMenuBar.ContextMenuEntryType.ToggleButton
.Signature
SetDefaultEntry(entry)
Parameters: entry ( NXOpen.MenuBar.ContextMenuEntry
) – the menu entry to become the default for the menuNew in version NX8.5.0.
License requirements: None.