XEROX RESIZE-FILEBROWSER 2 4 1 RESIZE-FILEBROWSER 1 4 By: Andrew J. Cameron, III (Cameron.pa@Xerox.com or cameron@cs.wisc.edu) Requires: TABLEBROWSER, FILEBROWSER This document last edited on Oct 20, 1987. INTRODUCTION This module attempts to eliminate the annoying need to constantly size and resize FileBrowser windows by providing the ability (via the additional FileBrowser Menu item "Size to Fit") to resize FileBrowser windows so as to display the maximum amount of information possible on the screen. It also installs itself as advice on the pertinent FileBrowser internal functions so that this resizing occurs automatically when a FileBrowser is first created or later recomputed. This automatic resizing can be overridden on a per FileBrowser basis or it can be globally turned on and off. Manual resizing is always available via the "Size to Fit" menu item. WARNING: Use of this module may be habit forming. OPERATION I almost always leave the automatic resizing turned on and when I call for a new FileBrowser I let it come up as small as possible (by clicking the left mouse button twice), not bothering to think about how big it is probably going to need to be. However, I do position the upper-left corner roughly where I want the resultant full-sized FileBrowser windows's upper-left corner to be. ("Tacking" the upper-left corner is the initial default. See INTERNALS below for more details.) When all the file information is available, the window resizes so as to display the maximum amount of information. One could always manually resize the window, but I hardly ever do that anymore, except to resize a FileBrowser to the smallest size possible just before I recompute its contents, so the recomputation takes place without very much screen activity. Once all the information is again available, the window pops open to its maximal size, thereby announcing the recomputation is completed. If one does resize a FileBrowser manually, one can always select the "Size to Fit"FileBrowser menu item to force a maximal resizing. If the window is already maximally sized for the information available, the window merely blinks. This is to indicate that the resizing was computed and found to not require any change in size, while avoiding the lengthy repainting of the contents of the FileBrowser's window which would occur if the FileBrowser were actually reshaped to the same size. INTERNALS Primary access is provided by the following function: (FB.RESIZE.TO.FIT BROWSER) [Function] This function is called when the FileBrowser Menu item "Size to Fit" is selected. It is also included in the advice on FB.UPDATEBROWSERITEMS to allow for automatic resizing. The user generally would have no need to use this function directly. FB.RESIZE.TO.FIT.OK [Variable] This global flag controls the activity of automatic resizing across all FileBrowsers. It can be controlled by pulling out the "Size to Fit" FileBrowser menu item's "ON" or "OFF" submenu item all the way to the right. The user generally would have no need to manipulate this variable directly. (WINDOWPROP BROWSERWINDOW 'DONT-RESIZE-FILEBROWSER) [Property] This property controls the activity of automatic resizing for each individual FileBrowser. This property can be controlled for individual FileBrowsers by using out the "Size to Fit" FileBrowser menu sub-items "ON" or "OFF". If it is not defined (the default) or NIL, then this FileBrowser can be automatically resized if the global flag, FB.RESIZE.TO.FIT.OK, is T. If this property is T, then this FileBrowser will not be automatically resized. It is stored on the main window of each FileBrowser, which can be obtained by using: (fetch (FILEBROWSER BROWSERWINDOW) of BROWSER) where BROWSER is the browser in question, as passed as the argument to the function called when a FileBrowser menu item is selected. (The record definitions from the Lisp Library files TABLEBROWSERDECLS and FILEBROWSER are required in order to use this fetch expression. See below.) The user generally would have no need to manipulate this property directly. FB.RESIZE.TO.FIT.TACK.TOP [Variable] FB.RESIZE.TO.FIT.TACK.LEFT [Variable] These two variables (both initially T) control the "tacking" behavior of the resizing. The corner specified by the values of these two variable indicates which corner of the current position of the FileBrowser window should remain where it is (i.e. tacked) when the window is resized. If doing this would cause some part of the new FileBrowser's window to be off the screen, this "tacked" corner is moved so that all the new window's contents are visible on the screen. These are set to T via INITVARS, therefore the user can set/change these variables either before or after this module is loaded. f In order to edit/compile the source of this module, the Lisp Library files TABLEBROWSERDECLS and FILEBROWSER must be loaded in order to provide the record definitions used by the TableBrowser and FileBrowser internals. The loading of this two source files occurs automatically when this module's source file is loaded. f Automatic resizing does not occur when a FileBrowser is sorted or expunged. (One can expunge files by first marking them for deletion and then doing a Recompute (instead of an Expunge), followed by selecting "Expunge deleted files" from the menu that pops up. In this way you are sure the FileBrowser is totally up-to-date (since it gets recomputed after the expunging) and it resizes to fit as well. If don't want to spend the time recomputing the FileBrowser but still want the window resized, you can select Expunge and then immediately select "Size to Fit". The "Size to Fit" request will be remembered (assuming the "Size to Fit" menu item blinks) and the FileBrowser will resize once the expunging is completed.) f This module makes no use of Lyric-only features and therefore also works in Koto. (LIST ((PAGE NIL (PAPERSIZE LETTER STARTINGPAGE# 228) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO NIL) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL (PAPERSIZE NIL . LETTER) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO NIL) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL (PAPERSIZE NIL . LETTER) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO NIL) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL)))))(. ((8(8D PAGEHEADING RUNNINGHEADTERMINAL  HELVETICA MODERN MODERN MODERN MODERNMODERN LOGO HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN J$* 2  6  ' ' 4f  [C)7 0Tjz