function sysdefbtns
%
% Function: sysdefbtns
% 
% Usage: sysdefbtns
% 
% Description:
%    Initializes the System Definition 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=.2;
lft=.2;
wd=.6;
ht=.6;
sp=.01;

%====================================
% Set up the console frame
%=====================================
frmborder=0.01;
ypos=.4-frmborder;
frmpos=[lft top wd ht];

HANDLES.simsysdef(1)=uicontrol(HANDLES.hfigdmnd, ...
        'Style','Frame', ...
        'Position',frmpos, ...
        'BackgroundColor',[.5 .5 .5]);

%
% Text message windows
%
HANDLES.simsysdef(2)=uicontrol(HANDLES.hfigdmnd, ...
   'style','text',...
   'Position',[lft+.15 top+.55 .27 .02],...
   'string','What type of system do you want to simulate?');


HANDLES.simsysdef(3)=uicontrol(HANDLES.hfigdmnd, ...
   'style','text',...
   'Position',[lft+.15 top+.45 .3 .02],...
   'string','How do you want to enter the data?');

lft=lft+.1;
%
%  Edit text boxes
%
HANDLES.simsysdef(4)=uicontrol(HANDLES.hfigdmnd, ...
   'style','edit',...
   'HorizontalAlignment','left',...
   'BackgroundColor',[1 1 1],...
   'position',[lft+.15 top+.23 .27 .03]);

HANDLES.simsysdef(5)=uicontrol(HANDLES.hfigdmnd, ...
   'style','edit',...
   'HorizontalAlignment','left',...
   'BackgroundColor',[1 1 1],...
   'position',[lft+.15 top+.18 .27 .03]);

HANDLES.simsysdef(6)=uicontrol(HANDLES.hfigdmnd, ...
   'style','edit',...
   'HorizontalAlignment','left',...
   'BackgroundColor',[1 1 1],...
   'position',[lft+.15 top+.13 .27 .03]);

%
%  Mass text messages
%
HANDLES.simsysmassdef(1)=uicontrol(HANDLES.hfigdmnd, ...
   'style','text',...
   'HorizontalAlignment','left',...
   'position',[lft+.01 top+.23 .13 .04],...
   'string','Mass matrix');

HANDLES.simsysmassdef(2)=uicontrol(HANDLES.hfigdmnd, ...
   'style','text',...
   'HorizontalAlignment','left',...
   'position',[lft+.01 top+.23 .13 .04],...
   'string','Mass matrix variable name');

HANDLES.simsysmassdef(3)=uicontrol(HANDLES.hfigdmnd, ...
   'style','text',...
   'HorizontalAlignment','left',...
   'position',[lft+.01 top+.23 .13 .04],...
   'string','Mass vector starting from closest to ground');

HANDLES.simsysmassdef(4)=uicontrol(HANDLES.hfigdmnd, ...
   'style','text',...
   'HorizontalAlignment','left',...
   'position',[lft+.01 top+.23 .13 .04],...
   'string','Mass vector variable name');

%
%  Stiffness text messages
%
HANDLES.simsysstdef(1)=uicontrol(HANDLES.hfigdmnd, ...
   'style','text',...
   'HorizontalAlignment','left',...
   'position',[lft+.01 top+.18 .13 .04],...
   'string','Stiffness matrix');

HANDLES.simsysstdef(2)=uicontrol(HANDLES.hfigdmnd, ...
   'style','text',...
   'HorizontalAlignment','left',...
   'position',[lft+.01 top+.18 .13 .04],...
   'string','Stiffness matrix variable name');

HANDLES.simsysstdef(3)=uicontrol(HANDLES.hfigdmnd, ...
   'style','text',...
   'HorizontalAlignment','left',...
   'position',[lft+.01 top+.18 .13 .04],...
   'string','Stiffness vector starting from closest to ground');

HANDLES.simsysstdef(4)=uicontrol(HANDLES.hfigdmnd, ...
   'style','text',...
   'HorizontalAlignment','left',...
   'position',[lft+.01 top+.18 .13 .04],...
   'string','Stiffness vector variable name');


%
%  Damping text messages
%
HANDLES.simsysdampdef(1)=uicontrol(HANDLES.hfigdmnd, ...
   'style','text',...
   'HorizontalAlignment','left',...
   'position',[lft+.01 top+.13 .13 .04],...
   'string','Damping matrix');

HANDLES.simsysdampdef(2)=uicontrol(HANDLES.hfigdmnd, ...
   'style','text',...
   'HorizontalAlignment','left',...
   'position',[lft+.01 top+.13 .13 .04],...
   'string','Damping matrix variable name');

HANDLES.simsysdampdef(3)=uicontrol(HANDLES.hfigdmnd, ...
   'style','text',...
   'HorizontalAlignment','left',...
   'position',[lft+.01 top+.13 .13 .04],...
   'string','Damping vector starting from closest to ground');

HANDLES.simsysdampdef(4)=uicontrol(HANDLES.hfigdmnd, ...
   'style','text',...
   'HorizontalAlignment','left',...
   'position',[lft+.01 top+.13 .13 .04],...
   'string','Damping vector variable name');

%
%  Zeta text messages
%
HANDLES.simsyszetadef(1)=uicontrol(HANDLES.hfigdmnd, ...
   'style','text',...
   'HorizontalAlignment','left',...
   'position',[lft+.01 top+.13 .13 .04],...
   'string','Zeta vector');

HANDLES.simsyszetadef(2)=uicontrol(HANDLES.hfigdmnd, ...
   'style','text',...
   'HorizontalAlignment','left',...
   'position',[lft+.01 top+.13 .13 .04],...
   'string','Zeta vector variable name');
lft=lft-.1;

HANDLES.simsysdef(20)=uicontrol(HANDLES.hfigdmnd, ...
      'style','CheckBox',...
      'Position',[lft+.15 top+.35 .3 .03],...
      'string','Determine damping matrix from modal damping definitions',...
      'Value',0,...
      'callback','syshand(HANDLES)');


HANDLES.simsysdef(21)=uicontrol(HANDLES.hfigdmnd, ...
      'style','popup', ...
      'position',[lft+.15 top+.52 .27 .03], ...
      'string','Aribitrary system mass,damping and stiffness matrices|Chain of masses connected to ground ', ...
      'value',1,...
      'callback','syshand(HANDLES)');


HANDLES.simsysdef(22)=uicontrol(HANDLES.hfigdmnd, ...
      'style','popup', ...
      'position',[lft+.15 top+.42 .3 .03], ...
      'string','Enter manually|Enter from workspace', ...
      'value',1,...
      'callback','syshand(HANDLES)');
HANDLES.simsysdef(23)=uicontrol(HANDLES.hfigdmnd, ...
   'style','pushbutton', ...
   'position',[lft+.22 top+.05 .05 .03],...
   'string','OK',...
   'callback','sysokhand(HANDLES)');

HANDLES.simsysdef(24)=uicontrol(HANDLES.hfigdmnd, ...
   'style','pushbutton', ...
   'position',[lft+.32 top+.05 .05 .03],...
   'string','Cancel',...
   'callback','hideallbtns');

      

set(HANDLES.simsysdef,'visible','off');
set(HANDLES.simsysmassdef,'visible','off');
set(HANDLES.simsysstdef,'visible','off');
set(HANDLES.simsysdampdef,'visible','off');
set(HANDLES.simsyszetadef,'visible','off');
return
