function fig = picksections
% gui interface to select web sections to manipulate

global ALLFIG
if ALLFIG.type == 1, inputstr = 'Check Sections to Delete'; end
if ALLFIG.type == 2, inputstr = 'Check Sections to Edit'; end

load sectinfo
len = length(sect_info);
fh = 30*len + 80;  % figure height

h0 = figure('Units','points', ...
	'Color',[0.92 0.92 0.97], ...
	'FileName','/home/snowboard/calthen/guiplots/picksections.m', ...
	'MenuBar','none', ...
	'Name','Choose Sections', ...
	'NumberTitle','off', ...
	'PaperPosition',[18 180 576 432], ...
	'PaperSize',[612 792], ...
	'PaperUnits','points', ...
	'Position',[332.8 287.2 294 fh], ...
	'RendererMode','manual', ...
	'Tag','pick', ...
	'ToolBar','none');
h1 = uicontrol('Parent',h0, ...
	'Units','points', ...
	'BackgroundColor',[0.92 0.92 0.97], ...
	'FontSize',14, ...
	'ForegroundColor',[1 0 0], ...
	'Position',[28 fh-30 250 20], ...
	'String',inputstr, ...
	'Style','text', ...
	'Tag','title');

if ALLFIG.type == 1 % deletions
   for chk = 1:len
      tagname = ['box_', sect_info(chk).name];
      h1 = uicontrol('Parent',h0, ...
         'Units','points', ...
         'BackgroundColor',[0.92 0.92 0.97], ...
         'Position',[80 50+30*(chk-1) 120 20], ...
         'String',sect_info(end-chk+1).name, ...
         'HorizontalAlignment', 'left', ...
         'Style','checkbox', ...
         'Tag',tagname);
   end
end

if ALLFIG.type == 2 % edits
   for chk = 1:len
      tagname = ['box_', sect_info(chk).name];
      vtag = ['vchk_', sect_info(chk).name];
      ctag = ['cchk_', sect_info(chk).name];
      h1 = uicontrol('Parent',h0, ...
         'Units','points', ...
         'BackgroundColor',[0.92 0.92 0.97], ...
         'Position',[30 50+30*(chk-1) 120 20], ...
         'String',sect_info(end-chk+1).name, ...
         'HorizontalAlignment', 'left', ...
         'Style','checkbox', ...
         'Tag',tagname);
      
      h1 = uicontrol('Parent',h0, ...
         'Units','points', ...
         'BackgroundColor',[0.92 0.92 0.97], ...
         'Position',[160 50+30*(chk-1) 55 20], ...
         'String','contour', ...
         'Value', 1, ...
         'HorizontalAlignment', 'left', ...
         'Style','checkbox', ...
         'Tag',ctag);
      
      h1 = uicontrol('Parent',h0, ...
         'Units','points', ...
         'BackgroundColor',[0.92 0.92 0.97], ...
         'Position',[220 50+30*(chk-1) 55 20], ...
         'String','vector', ...
         'Value', 1, ...
         'HorizontalAlignment', 'left', ...
         'Style','checkbox', ...
         'Tag',vtag);   
   end
end

h1 = uicontrol('Parent',h0, ...
	'Units','points', ...
	'BackgroundColor',[0.702 0.702 0.702], ...
	'Callback','close', ...
	'ForegroundColor',[0 0 1], ...
	'ListboxTop',0, ...
	'Position',[28.8 18 65 20], ...
	'String','Cancel', ...
	'Tag','btnCancel');
h1 = uicontrol('Parent',h0, ...
	'Units','points', ...
	'BackgroundColor',[0.702 0.702 0.702], ...
	'Callback', 'sendresults', ...
	'ForegroundColor',[0 0 1], ...
	'ListboxTop',0, ...
	'Position',[188 18 65 20], ...
	'String','OK', ...
	'Tag','btnOK');

%%%%%%%%%


