%% redo_call
%   called when user selects redo, calls undomanager and performs action
% inputs:
%   object - GUI object
%   src - source object
%   event - event data
% outputs:
%   none
% Author: Colin Eles elesc@mcmaster.ca
% Organization: McMaster Centre for Software Certification
function [] = redo_call(object,src,event)

recalled_data = object.undo_man.redo;
if isempty(recalled_data);
    return;
else
    switch recalled_data.action
        case 1
            try
                set(recalled_data.cell,'String',recalled_data.text);
            catch exception
            end
        case 2
            recalled_data.grid.pb_new_call(recalled_data.grid.new_cell_pb,1);
        case 3
            recalled_data.grid.pb_delete_call(recalled_data.grid.delete_cell_pb,1);
        case 4
            % readd grid deleted with undo
            recalled_data.cell.subgrid = recalled_data.grid;
            recalled_data.cell.subgrid = recalled_data.grid;
            recalled_data.cell.pb_flag = 0;
            if(~isempty(recalled_data.cell.parent_grid.rGrid))
                recalled_data.cell.parent_grid.rGrid.delete_g2s(recalled_data.cell);
            end
            if(~isempty(recalled_data.grid.rGrid))
                recalled_data.grid.rGrid.refresh;
            end
            object.reset_wh();
            object.draw_allgrids(1);
            
            
        case 5
            recalled_data.grid.pb_delete_call(recalled_data.grid.delete_cell_pb,1);
    end
end
object.update_undoredo;

end