function msebtns
%
% Function: msebtns
% 
% Usage: msebtns
% 
% Description:
%    Initializes the mode shape expansion window
%    Handles and graphics elements.
%    Returns a vector to those elements.
%

% Version SWD970804
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This matlab source code was originally     %
% developed as part of "DIAMOND" at          %
% Los Alamos National Laboratory. It may     %
% be copied, modified, and distributed in    %
% any form, provided:                        %
%  a) This notice accompanies the files and  %
%     appears near the top of all source     %
%     code files.                            %
%  b) No payment or commercial services are  %
%     received in exchange for the code.     %
%                                            %
% Original copyright is reserved by the      %
% Regents of the University of California,   %
% in addition to Scott W. Doebling, Phillip  %
% J. Cornwell, Erik G. Straser, and Charles  %
% R. Farrar.                                 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
global HANDLES

%%===========================================%
%% Mode shape expansion Buttons
%%===========================================

%====================================
% General buttons parameters
%====================================
top=.95;
left=.84;
btnwd=.17;
btnht=.06;
spacing=.01;

%====================================
% Set up the console frame
%=====================================
frmborder=0.01;
ypos=.05-frmborder;
frmpos=[left-frmborder ypos btnwd+2*frmborder .9+2*frmborder];
HANDLES.hmseb(1)=uicontrol(HANDLES.hfigdmnd, ...
        'Style','Frame', ...
        'Position',frmpos, ...
        'BackgroundColor',[.5 .5 .5]);
%
%  Axes for the MSE plots
%

HANDLES.hmseb(2) = axes('position',[.1 .22 .7 .7]);

%
%  Select mode number
%

btnnum=4;
ypos=top-(btnnum-1)*(btnht+spacing);
btnpos=[left ypos-btnht btnwd btnht];
HANDLES.hmseb(3)=uicontrol(HANDLES.hfigdmnd, ...
      'style','pushbutton', ...
      'position',btnpos, ...
      'string','Select Mode', ...
      'Callback', ...
	['set(hmdsel(1),''visible'',''on''), figure(hmdsel(1)),']);


%
%
%  Mode shape expansion technique selection popup
%
btnnum=1;
ypos=top-(btnnum-1)*(btnht+spacing)+2*spacing;
btnpos=[left ypos-btnht btnwd btnht/2];
HANDLES.hmseb(4)=uicontrol(HANDLES.hfigdmnd, ...
      'style','text', ...
      'position',btnpos, ...
      'string','Method');

btnpos(2) = btnpos(2) - btnht/2;
HANDLES.hmseb(5)=uicontrol(HANDLES.hfigdmnd, ...
      'style','popup', ...
      'position',btnpos, ...
      'string','Geometric|OPE', ...
      'value',1,...
      'Callback', ...
	[' nmsemeth = get(onHndlVector(5),''value'');']);

%
%  Calculate mode shape expansion
%

btnnum=2.5;
ypos=top-(btnnum-1)*(btnht+spacing);
btnpos=[left ypos-btnht btnwd btnht];
HANDLES.hmseb(6)=uicontrol(HANDLES.hfigdmnd, ...
      'style','pushbutton', ...
      'position',btnpos, ...
      'string','Compute', ...
      'Callback', ...
	[' [phir_resp_d_exp,respDOF_d_exp,irespDOFvec] = msecomp(nmsemeth, phir_resp_d,respDOF_d, Nodes);',...
	 '  set(onHndlVector([3 7:10]),''visible'',''on''),']);

%
%  Plot overlay comparison of measured mode shapes and expanded mode shapes
%

btnnum=6.5;
ypos=top-(btnnum-1)*(btnht+spacing);
btnpos=[left ypos-btnht btnwd btnht];
HANDLES.hmseb(7)=uicontrol(HANDLES.hfigdmnd, ...
      'style','pushbutton', ...
      'position',btnpos, ...
      'string','Plot Overlay', ...
      'Callback', ...
	[' if length(mode_anal) ~= 1, disp(''ERROR: Must have exactly 1 mode selected for plotting''),',...
		'else, mseplot, set(onHndlVector(11:20),''visible'',''on''), end ']);

%
%  Keep Expanded mode
%

btnnum=8;
ypos=top-(btnnum-1)*(btnht+spacing);
btnpos=[left ypos-btnht btnwd btnht];
HANDLES.hmseb(10)=uicontrol(HANDLES.hfigdmnd, ...
      'style','pushbutton', ...
      'position',btnpos, ...
      'string','KEEP EXP. MODES', ...
      'Callback', ...
	[' phir_resp_d = phir_resp_d_exp; respDOF_d = respDOF_d_exp; disp(''EXPANDED MODE SHAPE ASSIGNED'')']);
%
% Define Elevation Slider
%

HANDLES.hmseb(11) = uicontrol('style','slider',...
		'pos',[0.1 0.94 0.2 0.04],...
	'max',90,...
		'min',0,...
		'value',0,...
		'callback',['naxel = floor(get(onHndlVector(11),''value''));',...
			'set(onHndlVector(15),''string'',num2str(naxel));',...
			]);
	
HANDLES.hmseb(12) = uicontrol('style','text',...
		'pos',[0.05 0.94 0.04 0.04],...
	'string','0');

HANDLES.hmseb(13) = uicontrol('style','text',...
		'pos',[0.3 0.94 0.04 0.04],...
		'string','90');

HANDLES.hmseb(14) = uicontrol('style','text',...
		'pos',[0.08 0.87 0.16 0.04],...
		'string','Elevation');

HANDLES.hmseb(15) = uicontrol('style','edit',...
		'pos',[0.245 0.87 0.07 0.04],...
		'string',num2str(0),...
		'callback',['naxel = floor(str2num(get(onHndlVector(15),''string'')));',...
			'set(onHndlVector(11),''value'',naxel);',...
			]);
%
% Define Azimuth Slider
%

HANDLES.hmseb(16) = uicontrol('style','slider',...
		'pos',[0.52 0.94 0.2 0.04],...
		'max',360,...
		'min',0,...
		'value',0,...
		'callback',['naxaz = floor(get(onHndlVector(16),''value''));',...
			'set(onHndlVector(20),''string'',num2str(naxaz));',...
			]);
	
HANDLES.hmseb(17) = uicontrol('style','text',...
		'pos',[0.48 0.94 0.04 0.04],...
		'string','0');

HANDLES.hmseb(18) = uicontrol('style','text',...
		'pos',[0.72 0.94 0.06 0.04],...
		'string','360');

HANDLES.hmseb(19) = uicontrol('style','text',...
		'pos',[0.50 0.87 0.16 0.04],...
		'string','Azimuth');

HANDLES.hmseb(20) = uicontrol('style','edit',...
		'pos',[0.665 0.87 0.12 0.04],...
		'string',num2str(0),...
		'callback',['naxaz = floor(str2num(get(onHndlVector(20),''string'')));',...
			'set(onHndlVector(16),''value'',naxaz);',...
			]);

set(HANDLES.hmseb,'visible','off');

return