www.gusucode.com > mbcguitools 工具箱 matlab 源码程序 > mbcguitools/+mbcgui/+widget/@ScrollTable/updateToLiveState.m

    function updateToLiveState(obj)
%UPDATETOLIVESTATE  Redraw object as live, assuming it is initially dead
%
%  UPDATETOLIVESTATE(OBJ)

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


% Row objects
if obj.ShowRowHeaders
    obj.RowHeaderObjects = obj.createObjects(obj.RowConstructor, obj.numRows, 'row');
end

% Column objects
if obj.ShowColumnHeaders
    obj.ColumnHeaderObjects = obj.createObjects(obj.ColumnConstructor, obj.numCols, 'col')';  
end

% Main scroll area objects
numReqObj = obj.numCols*obj.numRows; 
obj.MainObjects = reshape(obj.createObjects(obj.MainConstructor, numReqObj, 'main'), obj.numRows, obj.numCols);

obj.notify('DisplayObjectsChanged', event.EventData);

obj.disableScrolling;
obj.CurrentRow = 1;
obj.CurrentColumn = 1;
obj.CurrentRow = 0;
obj.CurrentColumn = 0;
obj.enableScrolling;

obj.paintMain;
obj.paintRowHeader;
obj.paintColumnHeader;

set([obj.RowHeaderObjects(:); obj.ColumnHeaderObjects(:); obj.MainObjects(:)], 'Visible',obj.Visible);

obj.inLiveState = true;