% % 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 or modify this file without charge, but are not authorized to % license or distribute it to anyone else except as part of a product % or program developed by the user. % % 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 % % % NeWSwin.ps 1.2 88/01/18 % % -------------------------- Scrollbar Window ------------------------------- % % Copyright (c) 1987 by Sun Microsystems, Inc. % Steve Isaac 12/18/87 % systemdict /NeWSWindow known not {systemdict begin /NeWSWindow LiteWindow dictbegin /HScrollbar null def /VScrollbar null def /HScrollEventMgr null def /VScrollEventMgr null def /ReshapeClient nullproc def dictend classbegin /AutoRaise false def /AutoRaiseTime 1.5 def % seconds /BorderBottom 18 def /BorderRight 18 def /ForkPaintClient? false def % ------------------------------ Utilities ------------------------------------ /DoAutoRaise { % - => - KeyFocus? { /totop self send } if } def % ----------------------------- New Methods ----------------------------------- /setautoraise { % boolean -> - /AutoRaise exch def } def /getautoraise { % - -> boolean AutoRaise } def /addHscroll { % - => - HScrollbar null eq { /HScrollbar [0 1 .01 .1 null] 0 {} FrameCanvas /new NeWSScrollbar send dup /BarVertical? false put def BorderLeft 1 sub 0 FrameWidth BorderRight sub BorderLeft sub 2 add BorderBottom /reshape HScrollbar send /HScrollEventMgr dictbegin /HScrollitem HScrollbar def dictend forkitems def VScrollbar null ne { FrameWidth BorderRight sub BorderBottom 1 sub BorderRight FrameHeight BorderBottom sub BorderTop sub 2 add /reshape VScrollbar send } if HScrollbar /ItemValue 0 put /paintframe self send } if } def /removeHscroll { % - => - HScrollbar null ne { /HScrollbar null def HScrollEventMgr killprocess /HScrollEventMgr null def VScrollbar null ne { FrameWidth BorderRight sub BorderBottom 1 sub BorderRight FrameHeight BorderBottom sub BorderTop sub 2 add /reshape VScrollbar send } if /paintframe self send } if } def /addVscroll { % - => - VScrollbar null eq { /VScrollbar [1 0 .01 .1 null] 0 {} FrameCanvas /new NeWSScrollbar send def FrameWidth BorderRight sub BorderBottom 1 sub BorderRight FrameHeight BorderBottom sub BorderTop sub 2 add /reshape VScrollbar send /VScrollEventMgr dictbegin /VScrollitem VScrollbar def dictend forkitems def HScrollbar null ne { BorderLeft 1 sub 0 FrameWidth BorderRight sub BorderLeft sub 2 add BorderBottom /reshape HScrollbar send } if VScrollbar /ItemValue 1 put /paintframe self send } if } def /removeVscroll { % - => - VScrollbar null ne { /VScrollbar null def VScrollEventMgr killprocess /VScrollEventMgr null def HScrollbar null ne { BorderLeft 1 sub 0 FrameWidth BorderRight sub BorderLeft sub 2 add BorderBottom /reshape HScrollbar send } if /paintframe self send } if } def /paintscrollbars { % - => - HScrollbar null ne {/paint HScrollbar send} if VScrollbar null ne {/paint VScrollbar send} if } def /setbgcolor { % color = - /ClientFillColor exch def /FrameFillColor ClientFillColor def ClientFillColor /setbgcolor HScrollbar send ClientFillColor /setbgcolor VScrollbar send } def /setfgcolor { % color = - /FrameTextColor exch def } def % --------------------------- Overridden Methods ----------------------------- /PaintFrame { % - => - /PaintFrame super send clipcanvaspath pathbbox pop pop 0 eq exch 0 eq or { paintscrollbars } if } def /paintframe { % - => - /paintframe super send paintscrollbars } def /EnterFrame { % - => - /EnterFrame super send AutoRaise { createevent dup begin /Name /AutoRaiseTimer def /Canvas FrameCanvas def /TimeStamp currenttime AutoRaiseTime 60 div add def end sendevent } if } def /ExitFrame { % - => - /ExitFrame super send } def /CreateFrameInterests { % - => - /CreateFrameInterests super send FrameInterests begin /AutoRaiseTimerEvent /AutoRaiseTimer /DoAutoRaise null FrameCanvas eventmgrinterest def end } def /new { % framebuffer => object systemdict /Item known not {(NeWS/liteitem.ps) run} if /new super send } def /reshape { % x y w h => - /reshape super send HScrollbar null ne { HScrollbar /ItemValue 0 put BorderLeft 1 sub 0 FrameWidth BorderRight sub BorderLeft sub 2 add BorderBottom /reshape HScrollbar send /paint HScrollbar send } if VScrollbar null ne { VScrollbar /ItemValue 1 put FrameWidth BorderRight sub BorderBottom 1 sub BorderRight FrameHeight BorderBottom sub BorderTop sub 2 add /reshape VScrollbar send /paint VScrollbar send } if /ReshapeClient self send } def classend def end} if % systemdict /NeWSWindow known not...