tsc_MainMenu

This class is a collection of line items that form a menu.  It is used to define the Application's top level main menu, and is also used to create submenus. 

tsc_MainMenu is only used within the BuildMenu method of the tsc_AppMainMenu class. See tsc_AppMainMenu for code examples.

For a top-level 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 a tsc_MainMenu as a local variable and add it to a tsc_MainMenuItem using SetSubMenu(), or in the case of survey tasks, SetSurveySubMenu().

Public methods

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 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.