www.gusucode.com > mbcdesign 工具箱 matlab 源码程序 > mbcdesign/+xregdesgui/InfoPane.m

    classdef InfoPane < mbcgui.widget.BasicContainer
    %InfoPane Design Editor info pane 
    %   The design editor information pane shows information about the
    %   currently selected design
    
    %  Copyright 2015 The MathWorks, Inc. and Ford Global Technologies, Inc.
    
    properties
        %DesignTree mbctreeadapter.DesignEditorTree
        DesignTree
    end
    
    properties (SetAccess=private)
        %DesInfo infoPane table
        DesInfo
    end    
    
    methods
        function obj = InfoPane(varargin)
        %InfoPane constructor
        obj@mbcgui.widget.BasicContainer(varargin{:});
        
        pnl = mbcgui.container.titlebarpanel(...
            'Parent', obj.Parent, ...
            'BarTitle', 'Properties');
        obj.DesInfo = mbcgui.table.InfoPane('Parent', pnl, 'SplitPosition', .6);
        set(pnl,'ContentHandle',obj.DesInfo );
        obj.ContentHandle = pnl;

        dp=obj.DesignTree.Package;
        addListeners(obj,dp.addlistener('any',@obj.onUpdated));
        end
        
    end
    
    methods (Access=private)
        function onUpdated(obj,~,~)
        des=obj.DesignTree.CurrentDesign;
        if ~isempty(des)
            obj.DesInfo.ListText = info(des);
            set(obj.ContentHandle,'BarTitle',['Properties - ' name(des)]);
        else
            obj.DesInfo.ListText = {};
            set(obj.ContentHandle,'BarTitle','Properties');
        end
        end 
    end
    
end