NX Open C++ Reference Guide
Public Member Functions | List of all members
NXOpen::MenuBar::ContextMenu Class Reference

Represents a Context Menu
Created in NX8.5.0. More...

Inheritance diagram for NXOpen::MenuBar::ContextMenu:
NXOpen::TransientObject

Public Member Functions

NXOpen::MenuBar::ContextMenuEntryAddMenuButton (NXOpen::MenuBar::MenuButton *button, int index)
 Adds a menu bar button to the context menu. More...
 
NXOpen::MenuBar::ContextMenuEntryAddMenuLabel (const NXString &label, int index)
 Adds a label to the context menu. More...
 
NXOpen::MenuBar::ContextMenuEntryAddMenuLabel (const char *label, int index)
 Adds a label to the context menu. More...
 
void AddSeparator (int index)
 Adds a separator to the context menu. More...
 
NXOpen::MenuBar::ContextMenuAddSubmenu (const NXString &label, int index)
 Adds a submenu to the context menu. More...
 
NXOpen::MenuBar::ContextMenuAddSubmenu (const char *label, int index)
 Adds a submenu to the context menu. More...
 
NXOpen::MenuBar::ContextMenuEntryGetEntry (int index)
 Returns the MenuBar::ContextMenuEntry at the specified index in the menu. More...
 
NXOpen::MenuBar::ContextMenuEntryGetEntryWithName (const NXString &name)
 Given the name of a menu entry, returns the first MenuBar::ContextMenuEntry in this menu which matches. More...
 
NXOpen::MenuBar::ContextMenuEntryGetEntryWithName (const char *name)
 Given the name of a menu entry, returns the first MenuBar::ContextMenuEntry in this menu which matches. More...
 
int GetIndexOfEntry (NXOpen::MenuBar::ContextMenuEntry *entry)
 Returns the index of the MenuBar::ContextMenuEntry object within this menu. More...
 
NXOpen::MenuBar::ContextMenuGetSubmenu (int index)
 Returns the submenu for the entry at the specified index in the menu. More...
 
bool HasEntryWithName (const NXString &name)
 Indicates whether or not this menu contains a MenuBar::ContextMenuEntry which has the given name. More...
 
bool HasEntryWithName (const char *name)
 Indicates whether or not this menu contains a MenuBar::ContextMenuEntry which has the given name. More...
 
void HideEntry (NXOpen::MenuBar::ContextMenuEntry *entry)
 Prevents the indicated menu entry from being shown on the menu. More...
 
void MoveEntry (NXOpen::MenuBar::ContextMenuEntry *entry, int index)
 Reorders the menu to move a menu entry to a new position in the list. More...
 
int NumberOfEntries ()
 Returns the number of MenuBar::ContextMenuEntry objects in this menu. More...
 
void SetDefaultEntry (NXOpen::MenuBar::ContextMenuEntry *entry)
 Makes a specified menu entry the default for the menu. More...
 
virtual ~ContextMenu ()
 Frees the object from memory. More...
 
- Public Member Functions inherited from NXOpen::TransientObject
void * GetHandle ()
 Handle of the internal object represented by this object. More...
 

Detailed Description

Represents a Context Menu
Created in NX8.5.0.


Constructor & Destructor Documentation

virtual NXOpen::MenuBar::ContextMenu::~ContextMenu ( )
virtual

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.


Created in NX8.5.0.

License requirements : None

Member Function Documentation

NXOpen::MenuBar::ContextMenuEntry* NXOpen::MenuBar::ContextMenu::AddMenuButton ( NXOpen::MenuBar::MenuButton button,
int  index 
)

Adds a menu bar button to the context menu.

Use MenuBar::MenuBarManager::GetButtonFromName to find the button to add to the menu.

Returns
the new menu entry
Created in NX8.5.0.

License requirements : None
Parameters
buttonthe menu bar button to add to the menu
indexposition at which to create the new button. Use -1 to add the button to the end of the menu.
NXOpen::MenuBar::ContextMenuEntry* NXOpen::MenuBar::ContextMenu::AddMenuLabel ( const NXString label,
int  index 
)

Adds a label to the context menu.

Returns
the new menu entry
Created in NX10.0.0.

License requirements : None
Parameters
labellabel for the label entry
indexposition at which to create the label entry. Use -1 to add the label to the end of the menu.
NXOpen::MenuBar::ContextMenuEntry* NXOpen::MenuBar::ContextMenu::AddMenuLabel ( const char *  label,
int  index 
)

Adds a label to the context menu.

Returns
the new menu entry
Created in NX10.0.0.

License requirements : None
Parameters
labellabel for the label entry
indexposition at which to create the label entry. Use -1 to add the label to the end of the menu.
void NXOpen::MenuBar::ContextMenu::AddSeparator ( int  index)

Adds a separator to the context menu.


Created in NX8.5.0.

License requirements : None

Parameters
indexposition at which to create the separator. Use -1 to add the separator to the end of the menu.
NXOpen::MenuBar::ContextMenu* NXOpen::MenuBar::ContextMenu::AddSubmenu ( const NXString label,
int  index 
)

Adds a submenu to the context menu.

Returns
the new submenu
Created in NX8.5.0.

License requirements : None
Parameters
labellabel for the cascade menu
indexposition at which to create the sub-menu. Use -1 to add the sub-menu to the end of the menu.
NXOpen::MenuBar::ContextMenu* NXOpen::MenuBar::ContextMenu::AddSubmenu ( const char *  label,
int  index 
)

Adds a submenu to the context menu.

Returns
the new submenu
Created in NX8.5.0.

License requirements : None
Parameters
labellabel for the cascade menu
indexposition at which to create the sub-menu. Use -1 to add the sub-menu to the end of the menu.
NXOpen::MenuBar::ContextMenuEntry* NXOpen::MenuBar::ContextMenu::GetEntry ( int  index)

Returns the MenuBar::ContextMenuEntry at the specified index in the menu.

Returns
the menu entry at this position
Created in NX8.5.0.

License requirements : None
Parameters
indexindex of menu entry to return
NXOpen::MenuBar::ContextMenuEntry* NXOpen::MenuBar::ContextMenu::GetEntryWithName ( const NXString name)

Given the name of a menu entry, returns the first MenuBar::ContextMenuEntry in this menu which matches.

Returns
the menu entry with this name
Created in NX8.5.0.

License requirements : None
Parameters
namename of menu entry to search for
NXOpen::MenuBar::ContextMenuEntry* NXOpen::MenuBar::ContextMenu::GetEntryWithName ( const char *  name)

Given the name of a menu entry, returns the first MenuBar::ContextMenuEntry in this menu which matches.

Returns
the menu entry with this name
Created in NX8.5.0.

License requirements : None
Parameters
namename of menu entry to search for
int NXOpen::MenuBar::ContextMenu::GetIndexOfEntry ( NXOpen::MenuBar::ContextMenuEntry entry)

Returns the index of the MenuBar::ContextMenuEntry object within this menu.

Returns
the index for that menu entry
Created in NX8.5.0.

License requirements : None
Parameters
entryan entry in the menu
NXOpen::MenuBar::ContextMenu* NXOpen::MenuBar::ContextMenu::GetSubmenu ( int  index)

Returns the submenu for the entry at the specified index in the menu.

The menu entry at this index must be of type MenuBar::ContextMenuEntry::TypeSubmenu .

Returns
the submenu at this position
Created in NX8.5.0.

License requirements : None
Parameters
indexindex of submenu to return
bool NXOpen::MenuBar::ContextMenu::HasEntryWithName ( const NXString name)

Indicates whether or not this menu contains a MenuBar::ContextMenuEntry which has the given name.

Returns
the menu entry with this name
Created in NX8.5.0.

License requirements : None
Parameters
namename of menu entry to search for
bool NXOpen::MenuBar::ContextMenu::HasEntryWithName ( const char *  name)

Indicates whether or not this menu contains a MenuBar::ContextMenuEntry which has the given name.

Returns
the menu entry with this name
Created in NX8.5.0.

License requirements : None
Parameters
namename of menu entry to search for
void NXOpen::MenuBar::ContextMenu::HideEntry ( NXOpen::MenuBar::ContextMenuEntry entry)

Prevents the indicated menu entry from being shown on the menu.


Created in NX8.5.0.

License requirements : None

Parameters
entrythe menu entry to hide
void NXOpen::MenuBar::ContextMenu::MoveEntry ( NXOpen::MenuBar::ContextMenuEntry entry,
int  index 
)

Reorders the menu to move a menu entry to a new position in the list.


Created in NX8.5.0.

License requirements : None

Parameters
entrythe menu entry to be moved
indexthe new position
int NXOpen::MenuBar::ContextMenu::NumberOfEntries ( )

Returns the number of MenuBar::ContextMenuEntry objects in this menu.


Created in NX8.5.0.

License requirements : None

void NXOpen::MenuBar::ContextMenu::SetDefaultEntry ( NXOpen::MenuBar::ContextMenuEntry entry)

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::ContextMenuEntry::TypePushButton or MenuBar::ContextMenuEntry::TypeToggleButton .


Created in NX8.5.0.

License requirements : None

Parameters
entrythe menu entry to become the default for the menu

The documentation for this class was generated from the following file:
Copyright 2017 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.