www.gusucode.com > mbcguitools 工具箱 matlab 源码程序 > mbcguitools/@mbcmultiview/@MultiViewPanel/updateAvailableViews.m

    function updateAvailableViews(obj)
%UPDATEAVAILABLEVIEWS Re-check which views can be created
%
%   UPDATEAVAILABLEVIEWS(OBJ) checks whether each view type can be created
%   and updates the state of the creation actions accordingly.
%
%   This method is called automatically before showing the menu that allows
%   view creation.  If you create toolbar buttons for creating views then
%   you should manually call this method to update the toolbar button
%   states whenever they may have changed.

%   Copyright 2005 The MathWorks, Inc.


AG = obj.Actions.ChangeView;
avail = obj.ViewList.isViewAvailable(obj.MessageService);
if length(avail)==length(AG.Actions)
    set(AG.Actions, {'Enabled'}, num2cell(avail(:)));
end