function [hpp] = pcpkbtns(figNumber)
% Function: pcpkbtns.m
% 
% Usage: hpp = pgenbtns(figNumber);
% 
% Description:
%    Initializes the Pick Peaks Window
%    Handles and graphics elements.
%    Returns a vector to those elements.
%
% Version SWD970402
%
% Author(s): Erik Straser, estraser@lanl.gov
%     modified by Scott W. Doebling, doebling@lanl.gov
%
% Institution: Los Alamos National Laboratory, ESA-EA
%
% Copyright (c) 1996-1997, The Regents of the University
%     	of California.

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];
hpp(1)=uicontrol(figNumber, ...
        'Style','Frame', ...
        'units','normalized', ...
        'Position',frmpos, ...
        'BackgroundColor',[.5 .5 .5]);



%====================================
% Set up the buttons
%=====================================
%  sliders
%
   hpp(2) = uicontrol(figNumber, ...
        'style','slider', ...
        'pos',[.35 .01 .2 0.04], ...
        'back','w', ...
  'call',['f1_t=get(onHndlVector(2),''value'');',...
      '[f1,onHndlVector(16:17)] = slidfreq(f1_t,onHndlVector(2),',...
		    'onHndlVector(16:17),onHndlVector(14),ymaxm,yminm,lnst(2,:),lnco(2,:));',...    
       'set(onHndlVector(4),''string'',num2str(f1));']);


   hpp(3)=uicontrol(figNumber, ...
        'style','text', ...
	  'pos',[.35 .05 .1 .04], ...
     'string','Freq:');

hpp(4) = uicontrol(figNumber, ...
	'style','edit', ...
	'pos',[.45 .05 .1 .04], ...
	'back','w', ...
	'callback',['f1_t=str2num(get(onHndlVector(4),''string''));', ...
		 '[f1,onHndlVector(16:17)] = slidfreq(f1_t,onHndlVector(2),',...
		    'onHndlVector(16:17),onHndlVector(14),ymaxm,yminm,lnst(2,:),lnco(2,:));',...    
       'set(onHndlVector(4),''string'',num2str(f1));']);

%
%  hpp(5:9) are defunct
%  

hpp(5) = uicontrol('position',[0 0 eps eps]);
hpp(6) = uicontrol('position',[0 0 eps eps]);
hpp(7) = uicontrol('position',[0 0 eps eps]);
hpp(8) = uicontrol('position',[0 0 eps eps]);
hpp(9) = uicontrol('position',[0 0 eps eps]);

%
% Set up buttons on the console
%

%
%  Plot tools button
%

btnnum=0;
ypos=top-(btnnum)*(btnht+spacing);
btnpos=[left ypos-btnht btnwd btnht];
hpp(10) = uicontrol(figNumber,...
	'style','push',...
	'position',btnpos,...
	'string','Plot Tools',...
	'call',['defhline,',...
		' iptline=1;',...
		'  set(hplttl(11),''value'',iptline),',...
		'eval(get(hplttl(11),''call'')),',...
		'set(hplttl(1),''visible'',''on''), figure(hplttl(1))']);

%====================================
% Set up the axes
%====================================

hpp(14) = axes('position',[.1 .2 .7 .7],'visible','off');


%====================================
% Set up the cursor
%====================================

hpp(16) = line([0 1],[0 1]);

hpp(17) = text(0,0,' ');

%
%  hpp(20:23) are defunct
% 

hpp(20) = uicontrol('position',[0 0 eps eps]);
hpp(21) = uicontrol('position',[0 0 eps eps]);
hpp(22) = uicontrol('position',[0 0 eps eps]);
hpp(23) = uicontrol('position',[0 0 eps eps]);

%
%  hpp(25) are defunct
% 

hpp(25) = uicontrol('position',[0 0 eps eps]);

%
%  Input/Output mode shape selector
%

btnnum=1;
ypos=top-(btnnum)*(btnht+spacing);
btnpos=[left ypos-btnht btnwd btnht];
hpp(12)=uicontrol(figNumber, ...
      'style','popup', ...
      'position',btnpos, ...
      'Value',1,...
      'string','Resp DOF|Ref DOF', ...
       'callback',['iopDOF=get(onHndlVector(12),''value'');']);

%
% Define operating shape
%
btnnum=2;
ypos=top-(btnnum)*(btnht+spacing);
btnpos=[left ypos-btnht btnwd btnht];
   hpp(13)=uicontrol(figNumber, ...
	'style','push', ...
	'pos',btnpos, ...
      	'string','op shape', ...
		'call',['nl=f1/df+1;', ...
		'iopDOF=get(onHndlVector(12),''value'');',...
		'iplt_t = 1;',...
		'ipltcmplx=get(onHndlVector(18),''Value'');',...
		'if iopDOF==1,',...
		   'phic_resp_t=G([nl:nlines:size(G,1)],iref);', ...
		'elseif iopDOF==2,',...
		   'phic_ref_t=G(nlines*(iresp-1)+nl,:)'';', ...
		'end,',...
		'freq_t = f1;',...
		'if ipltcmplx==1,',...
		'c2rdlg,',...
		'end,',...
		'set(onHndlVector(11),''visible'',''on''),',...
		'set(onHndlVector(15),''visible'',''on''),']);

%
% View Modes Button
%
btnnum=3;
ypos=top-(btnnum)*(btnht+spacing);
btnpos=[left ypos-btnht btnwd btnht];

   hpp(11)=uicontrol(figNumber, ...
	'style','push', ...
	'pos',btnpos, ...
      	'string','View Shape', ...  
 	'call',['if exist(''Nodes'')==1 & exist(''Bars'')==1,',...
		'asphiplt, nmod=1;',...
		'viewmode,',...
		'else, disp(''ERROR: No Geometry Loaded - Cannot View Modes''),',...
		' end,']);

%
%
% Keep operating shape
%
btnnum=4;
ypos=top-(btnnum)*(btnht+spacing);
btnpos=[left ypos-btnht btnwd btnht];

   hpp(15) = uicontrol(figNumber, ...
	'style','push', ...
	'pos',btnpos, ...
      	'string','keep shape', ...
	'call',['asphi_t,'...
		'set(hmmenu(6),''enable'',''on''),',...
		'set(onHndlVector(15),''visible'',''off''),',...
		'set(onHndlVector(11),''visible'',''off''),']);

%
% Mode type popup (real/complex)
%
btnnum=5;
ypos=top-(btnnum)*(btnht+spacing);
btnpos=[left ypos-btnht btnwd btnht];

hpp(18)=uicontrol(figNumber, ...
	'style','popupmenu', ...
	'string','Real|Complex', ...
	'position',btnpos,...
	'value',2,...
	'callback','ipltcmplx = get(onHndlVector(18),''value'');');

%
%  Mouse-based cursor position
%
hpp(19)=uicontrol(figNumber, ...
        'style','pushbutton', ...
        'pos',[.35 .10 .2 .04], ...
        'string','Use Mouse', ...
	'callback',['[f1_t,temp] = ginput(1);',...
      '[f1,onHndlVector(16:17)] = slidfreq(f1_t,onHndlVector(2),',...
		    'onHndlVector(16:17),onHndlVector(14),ymaxm,yminm,lnst(2,:),lnco(2,:));',...    
       'set(onHndlVector(4),''string'',num2str(f1));']);


set(hpp,'visible','off')

return