function sembbtns
%
% Function: sembbtns
% 
% Usage: sembbtns
% 
% Description:
%    Initializes the Strain Energy 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

%%===========================================
%% Strain energy/curvature buttons
%%===========================================

%====================================
% General buttons parameters
%====================================
top=.95;
left=.84;
btnwd=.15;
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.hsemb(1)=uicontrol(HANDLES.hfigdmnd, ...
        'Style','Frame', ...
        'Position',frmpos, ...
        'BackgroundColor',[.5 .5 .5]);

%
% calculate button
%

btnnum=3;
ypos=top-(btnnum-1)*(btnht+spacing);
btnpos=[left ypos-btnht btnwd btnht];
HANDLES.hsemb(6)=uicontrol(HANDLES.hfigdmnd, ...
      'style','pushbutton', ...
      'position',btnpos, ...
      'string','Calculate', ...
      'callback',[ ...
   'if ~isempty(GEOM.SEMquads),',...
   '   sedamshl,',...
   'elseif ~isempty(GEOM.SEMbeams),',...
   '   sedambar,',...
   'end,',...
	'set(HANDLES.hsemb(22:31),''visible'',''on'');', ...
	]);


%
%  To choose which mode to plot
%

btnnum=5;
ypos=top-(btnnum-1)*(btnht);
btnpos=[left ypos-btnht btnwd btnht];
HANDLES.hsemb(7)=uicontrol(HANDLES.hfigdmnd, ...
      'style','pushbutton', ...
      'position',btnpos, ...
      'string','Select Modes', ...
      'Callback', ...
      ['set(HANDLES.hmdsel(1),''visible'',''on''), figure(HANDLES.hmdsel(1)),']);         
   
%
% Number of divisions
%
btnnum=7;
ypos=top-(btnnum-1)*(btnht+spacing)-btnht/2;
btnpos=[left ypos-btnht btnwd btnht];
HANDLES.hsemb(9)=uicontrol(HANDLES.hfigdmnd, ...
      'style','text', ...
      'position',btnpos, ...
      'string','Divisions per Element');

btnnum=8;
ypos=top-(btnnum-1)*(btnht+spacing);
btnpos=[left ypos-btnht btnwd btnht];
HANDLES.hsemb(10)=uicontrol(HANDLES.hfigdmnd, ...
      'style','edit', ...
      'position',btnpos, ...
      'string','10', ...
      'back','white',...
      'callback','DAMAGEID.numdiv = str2num(get(HANDLES.hsemb(10),''string''));');
%
% Interpolation
%
btnnum=9;
ypos=top-(btnnum-1)*(btnht+spacing)-btnht/2;
btnpos=[left ypos-btnht btnwd btnht];
HANDLES.hsemb(11)=uicontrol(HANDLES.hfigdmnd, ...
   'style','text', ...
   'position',btnpos, ...
   'string','Interpolation');

btnnum=10;
ypos=top-(btnnum-1)*(btnht+spacing);
btnpos=[left ypos-btnht btnwd btnht];
HANDLES.hsemb(12)=uicontrol(HANDLES.hfigdmnd, ...
   'style','popup', ...
   'position',btnpos, ...
   'string','Spline|Cubic', ...
   'back','white', ...
   'value',1,...
   'callback',...
   ['switch get(HANDLES.hsemb(12),''value''),',...
      'case 1, DAMAGEID.interpopt = ''spline'';',...
      'case 2, DAMAGEID.interpopt = ''cubic'';',...
      'end']);

%
%  Poisson's ratio (needed for 2-D fit)
%

btnnum=11;
ypos=top-(btnnum-1)*(btnht+spacing)-btnht/2;
btnpos=[left ypos-btnht btnwd btnht];
HANDLES.hsemb(16)=uicontrol(HANDLES.hfigdmnd, ...
      'style','text', ...
      'position',btnpos, ...
      'string','Nu');
   
btnnum=12;
ypos=top-(btnnum-1)*(btnht+spacing);
btnpos=[left ypos-btnht btnwd btnht];
HANDLES.hsemb(17)=uicontrol(HANDLES.hfigdmnd, ...
      'style','edit', ...
      'position',btnpos, ...
      'string','.3', ...
      'back','w');

%
%  Axes and legend for the strain energy method plots
%

HANDLES.hsemb(32) = axes('position',[.1 .22 .7 .7],'dataaspectratio',[1 1 1]);
HANDLES.hsemb(34) = axes('position',[.1 .1 .7 .10]);


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

return
