%   Name: mdselwin
%
%   Usage: mdselwin
%
%   Description: Pallette window for selection of active modes 
%     
%   The following variable is defined in the workspace
%	by these features:
%
%       mode_anal - vector of indices of modes to use in the analysis
%  

     
%
%  Version SWD970114
%
%  Author(s): Scott W. Doebling, doebling@lanl.gov
%
%  Institution: Los Alamos National Laboratory,
%		ESA-EA
%
%  Copyright (c) 1997, The Regents of the University
%     	of California. (See top level of code for
%		full copyright statement.)

hmdsel(1) = figure('units','pixels','position',[30 30 300 200],...
			'menubar','none','numbertitle','off','resize','off',...
			'name','Diamond: Mode Selection','visible','off');

top=.95;
left=.05;
btnwd=.25;
btnht=.1;
spacing=.01;




%
%  Close Button

btnpos = [1-spacing-btnwd 0.01 btnwd btnht];
hmdsel(2) = uicontrol(hmdsel(1),...
	'style','push',...
	'units','normal',...
	'position',btnpos,...
	'string','Close',...
	'call','set(hmdsel(1),''visible'',''off'')');

%
%  Use All Modes Checkbox
%

btnpos = [0.55 0.5 0.4 0.1];
hmdsel(3) = uicontrol(hmdsel(1),...
	'style','checkbox',...
	'units','normal',...
	'position',btnpos,...
	'string','Use All Modes',...
	'value',0,...
	'callback',[' if get(hmdsel(3),''value'') == 1,',...
			' set(hmdsel(4:5),''visible'',''off''),',...
			' mode_anal = [1:nmod_tot];',...
		    ' else,',...
			' set(hmdsel(4:5),''visible'',''on''),',...
			' set(hmdsel(5),''string'',mat2str(mode_anal)),',...
		    ' end,']);


%
%  Enter Vector of modes to keep
%

btnpos = [0.05 0.3 0.15 0.1];
hmdsel(4) = uicontrol(hmdsel(1),...
	'style','text',...
	'units','normal',...
	'position',btnpos,...
	'string','Modes:');

btnpos = [0.20 0.3 0.5 0.1];
hmdsel(5) = uicontrol(hmdsel(1),...
	'style','edit',...
	'units','normal',...
	'position',btnpos,...
	'string','[ 1 ]',...
	'callback',...
		[' mode_anal = str2num(get(hmdsel(5),''string''));']);
