function setpaths
%
% the function setpaths is used by the ARPRO
% software as an interface used to input the desired paths
% where ARPRO will find the float, coastline and bathymetry
% data to be used.
%  
% -------------------------------------------------------------
%  Written by Vassilis Zervakis, in March 1996,
%             for AINCO - Interocean, Madrid, Spain
%--------------------------------------------------------------
%
global DATAPATH COASTPATH BATHYPATH SOFTPATH
global fid1 hpaths
%
hpaths = figure('Name','Set the paths',...
            'NumberTitle','off',...
            'Menubar','none',...
            'Units','cent',...
            'Position',[6 4 10 5],...
            'Color',[0.45 0.45 0.45]);
fid1 = fopen([ SOFTPATH 'datapath.dat']);
line1 = fgetl(fid1);
line2 = fgetl(fid1);
line3 = fgetl(fid1);
if line1 ~= -1,
  DATAPATH = deblank(line1);
else
  DATAPATH = ' ';
end
if line2 ~= -1,
  COASTPATH = deblank(line2);
else
  COASTPATH = ' ';
end
if line3 ~= -1,
  BATHYPATH = deblank(line3);
else
  BATHYPATH = ' ';
end
fclose(fid1);
pos = [ .1, .7, .35, .1 ];
uimm(1) = uicontrol('style','text',...
                    'string','Path for float data : ',...
                    'enable','off',...
                    'horizontalalignment','left',...
                    'backgroundcolor',[1 1 1],...
                    'Units','normalized',...
                    'Position',pos);
pos(1) = pos(1) + pos(3);
pos(3) = 0.4;
uimm(2) = uicontrol('style','edit',...
                    'enable','on',...
                    'string',DATAPATH,...
                    'BackgroundColor',[.75 .75 .75],...
                    'Callback',['global DATAPATH,',...
                    'DATAPATH = deblank(get(gco,''string''));'],...
                    'Units','normalized',...
                    'Position',pos);
global COASTPATH;
pos = [ .1, .5, .35, .1 ];
uimm(3) = uicontrol('style','text',...
                    'string','Path for coastline data : ',...
                    'enable','off',...
                    'horizontalalignment','left',...
                    'backgroundcolor',[1 1 1],...
                    'Units','normalized',...
                    'Position',pos);
pos(1) = pos(1) + pos(3);
pos(3) = 0.4;
uimm(4) = uicontrol('style','edit',...
                    'enable','on',...
                    'string',COASTPATH,...
                    'BackgroundColor',[.75 .75 .75],...
                    'Callback',['global COASTPATH,',...
                    'COASTPATH = deblank(get(gco,''string''));'],...
                    'Units','normalized',...
                    'Position',pos);
global BATHYPATH;
pos = [ .1, .3, .35, .1 ];
uimm(5) = uicontrol('style','text',...
                    'string','Path for isobath data : ',...
                    'enable','off',...
                    'horizontalalignment','left',...
                    'backgroundcolor',[1 1 1],...
                    'Units','normalized',...
                    'Position',pos);
pos(1) = pos(1) + pos(3);
pos(3) = 0.4;
uimm(6) = uicontrol('style','edit',...
                    'enable','on',...
                    'string',BATHYPATH,...
                    'BackgroundColor',[.75 .75 .75],...
                    'Callback',['global BATHYPATH,',...
                    'BATHYPATH = deblank(get(gco,''string''));'],...
                    'Units','normalized',...
                    'Position',pos);
uimm(7) = uicontrol('style','pushbutton',...
                    'enable','on',...
                    'string','Exit',...
                    'BackgroundColor',[.75 .75 .75],...
                    'Callback',['global DATAPATH COASTPATH BATHYPATH,',...
                                'global hpaths cdpath,',...
                                'fopen([ SOFTPATH ''datapath.dat''],''wt'');,',...
                                'fprintf(fid1,''%s \n'',DATAPATH);,',...
                                'fprintf(fid1,''%s \n'',COASTPATH);,',...
                                'fprintf(fid1,''%s \n'',BATHYPATH);,',...
                                'fclose(fid1);,',...
                                'cdpath = DATAPATH(1:length(DATAPATH) - 1),',...
                                'eval([''cd '', cdpath]),',...
                                'close(hpaths);'],...
                    'Units','normalized',...
                    'Position',[0.1 0.1 0.2 0.1]);
