Cisco Packet Tracer Extensions API 8.1.0
API for communication between Cisco Packet Tracer application and its extension applications and modules.
Public Member Functions | List of all members
Menu Class Reference

Menu is the popup menu instantiated from the MenuBar object. More...

Public Member Functions

int count ()
 Returns the number of menu items in this menu. More...
 
MenuItem getMenuItemAt (int)
 Returns the menu item at the specified index. More...
 
MenuItem getMenuItemByUuid (uuid)
 Returns the menu item with the specified UUID. More...
 
MenuItem getMenuItemByName (QString)
 Returns the menu item with the specified name. More...
 
uuid getMenuItemUuid (QString)
 Returns the UUID of the menu item with the specified name. More...
 
void setItemVisibleUuid (uuid, bool)
 Changes the visibility of the item with the specified UUID. More...
 
void setItemEnabledUuid (uuid, bool)
 Enables or disables input events to the menu item with the specified UUID. More...
 
void removeItemUuid (uuid)
 Removes the menu item with the specified UUID. More...
 
uuid insertItem (QString, QString)
 Inserts an item before the specified item with the specified action. More...
 
uuid insertItemAfter (QString, QString)
 Inserts an item after the specified item with the specified action. More...
 
uuid insertSeparator (QString, QString)
 Inserts a separator before the specified item with the specified name. More...
 
uuid insertSeparatorAfter (QString, QString)
 Inserts a separator after the specified item with the specified name. More...
 
void removeItem (QString)
 Removes the specified menu item. More...
 
void setItemVisible (string, bool)
 Shows or hides the specified menu item. More...
 
void setItemEnabled (string, bool)
 Enables or disables the specified menu item. More...
 
void setItemObjectEnabled (string, bool)
 Enables or disables the specified menu item using object name. More...
 
void setItemObjectEnabledFuzzy (string, bool)
 Enables or disables the specified menu item using any text. More...
 
uuid insertItemWithName (QString, QString, QString)
 Inserts an item before the specified item with the specified action. More...
 
uuid insertItemWithNameAfter (QString, QString, QString)
 Inserts an item after the specified item with the specified action. More...
 

Detailed Description

Menu is the popup menu instantiated from the MenuBar object.

Remarks
The built-in menus Activity Wizard, Multiuser, IPC, and the seperator can only be manipulated by name. These menus will not provide a UUID or MenuItem class representation. Only items added via the IPC have a UUID and are a derivative of the MenuItem class.

Member Function Documentation

◆ count()

int Menu::count ( )

Returns the number of menu items in this menu.

Returns
int, the number of menu items in this menu.

◆ getMenuItemAt()

MenuItem Menu::getMenuItemAt ( int  )

Returns the menu item at the specified index.

Parameters
index,theindex of the menu item of interest.
Returns
MenuItem, the MenuItem object at the specified index.

◆ getMenuItemByName()

MenuItem Menu::getMenuItemByName ( QString  )

Returns the menu item with the specified name.

Parameters
name,thename of the menu item of interest.
Returns
MenuItem, the MenuItem object with the specified name.

◆ getMenuItemByUuid()

MenuItem Menu::getMenuItemByUuid ( uuid  )

Returns the menu item with the specified UUID.

Parameters
id,theUUID of the menu item of interest.
Returns
MenuItem, the MenuItem object with the specified UUID.

◆ getMenuItemUuid()

uuid Menu::getMenuItemUuid ( QString  )

Returns the UUID of the menu item with the specified name.

Parameters
name,thename of the menu item of interest.
Returns
uuid, the UUID of the menu item with the specified name.

◆ insertItem()

uuid Menu::insertItem ( QString  ,
QString   
)

Inserts an item before the specified item with the specified action.

Parameters
before,thename of the menu item to insert before.
action,theaction of the menu item.
Returns
uuid, the UUID of the menu item that was inserted.

◆ insertItemAfter()

uuid Menu::insertItemAfter ( QString  ,
QString   
)

Inserts an item after the specified item with the specified action.

Parameters
after,thename of the menu item to insert after.
action,theaction of the menu item.
Returns
uuid, the UUID of the menu item that was inserted.

◆ insertItemWithName()

uuid Menu::insertItemWithName ( QString  ,
QString  ,
QString   
)

Inserts an item before the specified item with the specified action.

Parameters
before,thename of the menu item to insert before.
action,theaction of the menu item.
name,objectname assigned to the action
Returns
uuid, the UUID of the menu item that was inserted.

◆ insertItemWithNameAfter()

uuid Menu::insertItemWithNameAfter ( QString  ,
QString  ,
QString   
)

Inserts an item after the specified item with the specified action.

Parameters
after,thename of the menu item to insert after.
action,theaction of the menu item.
name,objectname assigned to the action
Returns
uuid, the UUID of the menu item that was inserted.

◆ insertSeparator()

uuid Menu::insertSeparator ( QString  ,
QString   
)

Inserts a separator before the specified item with the specified name.

Parameters
before,thename of the menu item to insert before.
name,thename of the separator; not displayed but can be used to find it later.
Returns
uuid, the UUID of the menu item that was inserted.

◆ insertSeparatorAfter()

uuid Menu::insertSeparatorAfter ( QString  ,
QString   
)

Inserts a separator after the specified item with the specified name.

Parameters
after,thename of the menu item to insert after.
name,thename of the separator; not displayed but can be used to find it later.
Returns
uuid, the UUID of the menu item that was inserted.

◆ removeItem()

void Menu::removeItem ( QString  )

Removes the specified menu item.

Parameters
name,thename of the menu item.

◆ removeItemUuid()

void Menu::removeItemUuid ( uuid  )

Removes the menu item with the specified UUID.

Parameters
id,theUUID of the menu item of interest.

◆ setItemEnabled()

void Menu::setItemEnabled ( string  ,
bool   
)

Enables or disables the specified menu item.

Parameters
name,thename of the menu item.
bEnable,trueto enable the menu item, false to disable it.

◆ setItemEnabledUuid()

void Menu::setItemEnabledUuid ( uuid  ,
bool   
)

Enables or disables input events to the menu item with the specified UUID.

Parameters
id,theUUID of the menu item of interest.
bEnabled,trueto enable input events to the menu item, false to disable it.

◆ setItemObjectEnabled()

void Menu::setItemObjectEnabled ( string  ,
bool   
)

Enables or disables the specified menu item using object name.

Parameters
name,thename of the menu item.
bEnable,trueto enable the menu item, false to disable it.

◆ setItemObjectEnabledFuzzy()

void Menu::setItemObjectEnabledFuzzy ( string  ,
bool   
)

Enables or disables the specified menu item using any text.

Parameters
anyText,textthat is a portion of either object name or label.
bEnable,trueto enable the menu item, false to disable it.

◆ setItemVisible()

void Menu::setItemVisible ( string  ,
bool   
)

Shows or hides the specified menu item.

Parameters
name,thename of the menu item.
bVisible,trueto show the menu item, false to hide it.

◆ setItemVisibleUuid()

void Menu::setItemVisibleUuid ( uuid  ,
bool   
)

Changes the visibility of the item with the specified UUID.

Parameters
id,theUUID of the menu item of interest.
bVisibile,trueto show the menu item, false to hide it.

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