/basewindow superclass /minwidth 50 def /minheight 25 def /footer false def /selected false def /leftfoot //nullstring def /rightfoot //nullstring def %begin postscript section /resizable persist %end postscript section %begin postscript section /footer persist %end postscript section %begin postscript section /leftfoot persist %end postscript section %begin postscript section /rightfoot persist %end postscript section /borderN 26 def /borderW 5 def /borderE 5 def /borderS { % -- float footer 26 5 ifelse } def /PaintActive { % -- BG setcolor resizable { 13 h 5 sub w 26 } { borderW h 5 sub w borderW sub borderE } ifelse sub 2 rectpath borderW h borderN sub w borderW sub borderE sub 3 rectpath fill @freezer null eq { currentinputfocus cv eq } false ifelse { resizable { false 13 h 4 sub w 26 } { false borderW h 4 sub w borderW sub borderE } ifelse sub OLHLine false borderW h borderN sub 2 add w borderW sub borderE sub OLHLine } if } def /PaintBorder { % -- BG setcolor 5 0 0 w h rectframe eofill FG setcolor selected 3 { resizable 2 1 ifelse } ifelse 0 0 w h rectframe eofill dragable {resizable} false ifelse { false 0 0 OLReshapeSW false 0 h OLReshapeNW false w h OLReshapeNE false w 0 OLReshapeSE } if } def /PaintClose { % boolean -- gsave BG setcolor 5 h 23 sub 35 18 rectpath fill 14 h 21 sub translate true exch OLMenuBut grestore } def /PaintLabel { % -- w 45 gt { BG setcolor 40 h 23 sub w 45 sub 18 rectpath fill } if w 60 gt { headerfont setfont FG setcolor framelabel DISize pop w 80 sub lt { framelabel 40 h 22 sub w 80 sub 16 DIPaintCentered } { framelabel 40 h 22 sub w 50 sub 16 OLShow } ifelse @freezer null ne { BG setcolor 40 h 22 sub w 80 sub 16 rectpath OLStipple } if } if } def /PaintFooter { % -- footer { BG setcolor 5 5 w 10 sub borderS 5 sub rectpath fill w 50 gt { leftfoot null ne } false ifelse { rightfoot null ne } false ifelse { footerfont setfont FG setcolor leftfoot DISize pop rightfoot DISize pop 2 copy add 20 add w 20 sub lt { pop pop leftfoot 10 6 w 20 sub 19 DIPaintLeft rightfoot 10 6 w 20 sub 19 DIPaintRight } { 1 index w 0.75 mul 20 sub gt { exch pop leftfoot 10 6 w 0.75 mul 20 sub 19 OLShow w 4 div 20 sub min rightfoot w 2 index sub 10 sub 6 4 -1 roll } { pop leftfoot 10 6 w 20 sub 19 DIPaintLeft rightfoot 1 index 30 add 6 w 5 -1 roll sub 40 sub } ifelse 19 OLShow } ifelse } if } if } def /Paint { % -- BG setcolor clippath fill PaintBorder false PaintClose PaintActive PaintLabel PaintFooter } def /focus_change { % -- /PaintActive gexec } def /frost_change { % -- /PaintLabel gexec } def /trackinpath false def /track_close { % -- trackx tracky pointinpath dup trackinpath ne { dup /trackinpath exch promote PaintClose } {pop} ifelse } def /OnSelect { % -- mouseevent /XLocation get mouseevent /YLocation get 14 h 21 sub //OLButW //OLButH rectpath 2 copy pointinpath { pop pop /track_close track pop trackinpath { false PaintClose close } if /trackinpath unpromote } { dragable {resizable} false ifelse { 1 index 8 lt { dup 8 lt } false ifelse { pop pop true 0 0 OLReshapeSW resizeSW false 0 0 OLReshapeSW } { 1 index 8 lt { dup h 8 sub gt } false ifelse { pop pop true 0 h OLReshapeNW resizeNW false 0 h OLReshapeNW } { 1 index w 8 sub gt { dup h 8 sub gt } false ifelse { pop pop true w h OLReshapeNE resizeNE false w h OLReshapeNE } { exch w 8 sub gt { 8 lt } { pop false } ifelse { true w 0 OLReshapeSE resizeSE false w 0 OLReshapeSE } { //OnSelect exec } ifelse } ifelse } ifelse } ifelse } { pop pop //OnSelect exec } ifelse } ifelse } def /OnMenu { % -- mouseevent /XLocation get mouseevent /YLocation get 14 h 21 sub //OLButW //OLButH rectpath pointinpath { true PaintClose //OnMenu exec false PaintClose } { //OnMenu exec } ifelse } def /setfooters { % any any -- leftfoot 2 index ne true { rightfoot 1 index ne } ifelse { exch /leftfoot exch promote /rightfoot exch promote /PaintFooter gexec } { pop pop } ifelse } def /setleftfooter { % any -- rightfoot setfooters } def /setrightfooter { % any -- leftfoot exch setfooters } def