XEROX Lisp Users' Package 2 4 1 TWODINSPECTOR 1 4 By: Jan Pedersen (Pedersen.PA @ Xerox.ARPA) The TWODINSPECTOR package provides a two-dimensional inspector window abstraction, very similar in form to the standard one-dimensional inspector but laid out in rows and columns, instead of just rows. The top level function is TWODINSPECTW.CREATE (TWODINSPECTW.CREATE DATUM ROWPROPS COLUMNPROPS FETCHFNà STOREFN VALUECOMMANDFN ROWPROPCOMMANDFNà COLUMNPROPCOMMANDFN TITLE TITLECOMMANDFN WHERE TOPRIGHT) [Function] Datum is the object to be inspected. Rowprops is a list of properties of the datum which will be laid out vertically, or a function which will be called with datum as an argument and returns such a list. Similarly, columnprops is a list of properties of the datum which will be laid out horizontally, or a function which will be called with datum as an argument and returns such a list. Each pair (rowprop, columprop) specifies a cell of the twodimensional inspector window. Fetchfn is a function which if called with arguments datum, rowprop, and columprop returns the value in that cell. Storefn is a function which if called with arguments newvalue, datum, rowprop, and columprop stores newvalue in the cell. The cells of the inspector window are selectable. If valuecommandfn is given, it must be a function which will be called with arguments cellvalue, rowprop, columnprop, datum, and twodinspectwindow when the cell specified by (rowprop, columnprop) is selected. A default valuecommandfn is provided which allows the cellvalue to be inspected, set, or bound to the litatom IT. Similarly the rowprops and the columnprops themselves are selectable. If rowpropcommandfn is given it must be a function which will be called with args rowprop, datum, and twodinspectwindow when rowprop is selected. If columnpropcommandfn is given it must be a function which will be called with args columnprop, datum, and twodinspectwindow when columnprop is selected. No default rowpropcommandfn or columnpropcommandfn is provided. If rowpropcommandfn is not given, the rowprops will not be selectable. Similarly, If columnpropcommandfn is not given, the columnprops will not be selectable. Title will be the title for the window -- a default is provided. Titlecommandfn is a function which will be called with the single argument twodinspectwindow if the middle button is depressed in the title bar of the window. Where may be a window, in which case it will be used as at least part of the twodinspector (the twodinspector is composed of five window), This is especially useful if where is the result of a previous call to TWODINSPECTW.CREATE. The dimensions of where will not be used to position the twodinspector unless topright is NIL. Where may also be region or a position specifying the lower left hand corner of the twodinspector. If where is NIL, the user will be prompted for a position. Topright allows the user to specify the top right-hand corner of the twodinspector. Topright must be a position, and if given overrides any specification which may have been provided by the argument where. Returns the main window of an attached window group. The arguments to TWODINSPECTW.CREATE are cached on windowprops of the same name on the returned main window. Several functions are provided for use in the various command functions. (TWODINSPECT.REDISPLAY TWODINSPECTW SOMEROWPROPS à SOMECOLUMNPROPS) [Function] Redisplay selected cells of twodinspectw. Somerowprops may either be a single rowprop, a list of rowprops, or NIL. Somecolumnprops may either be a single columnprop, a list of columnprops, or NIL. If either are NIL the entire twodinspectw is recomputed and redisplayed. Otherwise, the cells specified by the cross product of somerowprops and somecolumnprops are redisplayed, possibly forcing the entire twodinspectw to redisplay if the printed representation of a cell overflows its column width. (TWODINSPECT.REPLACE TWODINSPECTW ROWPROP COLUMNPROP à NEWVALUE) [Function] Replaces the cell specified by (rowprop, columprop) with newvalue and updates the display. (TWODINSPECT.SELECTITEM TWODINSPECTW ROWPROP COLUMNPROP] [Function] Selects the cell specified by (rowprop, columprop). That cell is inverted and put on the window prop SELECTION of twodinspectw. If either of rowprop or columprop is NIL, then the current selection is simply deselected. (TWODINSPECT.SELECTROWPROP TWODINSPECTW ROWPROP] [Function] Selects rowprop. If rowprop is NIL, then the currently selected rowprop is deselected. (TWODINSPECT.SELECTCOLUMNPROP TWODINSPECTW COLUMNPROP] [Function] Selects columprop. If rowprop is NIL, then the currently selected columprop is deselected. Note: there is no provision for redisplaying selected row or column props -- although this may be effected by redisplaying the entire twodinspectw. Since the Twodinspector windows differ stylistically from the standard inspector windows, a stylistically similar onedinspector window is also provided. (ONEDINSPECTW.CREATE DATUM PROPS FETCHFN STOREFN VALUECOMMANDFN à PROPCOMMANDFN TITLE TITLECOMMANDFN WHERE TOPRIGHT) [Function] Datum is the object to be inspected.Props is a list of properties of the datum which will be laid out horizontally, or a function which will be called with datum as an argument and returns such a list. Each prop specifies a cell of the onedimensional inspector window. Fetchfn is a function which if called with arguments datum, and prop returns the value in that cell. Storefn is a function which if called with arguments newvalue, datum, and prop stores newvalue in the cell. The cells of the inspector window are selectable. If valuecommandfn is given, it must be a function which will be called with arguments cellvalue, prop, datum, and onedinspectwindow when the cell specified by prop is selected. A default valuecommandfn is provided which allows the cellvalue to be inspected, set, or bound to the litatom IT. Similarly the props themselves are selectable. If propcommandfn is given it must be a function which will be called with args prop, datum, and onedinspectwindow when prop is selected. No default propcommandfn is provided. If propcommandfn is not given, the props will not be selectable. Title will be the title for the window -- a default is provided. Titlecommandfn is a function which will be called with the single argument onedinspectwindow if the middle button is depressed in the title bar of the window. Where may be a window, in which case it will be used as at least part of the onedinspector (the onedinspector is composed of three window), This is especially useful if where is the result of a previous call to ONEDINSPECTW.CREATE or TWODINSPECTW.CREATE. The dimensions of where will not be used to position the onedinspector unless topright is NIL. Where may also be region or a position specifying the lower left hand corner of the onedinspector. If where is NIL, the user will be prompted for a position. Topright allows the user to specify the top right-hand corner of the onedinspector. Topright must be a position, and if given overrides any specification which may have been provided by the argument where. Returns the main window of an attached window group. The arguments to ONEDINSPECTW.CREATE are cached on windowprops of the same name on the returned main window. (ONEDINSPECT.REDISPLAY ONEDINSPECTW SOMEPROPS) [Function] Redisplay selected cells of onedinspectw. Someprops may either be a single prop, a list of props, or NIL, in which case the entire onedinspectw is recomputed and redisplayed. Otherwise, the cell(s) specified by the someprops are redisplayed, possibly forcing the entire someprops to redisplay if the printed representation of a cell overflows the column width. (ONEDINSPECT.REPLACE ONEDINSPECTW PROP NEWVALUE) [Function] Replaces the cell specified by prop with newvalue and updates the display. (ONEDINSPECT.SELECTITEM ONEDINSPECTW PROP) [Function] Selects the cell specified by prop. That cell is inverted and put on the window prop SELECTION of onedinspectw. If prop is NIL, then the current selection is simply deselected. (ONEDINSPECT.SELECPROP ONEDINSPECTW PROP) [Function] Selects prop. If prop is NIL, then the currently selected prop is deselected. /HHÈÈ/È ¼È&È &È&ŠŠ8&ŠŠ8BÈÈ PAGEHEADING RUNNINGHEAD&MODERN MODERN MODERN MODERNLOGO?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8))  HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN -Í.*+ ÈuRàFžÎ5nI ñ# Z  Ú V  Z“™ "2 ßUà^žÎ4m i J ° M E»zº