www.gusucode.com > mbcexpr 工具箱 matlab 源码程序 > mbcexpr/@cgmodexpr/propPageInfo.m

    function hInfo = propPageInfo(obj, hPropGroup) %#ok<INUSL>
%PROPPAGEINFO Create the Information property tab
%
%  INFO = PROPPAGEINFO(OBJ, HPROPGROUP) creates the info object that
%  represents the model's Information tab in a property dialog.

%  Copyright 2000-2015 The MathWorks, Inc. and Ford Global Technologies, Inc.


hInfo = mbcgui.dialog.PageInfo( ...
    'PageGroup', hPropGroup, ...
    'Name', 'Information', ...
    'HelpHandler', 'cghelptool', ...
    'HelpCode', 'CGMODELPROPPAGEINFO', ...
    'CreateCallback', @i_createlyt);


function i_createlyt(hInfo, evt)

hParent = hInfo.Parent;
obj = hInfo.getObject;

mdl = get(obj, 'model');
INFO = getinfo(mdl);

if ~isempty(INFO)
    % Basic properties
    props = { ...
        'User', INFO.User; ...
        'Date', INFO.Date; ...
        'MBC Version', ''};   
    if isfield(INFO, 'mvver')
        props{3,2} = INFO.mvver;
    else
        props{3,2} = INFO.Version;
    end
    
    % User-added properties
    if isfield(INFO, 'new')
        % Skip the first cell that might contain engine data
        NumExtra = length(INFO.new) - 1;
        propidx = size(props, 1) + 1;
        props = [props; cell(NumExtra, 2)];
        for n = 2:(1+NumExtra)
            props{propidx, 1} = INFO.new{n}.Title;
            props{propidx, 2} = INFO.new{n}.Description;
            propidx = propidx + 1;
        end
    end
else
    props = cell(0,2);
end

hInfoPane = mbcgui.table.InfoPane('Parent' ,hParent, ...
    'TitleText', {'Field', 'Value'}, ...
    'BorderType', 'beveledin');
hInfoPane.ListText = props;

hInfo.setUI(hInfoPane);