function orca_gui_load(hval)
%
% Loads a saved ORCA box information file and restores values.
%
orca_global
%
% 'Check if _gui.mat file exists:'
gui_file=[ORC.gui_root,'_orca.mat'];
if exist(gui_file,'file')~=2, 
	disp(['Could not find file ',gui_file,' to load']); return;
end
% 'Load parameters from _gui.mat file:'
ORC_cur=ORC; gui_root=ORC.gui_root;
str=['load ',gui_file]; eval(str);
nn=length(ORC.cw_opts); nnok=20;
if length(ORC.cw_opts)<nnok, ORC.cw_opts=[ORC.cw_opts,zeros(1,nnok-nn)]; end
if ~iscell(ORC.rc_parms),
    rc_parms=ORC.rc_parms; ORC.rc_parms=cell(1,2);
    ORC.rc_parms{1}=rc_parms(1:3);
    if length(rc_parms)==7, ORC.rc_parms{2}=rc_parms(5:7); else, ORC.rc_parms{2}=rc_parms(4:6); end
end
%
% Transfer all loaded fields to ORC_cur:
loaded_fields=fieldnames(ORC);
for j=1:length(loaded_fields),
	expr=['ORC_cur.',loaded_fields{j},'=ORC.',loaded_fields{j},';'];
	eval(expr),
end
% Replace ORC by ORC_cur:
ORC=ORC_cur; ORC.gui_root=gui_root; clear ORC_cur;
%
% Reset directory symbol:
if isunix, ORC.dx='/'; elseif isppc, ORC.dx=':'; else, ORC.dx='\'; end
% Fill ORC boxes with new values:
Gtags=get(Obox.handle(1,1:Obox.nboxtot),'Tag');
% Skip box # 1 since that has programs listed, which may be added to:
for jbox_H=2:HBOX.nboxtot,
% Find HBOX tag that is same as Obox tag:
	ii=find(strcmp(HBOX.tag{jbox_H},Gtags));
	if ~isempty(ii),
		jbox_G=ii(1);
		if jbox_G<=HBOX.nboxtot,
			h1=Obox.handle(1,jbox_G);
			set(h1,'String',HBOX.string{jbox_H});
			set(h1,'Value',HBOX.value(jbox_H));
			set(h1,'Tag',HBOX.tag{jbox_H});
		end
	else
		'Did not find Tag'
	end
end
%
h1=findobj(Obox.figno,'Tag','Program');
val=find(Obox.prog_order==ORC.iiprog); if isempty(val), val=1; end
%%val,
set(h1,'Value',val);
orca_act('Program');
%
%
% COPYRIGHT (c) 2008
% 
% Applied Research Laboratories, The University of Texas at Austin
% (ARL:UT)
% All rights reserved.
% 
% This material may be reproduced by or for the U.S. Government
% only. This notice must appear in all copies of this file and its
% derivatives. Further distribution outside the U.S. Government is
% prohibited without the explicit written authorization from the
% Director of the Environmental Sciences Laboratory, ARL:UT.
% 
% THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
% EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE
% IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
% PURPOSE, OR NONINFRINGEMENT.
% 
% IN NO EVENT WILL ARL:UT BE LIABLE FOR ANY DAMAGES WHATSOEVER ARISING
% OUT OF THE USE OR INABILITY TO USE THIS SOFTWARE, EVEN IF ARL:UT HAS
% BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
