This class is a collection of line items that comprise the TA main menu. It is used to define the Application's top level main menu, and is also used to create submenus.
Only the center part of the application menu is configurable. That is, those items with the slightly lighter background in the screen-snap.
tsc_MainMenu is only used within the BuildMenu method of the tsc_AppMainMenu class. See tsc_AppMainMenu for code examples.
For the topmost level of the main menu, a tsc_MainMenu must be created by calling new, populating the menu with tsc_MainMenuItems, and returning the result to the API in the tsc_AppMainMenu::BuildMenu() method.
For a submenu, create another tsc_MainMenu as a local variable and add it to a tsc_MainMenuItem using SetSubMenu(), or in the case of survey tasks, call SetSurveySubMenu() instead.
void AddMenuItem (tsc_MainMenuItem& menuItem);
Adds the supplied menu item to the menu. The items are displayed in the order they were added. Note that a tsc_MainMenuItem may be configured as a selectable line item or as a submenu.
Once an item is added to a menu the tsc_MainMenuItem is no longer required and may be destroyed. In most cases a temporary local variable is the simplest way to do this, as in the way the Map item is added to the menu in this example:
tsc_MainMenu* BuildMenu()
{
tsc_MainMenu* topMenu = new tsc_MainMenu;
topMenu->AddMenuItem (tsc_MainMenuItem(X_ComputeInverse));
return topMenu;
}
void AddSeparator ();
Adds a separator to this menu or submenu.
int Count() const;
Returns a count of the items and separators including submenu items in this menu, but excluding items in submenus.