fig=createmadfig('wavspect'); 
fig=createmadloadmenu(fig);
fig=createmadmenus(fig);

% major row & column positions

left=0.1;
top=0.95;
bottom=0.0;
mid=0.5;
right=0.9;

ud.spectAxes = axes('Parent',fig,...
   'Position',[left+0.1 bottom+0.1 right-left-0.2 0.5],...
   'DrawMode','fast',...
   'NextPlot','replacechildren',...
   'Box','on',...
   'XTick',[],'YTick',[]); 
   
uicontrol('Parent',fig, ...
	'Callback','wavspect spectRecalc',...
	'Position',[left+0.35 bottom+0.6 0.15 0.05], ...
	'String','recalc', ...
	'Style','checkbox', ...
	'Tag','spectRecalcCheck');
	
uicontrol('Parent',fig, ...
	'Callback','wavspect useHamming',...
	'Position',[left+0.1 bottom+0.6 0.2 0.05], ...
	'String','Hamming win?', ...
	'Style','checkbox', ...
	'Tag','useHammingCheck');
		
ud.wavAxes = axes('Parent',fig,...
   'Position',[left 0.7 right-left 0.2],...
   'DrawMode','fast',...
   'NextPlot','replacechildren',...
   'Box','on');

uicontrol('Parent',fig, ...
	'Callback','wavspect linkCursors',...
	'Position',[left+0.66 top-0.05 0.17 0.05], ...
	'String','link cursors', ...
	'Style','checkbox', ...
	'Tag','linkCursorsCheck');
	
uicontrol('Parent',fig, ...
	'Position',[left+0.48 top-0.05 0.03 0.05], ...
	'Callback','wavspect zoom',...
	'String','Z', ...
	'Style','pushbutton', ...
	'Tag','zoomButton');
	
uicontrol('Parent',fig, ...
	'Position',[left+0.51 top-0.05 0.03 0.05], ...
	'Callback','wavspect unzoom',...
	'String','z', ...
	'Style','pushbutton', ...
	'Tag','unzoomButton');
uicontrol('Parent',fig, ...
	'Position',[left+0.54 top-0.05 0.05 0.05], ...
	'Callback','wavspect zoomToCursors',...
	'String','cur', ...
	'Style','pushbutton', ...
	'Tag','zoomToCursorsButton');
uicontrol('Parent',fig, ...
	'Position',[left+0.59 top-0.05 0.05 0.05], ...
	'Callback','wavspect showall',...
	'String','all', ...
	'Style','pushbutton', ...
	'Tag','showallButton');

% uicontrol('Parent',fig, ...
% 	'Position',[left top-0.05 0.2 0.05], ...
% 	'String','accumulate sigs', ...
% 	'Style','checkbox', ...
% 	'Tag','accumulateCheck');

uicontrol('Parent',fig, ...
	'Position',[left+0.20 top-0.05 0.2 0.05], ...
	'String','play on release', ...
	'Style','checkbox', ...
	'Tag','playCheck');
	
set(gcf,'UserData',ud);
