www.gusucode.com > mbclayouts 工具箱 matlab 源码程序 > mbclayouts/@xregborderlayout/xregborderlayout.m

    function obj  = xregborderlayout(varargin)
%  Synopsis
%     function obj = xregborderlayout(parameter,value,parameter,....)
%     function obj = xregborderlayout(fig,parameter,value,parameter,....)
%
%  Description
%     Creates a xregborderlayout container in the (optional) figure fig.data.
%
%  See also
%     xregborderlayout/set

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


fig = [];
if nargin
    if mbcgui.util.isComponentParent(varargin{1}) 
        fig = varargin{1};
        varargin(1) = [];
    end
end
if isempty(fig)
    fig = gcf;
end

c = xregcontainer(fig);
obj.hGrid = mbcfoundation.gridDefinition('Rows', 3, 'Columns', 3, ...
    'RowSizes', [0 -1 0], 'ColumnSizes', [0 -1 0]);
connectdata(c, obj.hGrid);

% Elements are held as {N, E, S, W, Centre}
set(c, 'elements', cell(1, 5));
obj = class(obj,'xregborderlayout', c);
set(obj,varargin{:});