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

    function orient = defaultSplitDirection(obj)
%DEFAULTSPLITDIRECTION Return the preferred split direction for the view
%
%  ORIENT = DEFAULTSPLITDIRECTION(OBJ) returns either 'lr' or 'ud'
%  depending on whether the view would prefer to be split 'left-right' or
%  'up-down' from its current configuration.  The default implementation of
%  this returns 'lr' if the view is currently wider than it is tall and
%  'ud' otherwise.

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


p = obj.Position;
if p(3)>p(4)
    orient = 'lr';
else
    orient = 'ud';
end