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

    function ret = pHasSavedLayout(obj)
%PHASSAVEDLAYOUT Check whether a layout exists for the current layout name
%
%  RET = PHASSAVEDLAYOUT(OBJ) returns true if a saved layout exists with
%  the name specified in the ViewLayoutName property.

%  Copyright 2005 The MathWorks, Inc. and Ford Global Technologies, Inc.


ret = false;
P = mbcprefs('mbc');
if ispref(P, 'MultiViewPanel')
    s = getpref(P, 'MultiViewPanel');
    if isfield(s, 'Layouts')
        s_L = s.Layouts;
        if isfield(s_L, obj.ViewLayoutName) && isstruct(s_L.(obj.ViewLayoutName))
            ret = true;
        end
    end
end