From don@brillig.umd.edu Wed May 11 02:31:51 1988 Date: Wed, 11 May 88 02:31:51 EDT To: NeWS-makers@brillig.umd.edu Subject: class NeatWindow From: Don Hopkins Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Here is a window class with window managment menus designed to work well with pie menus. You should of course have piemenu.ps loaded up before running this. Just psh it into your environment, and the DefaultWindow will be set up so that the next window you get will be a NeatWindow! Fire up a clock or something, pop up the frame menu, and play around! I am not including any instructions right now, because I would like to hear what you think of it after trying to figure out what the menus do on your own. (heh heh heh -- the code is free but you gotta be a guinea pig!) This is experimental, so I'll be coming out with a more refined version later. If you'd care to answer the following questions after playing around with the NeatWindow menus, I'd really appreciate it! - Which functions were obvious by their direction, or their labeling? - How would you change the labels to make their meanings clearer? - Why do you think the selections are arranged the way they are? - What mnemonic tricks can you think of to remember the selection directions? - After using them for a while, which selections do you find yourself mousing into without looking at the menu? Enjoy! -Don ---neatwin.ps: Cut here: 8X--------------------------------------------- %! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % @(#)neatwin.ps % % NeatWindow Class pie menu based window manager % Copyright (C) 1988. % By Don Hopkins. % All rights reserved. % % This program is provided for UNRESTRICTED use provided that this % copyright message is preserved on all copies and derivative works. % This is provided without any warranty. No author or distributor % accepts any responsibility whatsoever to any person or any entity % with respect to any loss or damage caused or alleged to be caused % directly or indirectly by this program. This includes, but is not % limited to, any interruption of service, loss of business, loss of % information, loss of anticipated profits, core dumps, abuses of the % virtual memory system, or any consequential or incidental damages % resulting from the use of this program. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% systemdict begin systemdict /PieMenu known not { (NeWS/piemenu.ps) LoadFile pop } if /NeatWindow LiteWindow [] classbegin /stretchtopright { FrameX FrameY BBoxFromUser reshape non-iconic } def /stretchtopleft { FrameX FrameWidth add FrameY BBoxFromUser reshape non-iconic } def /stretchbottomright { FrameX FrameY FrameHeight add BBoxFromUser reshape non-iconic } def /stretchbottomleft { FrameX FrameWidth add FrameY FrameHeight add BBoxFromUser reshape non-iconic } def /stretchtop { /GA_value FrameX def /GA_constraint 0 def FrameX FrameWidth add FrameY BBoxFromUser reshape non-iconic } def /stretchbottom { /GA_value FrameX def /GA_constraint 0 def FrameX FrameWidth add FrameY FrameHeight add BBoxFromUser reshape non-iconic } def /stretchleft { /GA_value FrameY def /GA_constraint 1 def FrameX FrameWidth add FrameY FrameHeight add BBoxFromUser reshape non-iconic } def /stretchright { /GA_value FrameY def /GA_constraint 1 def FrameX FrameY FrameHeight add BBoxFromUser reshape non-iconic } def /movevertical { /GA_constraint 0 def slide } def /movehorizontal { /GA_constraint 1 def slide } def /flipmove { gsave framebuffer setcanvas /unmap self send /Iconic? Iconic? not def currentcursorlocation Iconic? { exch IconWidth 2 div sub exch IconHeight 2 div sub } { exch FrameWidth 2 div sub exch FrameHeight 2 div sub } ifelse move map slide grestore } def /non-iconic { Iconic? { flipiconic } if } def /reshapefromuser-open { reshapefromuser non-iconic } def /CreateFrameMenu { % - => - (Create frame menu) % Note: Store menu in class to share menus, especially if retained. /FrameMenu [ [(\255) /Symbol findfont 18 scalefont] {/totop ThisWindow send} /painting_hand {/paint ThisWindow send} (Move\274) FrameMoveMenu (Zap?) FrameZapMenu [(\257) /Symbol findfont 18 scalefont] {/tobottom ThisWindow send} (Reshape!) {/reshapefromuser-open ThisWindow send} (Stretch\274) FrameStretchMenu /eye3 {/flipiconic ThisWindow send} ] /new DefaultMenu send def FrameMenu /MenuFont /Times-Roman findfont 18 scalefont put } def /CreateIconMenu { % - => - (Create icon menu) % Note: Store menu in class to share menus, especially if retained. /IconMenu [ [(\255) /Symbol findfont 18 scalefont] {/totop ThisWindow send} /painting_hand {/paint ThisWindow send} (Move\274) IconMoveMenu (Zap?) FrameZapMenu [(\257) /Symbol findfont 18 scalefont] {/tobottom ThisWindow send} (Reshape!) {/reshapefromuser-open ThisWindow send} (Stretch\274) FrameStretchMenu /eye {/flipiconic ThisWindow send} ] /new DefaultMenu send def IconMenu /MenuFont /Times-Roman findfont 18 scalefont put } def % The menus shared by all instances of the class: /FrameZapMenu [ /nuke {/destroy ThisWindow send} (No!) {} (No!) {} (No!) {} ] /new DefaultMenu send def FrameZapMenu /MenuFont /Times-BoldItalic findfont 24 scalefont put /FrameMoveMenu [ /move_v {/movevertical ThisWindow send} /move {/slide ThisWindow send} /eye3 {/flipmove ThisWindow send} /move_h {/movehorizontal ThisWindow send} ] /new DefaultMenu send def /IconMoveMenu [ /move_v {/movevertical ThisWindow send} /move {/slide ThisWindow send} /eye {/flipmove ThisWindow send} /move_h {/movehorizontal ThisWindow send} ] /new DefaultMenu send def /FrameStretchMenu [ /stretch_h {/stretchtop ThisWindow send} /stretchNE {/stretchtopright ThisWindow send} [/stretch_v 4 0] {/stretchright ThisWindow send} /stretchSE {/stretchbottomright ThisWindow send} /stretch_h {/stretchbottom ThisWindow send} /stretchSW {/stretchbottomleft ThisWindow send} [/stretch_v 4 0] {/stretchleft ThisWindow send} /stretchNW {/stretchtopleft ThisWindow send} ] /new DefaultMenu send def classend def /DefaultWindow NeatWindow def end % systemdict