Using XMetaL 4.6. With the following in a test macro, when I run the macro it adds the cvs menu and two menu items to the file menu in the appropriate location. However, the menu items "cvs commit" and "open in wincvs" are disabled even though the macros exist. Note that if I add an entirely new top level menu and some menu items on it, everything is fine. I only have this problem when I add items to a builtin menu:
// Get the CommandBars object
var cmdBars = Application.CommandBars;
// Get a single command bar (the main menu bar)
var menuBar = cmdBars.item("Menu bar");
// Get all of the menu bar's controls (all of the menus)
var menuBarCtrls = menuBar.Controls;
var currentTopMenu;
var currentTopMenuCtrls;
currentTopMenu = menuBarCtrls.item(1);
currentTopMenuCtrls = currentTopMenu.Controls;
newSubItem = currentTopMenuCtrls.Add(5,1,8);
newSubItem.Caption = 'c&vs';
newSubItem.BeginGroup = false;
newSubItem.OnAction = "";
newSubItemMenuCtrls = newSubItem.Controls;
newSubItem = newSubItemMenuCtrls.Add(5,1,1);
newSubItem.Caption = "c&vs commit";
newSubItem.BeginGroup = true;
newSubItem.OnAction = "cvs commit";
newSubItem.Enabled = true;
newSubItem = newSubItemMenuCtrls.Add(5,1,2);
newSubItem.Caption = "Open file in &Wincvs";
newSubItem.BeginGroup = false;
newSubItem.OnAction = "open_document_wincvs";
newSubItem.Enabled = true;
What am I doing wrong?
Thanks,
David