Insert() inserts an item into the menu's tree.
- Parameters:
-
| displayText | - text to display for item in menu |
| parent | - ptr to parent menu item |
| newItemRef | - ref to ptr to receive created menu item on success |
| dataPtr | - void* to store caller's data for menu item |
| subMenu | - if true, item has no dataPtr and extends to a sub menu |
| index | - index to insert at. -1 is at end of current menu |
| altCommand | - if true, then instead of sending the scripted menu's command and using dataPtr for information, the item will send the altCommand to the window. |
- Returns:
- CATResult - CAT_SUCCESS on success
Definition at line 238 of file CATMenu.cpp.
References CATMENUITEM::AltCommand, CATMENUITEM::BaseMenu, CAT_ERR_OUT_OF_MEMORY, CAT_SUCCESS, CATRESULT, CATMENUITEM::Children, CATMENUITEM::DataPtr, CATMENUITEM::DisplayText, fMenuDirty, fRootList, CATMENUITEM::IsSubMenu, CATMENUITEM::ItemHandle, and CATMENUITEM::Parent.
Referenced by InsertSeperator(), CATComboBox::RebuildCombo(), GASPilot::UpdateControllerMenu(), and GASPilot::UpdateMappingMenu().