% window_subset.ps % % 30/6/89 % % ORKB % % Copyright STC Technology Limited % /ORKItem where { pop } { (item_subset.ps) run } ifelse systemdict begin % ============================= ItemsWindow ============================= % A window with a Pane item filling its ClientCanvas. This allows % an application to make a window and add a bunch of items to it % for display/management/etc. It keeps things tidier than always % overwriting the PaintClient procedure with {items paintitems...} /ItemsWindow DefaultWindow dictbegin /ClientControlArea null def % a Pane compound item dictend classbegin % class variables /ClientFillColor .9 def % private methods /PaintClient { % - => - /PaintBackground self send /PaintItems self send } def /PaintItems { % - => - /paint ClientControlArea send } def /PaintBackground { % - => - ClientFillColor fillcanvas } def /CreateClientControlArea { % - => - /ClientControlArea ClientCanvas /new Pane send store } def % public methods /new { % type parent => instance /new super send begin /CheckCanvases self send /CreateClientControlArea self send /auto_shape self send currentdict end } def /reshape { % x y w h => - /reshape super send 0 0 ClientWidth ClientHeight /reshape ClientControlArea send } def /auto_shape { % - => - 400 400 100 100 /reshape self send } def /paint_background { % - => - gsave ClientCanvas setcanvas /PaintBackground self send grestore } def /get_items_canvas { % - => client_control_area_canvas /get_canvas ClientControlArea send } def /set_items { % [ item ... ] | dict => - /set_items ClientControlArea send } def /add_items { % [ item ... ] | dict => - /add_items ClientControlArea send } def /get_item { % int | name => item /get_item ClientControlArea send } def /get_all_items { % - => [ item ... ] /get_all ClientControlArea send } def /clear_items { % - => - /clear_items ClientControlArea send } def /remove_item { % item => - /remove_item ClientControlArea send } def /destroy { % - => - ClientControlArea null ne {/destroy ClientControlArea send} if /ClientControlArea null store /destroy super send } def classend def end % systemdict