www.gusucode.com > mbcguitools 工具箱 matlab 源码程序 > mbcguitools/+mbcgui/+widget/@ClassicTable/doTLComp.m

    function doTLComp(obj)
%DOTLCOMP Place component in top-left corner
%
%  DOTLCOMP(OBJ)

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

els = get(obj.gridObject, 'elements');
VIS = false;

if ~isempty(els) && ...
        obj.ShowRowHeaders && ...
        obj.ShowColumnHeaders && ...
        obj.isAlive
    if strcmp(obj.ColumnHeaderPosition, 'top')
        els{1, 1} = obj.TopLeftCorner;
    else
        rs = get(obj.gridObject, 'rowsizes');
        if rs(end-1)>0
            els{end-1, 1} = obj.TopLeftCorner;
        else
            els{end, 1} = obj.TopLeftCorner;
        end
    end
    VIS = true;
end

if VIS
    set(obj.gridObject, 'elements', els);
    set(obj.TopLeftCorner, 'Visible', obj.Visible);
else
    set(obj.TopLeftCorner, 'Visible', 'off');
end

end