%% pb_new_call
%    call back function for the new cell push button. When button
%    is pressed a new cell object is created in the current grid
%    and the table is redrawn
% inputs:
%   object:Grid - current Grid object
%   src:double - source of the callback calling
%   event:eventdata - event that triggered the callback
% outputs:
%   none
% Author: Colin Eles elesc@mcmaster.ca
% Organization: McMaster Centre for Software Certification
function [] = pb_new_call(object,src,event)
gui = get(src,'userdata');
object.new_Cell;
gui.reset_wh();
gui.draw_allgrids(0);
if size(object.cells,2) > 1
    set(object.delete_cell_pb,'Enable','on');
else
    set(object.delete_cell_pb,'Enable','off');
end

if isempty(event) || event ~= 1
    undo_data.action = 2;
    undo_data.grid = object;
    undo_data.cell = [];
    undo_data.text = [];
    undo_data.subgrid = [];
    
    
    gui.undo_man.new_state(undo_data);
end
gui.update_undoredo;


end

