www.gusucode.com > mbcguitools 工具箱 matlab 源码程序 > mbcguitools/@mbcwidgets/@Table1D/selectRegion.m

    function selectRegion(obj, R, C, W, H)
%SELECTREGION Select a region of cells in the table
%
%  SELECTREGION(OBJ, R, C, W, H) selects a rectangle of cells with its
%  top-left corner at (R, C) and with a width of W cells and a height of H
%  cells.  The selection indices are taken as being in the view coordinate
%  system.

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


% W is the numCols to select, H is the numRows to select
if isempty(R) || isempty(C) || isequal(H,0) || isequal(W,0)
    obj.clearSelection;
else
    obj.Peer.selectRegion(R-1, C-1, H, W);
end