%% save_conditions
% this function is used to save the strings that are in each of the
% condition edit boxes string field. We do this because when we
% want to reopen the gui we want to repopulate these fields but the
% handles to the edit boxes will disappear when we close the gui,
% so we need to save the strings into variables in each of the Cell
% objects. function is recursive.
% inputs:
%   obj:GUI - current GUI object
%   grid:Grid - grid to be saved.
% outputs:
%   none
% Author: Colin Eles elesc@mcmaster.ca
% Organization: McMaster Centre for Software Certification
function [] = save_conditions(object,grid)
for i=1:size(grid.cells,2)
    if ~isempty(grid.cells(i).subgrid)
        object.save_conditions(grid.cells(i).subgrid);
    end
    grid.cells(i).cond_text = get(grid.cells(i).cond,'String');
end
end

