README File for STP's Personal Favorite Smalltalk-80 FileIns (Version 9.0 Beta) Stephen Travis Pope, stp@CNMAT.Berkeley.edu LastEditDate: 1995.04.09 Hello, This directory contains various extensions to the ParcPlace Systems Smalltalk-80 system and tool-set that I've developed in the course of over 10 years of using the system. Many of these "goodies" are very old, and existed at Xerox PARC before ParcPlace even spun off. Others are newer, or were contributed to this "BagOfTricks" by other consultants (they are acknowledged by name below). This whole collection is being made available for free with NO GUARANTEES OR LIABILITY WHATSOEVER in the hope that various parts of it will be of use to neophites and "old hands" alike. Comments and contributions are invited. NOTE: This code has been tested on ParcPlace Systems's VisualWorks 2.0. No claims are made as to its portability to other versions or dialects. If you want to file these "goodies" in to look at them, READ and then file in the STPWorld.bld "build script" file. REMEMBER that you should either (a) file this into a "fresh" VisualWorks 2.0 virtual image or (b) FILE OUT YOUR CHANGES before filing in the STPWorld.bld file. Because I frequently move this stuff between UNIX, Macintosh and DOS machines, all the file names are terse (DOS 8+3 format) and upper-case. These files are categorized roughly by "area." The categories (sub-directories) are: SYSTEM System class extensions L_AND_F Look-and-feel changes TOOLS New and extended tools TOYS Toys, demos, etc. MISC A few miscellaneous text files--build scripts DOCS Some misc documents from the net Files in the Top-level Directory ======================================= README This file; print it out and read it thoroughly before proceeding. ls-lR A UNIX-style recursive listing of the files in this distribution. STPWorld.bld A Smalltalk "build script" to construct my virtual image based on the source files found here. PLEASE READ THE README FILE AND THIS BUILD SCRIPT, before you attempt to file in the build script. You can edit this build script file to keep from filing in any of the goodies you don't want. When you file in the build script, it needs to know where the "STP9" directory is located (relative to where your VI is running). If it's not in a subdirectory named "STP9," you'll get a prompter asking where it is. STPMini.bld A Smalltalk "build script" to "file in" the bare minimum recommended stuff from this goodies package (a subset of the files in STPWorld.bld). Init.st A sample of the kind of start-up code that one does before executing the build script STPWorld.bld (just an example). Demo.t Some more comments and example code to demonstrate the groovy features of the system extensions. System ======================================= Behavior.st A useful behavior message: allSubInstances--returns all instances of all subclasses. Case.st Adds a case statement; a neat example, but don't use it too often. CharArray.st Adds many useful string crunching methods--stripTrailingSpaces, padTo:, clipTo:, breakIntoLinesOf:, stripCRs. cr. Collect.st Several useful collection extensions--second, third, etc., with:with:with:with:with:, etc. Color.st Adds a couple of useful and terse ColorValue creation messages. CurlyBr.st An example of a Scanner extension. this adds code so that curly-braces "{...}" can be used as nesting comment characters. (Dangerous because it changes the language!) This is not filed in by default. EditDate.st Adds the method "updateEditDate" to CharacterArray. If the receiver (string) includes a string like 'LastEditDate: 1994.12.2' then copy-replace everything between this key and the end of the line (or file) with today's date in European format (e.g., 1994.12.03). Answer the new string, or nil if the key is not found. Edit this method if you prefer a different key or date/time format. This file also arranges to do this whenever you save a file from the FileBrowser orParagraphEditor (unless is down). I find this *extremely* useful for text files--they're always time-stamped with the date of their last alteration. Extstr.st Code to support external I/O in floats, longs, etc. FNamMisc.st Adds a few new methods for file names--base, extension, etc. Printing.st A few modified printing methods: Time without seconds, Dates with leading 0's (e.g., 1995.04.08), and short-hand to print LimitedPrecisionReals with a given precision. SafeHalt.st Adds the method "safeHalt" to Object that's a "LeftShiftHack" of "self halt"--very useful (Barry's idea). UNIXProc.st Adds some useful short-hand methods to UNIXProcess. (More variations are possible.) Look-and-Feel ======================================= Colors.st This file changes the screen colors independents of the settings of the window system. First, it changes the method that gets the preferences to answser nil, then it sets the preferences by hand (edit this second method to taste), then it re-initializes the world. Decorate.st This is a version of the method BorderDecorationPolicy>>initialize that gets rid of menu bars and moves the scroll bars over to the left where they belong. Launcher.st This file changes the Visual launcher to include iconic buttons for the file editor and WireModel screen saver (in the "toys" directory in the file "3d-grafx.st"). It also changes the spacing of the other buttons and alters a couple of the icons. It is included as an example of how/where to do this. MotBord.st This changes the scroll bars and menus of the Motif look to be a bit more compact. NewMenu3.st This file adds neat hierarchical text menus to a few views. I prefer them (some others don't; it's a matter of taste). This assumes the paragraph editor extensions and new fonts added above. This is quite useful if you use function keys for most common functions, and a real pain in the neck otherwise. Par_Edit.st This file extends the text editor (ParagraphEditor class) in many ways. It adds string search, line-wrapping, spelling (on UNIX platforms only), goto-line, and other functions. It deepens the left-shift paste buffer to 16 places, and redefines the cursor arrow keys so that -cursorKey moves the caret in units of "words" and -cursorKey extends the current selection in any direction--try it out! is altered so that means forward-delete. The file also adds several new initialization methods that (1) map the left-hand function keys of a SPARC keyboard (or the top row function keys of SGI or IBM keyboards) for again/undo/copy/paste/cut, (2) adds "alt" commands for Macintosh-style copy/cut/paste ("alt" is "command" on the Mac), and (3) adds control keys such as: ^a = accept ^z = cancel ^d = do-it ^p = print-it ^q = inspect-it ^e = end-of-line ^r = start-of-line ^x = transpose-chars F1 = change-case F2 = Capitalize-first-letter ESC-ESC = select current type-in etc., etc. Users are encouraged to extend or modify this to suit their own favorite habits or keyboards. To see the mapping of the keys, say "ParagraphEditor dumpTable" and look in the Transcript. See also the do-it code at the end of the build script file to see how to initialize this. Scrollbu.st This adds both up and down buttons to the top and bottoms of default look scroll bars. SlowScrl.st This file puts a delay in the scrolling loop for most up/down scroll buttons (the buttons found at the top/bottoms of scroll bars). The delay can be initialized (in the initialize methods of the various BorderDecorationPolicy subclasses) so that "smooth" scrolling is a bit slower on fast machines. Change the delay value in the appropriate initialize method for faster or slower scrolling. SmalList.st A change to a smaller-than-default serif font for lists. This assumes that the text attributes changes in the file TextAttr.st have been filed in. TextAttr.st This file changes the font mechanism to support more fonts and font menus. One can now change the global font size with a message-send (e.g., TextAttributes defaultSize: 16), so that applications can automatically adapt themselves to the size of the screen. Please read it and edit to your personal taste. After filing this in, the normal, small set of pre-defined TextAttributes is enlarged to include tiny, small, normal, large, huge, and demo sizes in serif, sans-serif, and fixed-pitch typefaces. Look at the font menu and examples in the file demo.t. Tools ======================================= ClsDescr.st This file extends the browser's class description to include an inheritance comment that says what instance variables are inherited. I don't remember where I found this. Demo-Not.st A MODEExampleBook is a simple notebook editor application. It stores a TextBook (an ordered collection of named texts) as its contents, and has methods for viewing, executing text on book pages and for editing the structure of the book. It can also read text books from BOSS files and store them as BOSS or ASCII. The file MODEBOOK.BOS is an example of a BOSS'ed-out book. FBrowser.st A new file list browser that sorts files to put directories first and adds auto-enter capacity (to change to a directory as soon as you select it). It also adds the "pop" menu item in the pattern view to pop up one level in the file hierarchy, and "recent" that maintains a list of recently-visited files and allows you to select from them. Note that this file assumes you've already loaded ViewComp.st (see below). This assumes that the view-resizing code (see below) has been filed in. FileDlog.st A FilenameDialog brings up a pop-up list where the user can select directories and files. This file also changes a few methods to use the file name dialog when opening a file editor or reading in a changes file. To test this, execute "FilenameDialog getFilename." ItalComm.st This file changes the format for method printing in the browser and debugger so that comments are underlined (or italicized, or bolded, at your choice). I believe this makes them easier to locate within large methods. MBrowser.st Adds "browse class" and "do it" menu item to the method list browser. This is useful on class example methods. PBrowser.st This is an extension of the standard system browser that breaks class categories up into a two-level hierarchy based on hyphens in their names. This means there are 5 list views along the top of the browser, the first of which is called the "package". This tools is also known as the 6-paned browser, and exists in many versions. This assumes that the view-resizing code (see below) has been filed in. Publish.st A useful extension so that saying "Class_name publish" creates instance variable accessing methods automatically. This is quite redundant with the VisualWorks CodingAssistant tool, but I find this way easier. ViewComp.st This file adds the functionality to views that their subviews can be resized. If you use ViewWithResizableSubviews instead of CompositeView in your views, you can use view button (right-button) to "drag" the view's internal borders. See ResizingController's class comment. This is based on code from Marcel Schelvis. Note that this works only on "old" MVC applications that used CompositeViews, rather than "new" VisualWorks applications that use ReComposingComposites. These "old" applications, however, include all the development tools. ViewOpen.st This file changes most of the system's view class open methods to use ViewWithResizableSubviews rather than CompositeView (so only file it in after ViewComp.st). Note that this is dangerous and may conflict with other changes you may have made. It also adds a "skip to caret" button o the Debugger. Toys ======================================= 3D-Grafx.st 3-D WireFrame models and Transformations for 3-D rendering. This has really neat demos in the class WireFrame. This requires the code in ZPoint.st and Random.st to work. The original version came from Hans-Martin Mosner. After filing this in, say "WireModel screenSaver." Clocks.st Simple analog and digital clocks. Holding down the shift key while opening them makes them update every second; otherwise the update every minute. There is also code th put the date and time in the title of the launcher window and update it every minute. Random.st A few new messages for generating random numbers in limited ranges, or selecting from collections at random. S_Savers.st This file adds two nice screen savers: a bouncing logo and random splines. I place the spline screen saver on the launcher menu (together with the wire model example). This is less useful on MS-Windows and the Mac because I can't open a window that covers the entire screen without a menu bar showing. ZPoint.st 3-D points, i.e., one can say 3@4@7. Docs ======================================= This directory has four Smalltalk-related documents taken from the Internet: (1) the Smalltalk FAQ (Answers to Frequently Asked Questions) maintained by Craig Latta and found in xcf.berkeley.edu:/pub/misc/smalltalk/FAQ/FAQ.txt (there's also a version there in html); (2) Ralph Johnson's list of "classic" Smalltalk bugs, found in st.cs.uiuc.edu:/pub/st-docs/classic-bugs; (3) a note on the relative performance of Smalltalk and C++; and (4) a comparison of smalltalk and C++ by Douglas R. Krueger. Misc ======================================= This directory contains examples of configuration management for a large application. It includes the "build script" and "file-out script" for the MODE Musical Object Development Environment by STP. See the README file in this directory. Known Bugs ======================================= (1) The color-changing code has been reported not to work on MS-Windows. (2) The FilaDialog is sometimes wierd about accepting typed-in input followed by --you might have to use the "accept" menu item. (3) The new FileBrowser sometimes cannot "pop" up to a higher-level directory. I'm sure there are more; please send me fixes if you stumble across them! For more information, read and walk through the example file demo.t