function theResult = AddMenus(self)

% StarBeam/AddMenus -- Add menus to "starbeam" window.
%  AddMenus(self) adds menus to the window associated
%   with self, a "starbeam" object.
 
% Copyright (C) 1997 Dr. Charles R. Denham, ZYDECO.
%  All Rights Reserved.
%   Disclosure without explicit written consent from the
%    copyright owner does not constitute publication.
 
% Version of 21-Jul-1997 16:30:13.

if nargin < 1, help(mfilename), return, end

set(gcf, 'MenuBar', 'figure')

% New menus.

theVarnames = [ ...
{'-Beam';
'>>Beam 1';
'>>Beam 2';
'>>Beam 3';
'>>Beam 4';
'-Beams';
'>>Velocity';
'>>Correlation';
'>>AGC';
'>>Percent Good';
'-Instrument';
'>>Tilt';
'->Voltage'};
];

theLabels = [ ...
{'<StarBeam>'; ...
'>About Starbeam...';
'-Setup...';
'-Graph'; ...
'>>Line'; ...
'>>Circles'; ...
'>>Dots'; ...
'->Contour'; ...
'>>Image'; ...
'->Scatter'; ...
'->Wiggles X'; ...
'>>Wiggles Y'; ...
'->Averaging On';
'>>Averaging Off';
'->Colorbars'; ...
'->Page Setup...'; ...
'>>Print'; ...
'->Update'; ...
'-Time Axis'; ...
'>>Date'; ...
'->Record'; ...
'-Depth Axis'; ...
'>>Depth'; ...
'->Bin'; ...
}; ...
theVarnames;  ...
];

s = setstr([abs('a'):abs('z') abs('0123456789')]);

theMenus = [];
theCalls = cell(size(theLabels));
theTags = cell(size(theLabels));
for i = 1:length(theLabels)
   theCalls{i} = 'pxevent';
   theTag = lower(theLabels{i});
   for j = length(theTag):-1:1
      if ~any(theTag(j) == s)
         theTag(j) = '';
      end
   end
   theTags{i} = theTag;
end
		
theMenus = [theMenus; pxmenu(gcf, theLabels)];

if nargout > 0, theResult = theMenus; end
