%! % % This file is a product of Sun Microsystems, Inc. and is provided for % unrestricted use provided that this legend is included on all tape % media and as a part of the software program in whole or part. % Users may copy, modify or distribute this file at will. % % THIS FILE IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE % WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR % PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. % % This file is provided with no support and without any obligation on the % part of Sun Microsystems, Inc. to assist in its use, correction, % modification or enhancement. % % SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE % INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS FILE % OR ANY PART THEREOF. % % In no event will Sun Microsystems, Inc. be liable for any lost revenue % or profits or other special, indirect and consequential damages, even % if Sun has been advised of the possibility of such damages. % % Sun Microsystems, Inc. % 2550 Garcia Avenue % Mountain View, California 94043 % % Copyright (c) 1988 by Sun Microsystems, Inc. /Item where { pop } { systemdict begin (NeWS/liteitem.ps) LoadFile end } ifelse /BarMenu DefaultMenu [] classbegin /CenterItems? false def classend def /MenuBar Object dictbegin /X null def /Y null def /Gap null def /MenuBarCanvas null def /Items [] def /ItemMgr null def dictend classbegin /new { % x y gap canvas -> - /new super send begin /MenuBarCanvas exch def /Gap exch def /Y exch def /X exch def %% (new: % % % %\n) [ MenuBarCanvas Gap Y X ] dbgprintf currentdict end } def /move { % x y -> - /Y exch def /X exch def } def /addmenu { % menu name proc -> - %% (addmenu: % % % %\n) [ MenuBarCanvas Gap Y X ] dbgprintf MenuBarCanvas 0 0 /new MenuItem send % item dup Items 999 3 -1 roll arrayinsert /Items exch def dup X Y /move 4 -1 roll send % item dup /bbox exch send pop % x y width X add Gap add /X exch def pop pop } def /activate { /ItemMgr Items forkitems def } def /paint { Items paintitems } def classend def /MenuItem ButtonItem [ /Menu null def ] classbegin /new { /new super send begin /Menu exch def % disgusting hack!! not my fault! blame ButtonItem!! /ItemRadius 6 def /ItemFrame 1 def /ItemBorder 1 def /ItemGap 3 def currentdict end } def /ItemButton [ RightMouseButton ] def /ClientDown { %% (client down\n) [] dbgprintf true SetButtonValue framebuffer setcanvas ItemCanvas getcanvaslocation /showat Menu send } def /ClientUp { %% (client up\n) [] dbgprintf pause % let the menu die! false SetButtonValue /ItemValue null store StopItem } def /ClientEnter { %% (client enter\n) [] dbgprintf } def /ClientExit { %% (client exit\n) [] dbgprintf } def /setmenu { % menu => - /Menu exch def } def /getmenu { % menu => - Menu } def classend def