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

    function fireSelectionChanged(obj, varargin)
%FIRESELECTIONCHANGED Sends the SelectionChanged event of the Table1D.
%
%   FIRESELECTIONCHANGED(OBJ, SELECTEDROWS, SELECTEDCOLUMNS, SELECTEDDATAROWS, SELECTEDDATACOLUMNS, FOCUSINDEX, FOCUSDATAINDEX, EVENTTYPE)
%
%   FIRESELECTIONCHANGED(OBJ, SELECTEDROWS, SELECTEDCOLUMNS, FOCUSINDEX, EVENTTYPE) 
%   assumes that the data is the same as the selection (not sorted).

%   Copyright 2006-2011 The MathWorks, Inc.

% This is for the 'simpler' signature - when we assume the table is not
% sorted differently from the model.
if nargin==5
    [selectedRows, selectedColumns, focusIndex, eventType] = deal( varargin{:} );
    selectedDataRows = selectedRows;
    selectedDataColumns = selectedColumns;
    focusDataIndex = focusIndex;
elseif nargin==8
    [selectedRows, selectedColumns, selectedDataRows, selectedDataColumns, focusIndex, focusDataIndex, eventType] = deal( varargin{:} );
else
    narginchk(5,8)
end

data = struct('SelectedRows', selectedRows, ...
    'SelectedColumns', selectedColumns, ...
    'SelectedDataRows', selectedDataRows, ...
    'SelectedDataColumns', selectedDataColumns, ...
    'FocusIndex', focusIndex, ...
    'FocusDataIndex', focusDataIndex, ...
    'EventType', eventType);

e = xregGui.xregEventData(obj, 'SelectionChanged', data);
xregcallback(obj.SelectionChangedCallback, obj, e);
obj.send('SelectionChanged', e);