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

    function pSplitView(obj, hVC, Orient, hNewVC)
%PSPLITVIEW Split a view and attach a new one
%
%  PSPLITVIEW(OBJ, HVC, ORIENT, HNEWVC) splits the ViewContainer hVC in the
%  direction specified by Orient and places the ViewContainer HNEWVC in the
%  other half of the new splitlayout.

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


VCdata = get(hVC, 'UserData');
hParent = VCdata{1};
ElIndex = VCdata{2};

hLayout = xregsplitlayout(obj.Parent, ...
    'packstatus', 'off', ...
    'Visible', obj.visible, ...
    'Left', hVC, ...
    'Right', hNewVC, ...
    'Orientation', Orient, ...
    'DividerStyle', 'flat', ...
    'DividerWidth', 4, ...
    'Userdata', VCdata);
replace(hParent, hLayout, ElIndex);

set(hVC, 'UserData', {hLayout, 1});
set(hNewVC, 'UserData', {hLayout, 2});
set(hParent, 'packstatus', 'on');