www.gusucode.com > mbcguitools 工具箱 matlab 源码程序 > mbcguitools/@mbcmultiview/@ActionGroup/numRequiredMenus.m
function N = numRequiredMenus(obj) %NUMREQUIREDMENUS Get the number of menus that this action requires % % N = NUMREQUIREDMENUS(OBJ) returns an integer that is the number of menus % that an action will make when createMenuItem is called. % Copyright 2005 The MathWorks, Inc. and Ford Global Technologies, Inc. % Iterate over all contained actions and count the menus required for each N = 0; A = obj.Actions; for n = 1:length(A) N = N + A(n).numRequiredMenus; end % Add one if a menu is needed for self if obj.pShouldMakeSubMenus N = N+1; end