function dummy = checkmenu(Editor,MenuMode,hMenu)
%CHECKMENU  Updates menu state based on Editor mode.

%   Author(s): P. Gahinet
%   Copyright 1986-2000 The MathWorks, Inc. 
%   $Revision: 1.2 $ $Date: 2000/06/14 20:21:08 $

% REVISIT
dummy = [];

% RE: MENUMODE is the mode controlled by this menu (add/delete/zoom)

% Set menu checks
switch MenuMode
case 'add'
    % Manages state of Add menu and submenus
    SubMenus = get(hMenu,'Children');
    set(SubMenus,'Checked','off')  % reset
    if strcmp(Editor.EditMode,'add')
        % Check appropriate Add submenu
        Labels = strrep(get(SubMenus,'Label'),' ','');
        set(SubMenus(strcmp([Editor.ModeData{:}],Labels)),'Checked','on')
    end
    
case 'delete'
    % Delete menu
    if strcmp(Editor.EditMode,'delete')
        set(hMenu,'Checked','on')
    else
        set(hMenu,'Checked','off')
    end
    
case 'zoom'
    % Manages state of Zoom submenus
    SubMenus = get(hMenu,'Children');
    set(SubMenus,'Checked','off')  % reset
    if strcmp(Editor.EditMode,'zoom')
        % Check appropriate Zoom submenu
        Selection = find(strcmpi(Editor.ModeData,get(SubMenus,'Label')));
        set(SubMenus(Selection),'Checked','on')
    end
    
end

