How to Add a Menu Bar in CAA
How to Add a Menu Bar in CAA
In CAA development, the operation of adding a menu bar usually involves creating a toolbar first, then creating a menu, and associating the menu with the toolbar commands. The following code shows the specific implementation steps. The part of creating the toolbar is omitted. Assume that the created toolbar is pPartBenchTlb.
- Add a Menu
cpp
// Create the user menu
NewAccess(CATCmdContainer, pUserMenu, UserMenu);
// Add the menu window
NewAccess(CATCmdContainer,pUserMenuWindows, lianxi Menu);
SetAccessChild(pUserMenu, pUserMenuWindows);
- Add Menu Items
cpp
// Add menu item 01
NewAccess(CATCmdStarter, pMenuoption01, Menuoption01);
SetAccessCommand(pMenuoption01,"lianxi01");
SetAccessChild(pUserMenuWindows, pMenuoption01);
// Add menu item 02
NewAccess(CATCmdStarter, pMenuoption02, Menuoption02);
SetAccessCommand(pMenuoption02,"lianxi02");
// Add menu item 03
NewAccess(CATCmdStarter, pMenuoption03, Menuoption03);
SetAccessCommand(pMenuoption03,"lianxi03");
SetAccessNext(pMenuoption01, pMenuoption02);
SetAccessNext(pMenuoption02, pMenuoption03);
- Associate the Menu with the Toolbar
cpp
// Associate the menu with the toolbar
SetAddinMenu(pPartBenchTlb, pUserMenu);

浙公网安备 33010602011771号