%% set_command_pos
%    sets the location of all the command buttons, labels and edit
%    boxes, places objects at the top of the figure which it
%    determines by looking at the height of the figure handle
% inputs:
%   obj:GUI - current GUI object
% outputs:
%   none
% Author: Colin Eles elesc@mcmaster.ca
% Organization: McMaster Centre for Software Certification
function [] = set_command_pos(object)
figpos = get(object.fig,'Position');
% figure out the height of the figure
l_fig_height = figpos(4);
set(object.edit_tog,'Position',[object.pb_offset l_fig_height-object.pb_offset-object.pb_height object.pb_width object.pb_height]);
set(object.save_pb,'Position',[object.pb_offset*2+object.pb_width,l_fig_height-object.pb_offset-object.pb_height,object.pb_width,object.pb_height]);
set(object.close_pb,'Position',[object.pb_offset*3+object.pb_width*2,l_fig_height-object.pb_offset-object.pb_height,object.pb_width,object.pb_height]);
set(object.save_ext_pb,'Position',[object.pb_offset*4+object.pb_width*3,l_fig_height-object.pb_offset-object.pb_height,object.pb_width,object.pb_height]);
set(object.check_pb,'Position',[object.pb_offset*5+object.pb_width*4,l_fig_height-object.pb_offset-object.pb_height,object.pb_width,object.pb_height]);
set(object.pvs_pb,'Position',[object.pb_offset*6+object.pb_width*5,l_fig_height-object.pb_offset-object.pb_height,object.pb_width,object.pb_height]);
set(object.input_pb,'Position',[object.pb_offset*7+object.pb_width*6,l_fig_height-object.pb_offset-object.pb_height,object.pb_width,object.pb_height]);
set(object.settings_pb,'Position',[object.pb_offset*8+object.pb_width*7,l_fig_height-object.pb_offset-object.pb_height,object.pb_width,object.pb_height]);

set(object.input_label,'Position',[object.pb_offset l_fig_height-object.pb_offset*3-object.pb_height-object.htx_height object.pb_width object.htx_height]);
set(object.function_inputs_control,'Position',[object.pb_offset*2+object.pb_width l_fig_height-object.pb_offset*3-object.htx_height-object.pb_height object.text_width object.htx_height]);
set(object.name_label,'Position',[object.pb_offset*2+object.pb_width+object.text_width l_fig_height-object.pb_offset*3-object.pb_height-object.htx_height object.pb_width object.htx_height]);
set(object.function_name_control,'Position',[object.pb_offset*3+object.pb_width*2+object.text_width l_fig_height-object.pb_offset*3-object.pb_height-object.htx_height object.text_width object.htx_height]);

[~, by] = object.vbox_layout.get_bounding_box;
setpixelposition(object.vbox_layout_panel, [object.pb_offset, l_fig_height-object.pb_offset*3-object.htx_height-object.pb_height-by-20, 1, 1]);

end

