%% set_widths
%    sets the widths for each of the cells and subcells in a grid.
%    the width of a cell is equal to the max width of the previous
%    level - 1 if the cell has no subgrids, or 1 if the cell has a
%    subgrid.
% inputs:
%   object:Grid - current Grid object
% outputs:
%   none
% Author: Colin Eles elesc@mcmaster.ca
% Organization: McMaster Centre for Software Certification
function [] = set_widths(object,max_width)
for i=1:size(object.cells,2)
    if (~isempty(object.cells(i).subgrid))
        object.cells(i).subgrid.set_widths(max_width-1);
        object.cells(i).width = 1;
    else
        object.cells(i).width = max_width;
    end
end
end

