Received: by ATHENA-PO-2.MIT.EDU (5.45/4.7) id AA03192; Tue, 13 Dec 88 20:08:45 EST
Received: by ATHENA.MIT.EDU (5.45/4.7) id AA06452; Tue, 13 Dec 88 20:08:33 EST
Received: by media-lab.media.mit.edu (5.59/4.8)  id AA08709; Tue, 13 Dec 88 19:56:29 EST
Date: Tue, 13 Dec 88 19:56:29 EST
From: Brian Gardner <brian@media-lab.media.mit.edu>
Message-Id: <8812140056.AA08709@media-lab.media.mit.edu>
To: bgardner@ATHENA.MIT.EDU
Subject: badlisp.doc



        ------------------------------------------
                      change-do
        -----------------------------------------

change-do (window func parms &key (fname "nil") (button "nil"))

  where:
	window	-> window name (string) 
	func	-> function to be bound to window (string) 
	parms   -> parameters to <func> (string)

	&key 
	    (fname "nil") -> name of the LISP function to do (string)
	    (button "nil")) -> button event to invoke new <func> (string)

  description:
	There are four button events, each of which has a "do function"
	associated with it.  The function "change-do" reassigns a button
	event to perform a new function.  
	Changes the dofunction of <window> to a function <func> that uses the 
	parameters <parms>. All parameters are strings that refer to previously
	defined window objects.

  example:
  (change-do ROOT "DoLisp" "pointer" :button "JUSTDOWN")


        ------------------------------------------
                      change-string
        ------------------------------------------

change-string (name string &optional (filename nil))

  where:
	 name    -> window name (string)
	 string	 -> string which is drawn in window (string)
	 &optional
		 (filename nil) -> name of text file who's contents is drawn
		   		   in window (string)

  description:
	Function to change the string which may be drawn in a particular
	window.

	NOTE:  Effects of this function do not occur until the window
	       is reopened.  (If window is already open, it must be closed
	       first!)
  example:
   (change-string "our-output-window" str)


        ------------------------------------------
                      clipped-string-draw
        ------------------------------------------

clipped-string-draw (name font string leading word-sp char-sp 
				 red green blue filename)
  where:
	name     -> window name (string)
	font     -> bitstream font number (string)
	string	 -> string which is drawn in window (string)
	leading  -> line-spacing (integer -- 0 for default value)
	word-sp  -> word-spacing (integer -- 0 for default value)
	char-sp  -> character-spacing (integer -- 0 for default value)
	red   	 -> text color -- red component (integer 0 - 255)
	green    -> text color -- green component (integer 0 - 255)
	blue     -> text color -- blue component (integer 0 - 255)
	filename -> name of text file who's contents is drawn
		    in window (string)

  description:
	One draw-function can be associated with a particular window.
	This function changes the draw function of a previously defined
	window refered to by the string <name> to a function that draws
	the string <string> to that window. 

	NOTE:  This function would not normally be called from an
	       application program -- for internal use only.

  example:
  (clipped-string-draw "our-output-window" "24x8" str 0 0 0 255 255 255 nil)


        ------------------------------------------
                      install-window
        ------------------------------------------

install-window (window)

  where:
	window -> window name (string)	


  description:
	Adds the window refered to by the string <window> to the window 
	structure without displaying it.

  example:
	(install-window "our-break-window")



        ------------------------------------------
                      get-string
        ------------------------------------------

get-string (name)
  where:
	name   -> window name (string)

  description:
	See description of "make-get-string-win"
	This function returns a list of strings typed in.
	(example: if you type "some thing", it returns ("some" "thing") )
	Macros for manipulating returned list will be available soon.

  example:
	(get-string "our-prompt-window")



        ------------------------------------------
                      make-get-string-win 
        ------------------------------------------

make-get-string-win (name parent x y width height
	fr fg fb shadow border br bg bb
	font leading word-sp char-sp r g b)

  where:
	name   -> window name (string)
	parent -> parent window (string)
	x      -> upper left x (integer 0 - 1279)
	y      -> upper left y (integer 0 - 1023)
	width  -> window width (integer)
	height -> window height (integer)
	fr     -> window foreground color -- red component (integer 0 - 255)
	fg     -> window foreground color -- green component (integer 0 - 255)
	fb     -> window foreground color -- blue component (integer 0 - 255)
	shadow -> shadow width (integer)
	border -> border width (integer)
	br     -> border color -- red component (integer 0 - 255)
	bg     -> border color -- green component (integer 0 - 255)
	bb     -> border color -- blue component (integer 0 - 255) 
	font    -> bitstream font number (string)
	leading -> line-spacing (integer -- 0 for default value)
	word-sp -> word-spacing (integer -- 0 for default value)
	char-sp -> character-spacing (integer -- 0 for default value)
	r   	-> text color -- red component (integer 0 - 255)
	g  	-> text color -- green component (integer 0 - 255)
	b   	-> text color -- blue component (integer 0 - 255)

  description:
	Create window for textual input. You have to use "get-string"
	to open the window <window> and to enable typing.

	NOTE:  This type of window should not be rectified (or given any
	       other draw-function) since it will be automatically 
	       created with its own special draw-function.
	       

  example:
    (make-get-string-win "our-prompt-window" "Root" 100 100 150 30
                                 254 254 254 2 1 3 3 3
                                          "24x8" 0 0 0 0 0 0)



        ------------------------------------------
                      make-window
        ------------------------------------------

make-window (name parent x y width height doc)

  where:
	name   -> window name (string)
	parent -> parent window (string)
	x      -> upper left x (integer 0 - 1279)
	y      -> upper left y (integer 0 - 1023)
	width  -> window width (integer)
	height -> window height (integer)
  	doc    -> documentation string (string)

  description:
	Make a general window.

	NOTE:  This only allocates a specific area for the window. To
	       display window, you must first give it a draw function,
	       install it, and then open it (either directly or by opening
	       one of its ancestors).

  example:
    (make-window "our-prompt-window" "Root" 100 100 150 30 "our-prompt-window")


        ------------------------------------------
                      move-self
        ------------------------------------------

move-self (window echo)

  where:
	window -> window name (string)
	echo   -> type of cursor (string)

  description:
	Function which changes the do-function of the window <window> to
	move itself.

  example:
	(move-self "our-prompt-window" "pointer")


        ------------------------------------------
                      rectify
        ------------------------------------------

rectify (window fgr-red fgr-green fgr-blue 
		       bgr-red bgr-green bgr-blue width border)

  where:
	window    -> window name (string)
	fgr-red   -> window foreground color --
			    red component (integer 0 - 255) 
	fgr-green -> window foreground color --
			    green component (integer 0 - 255) 
	fgr-blue  -> window foreground color -- 
	                    blue component (integer 0 - 255)
	bgr-red   -> window background color --
                            red component (integer 0 - 255) 
	bgr-green -> window background color --
			    green component (integer 0 - 255) 
	bgr-blue  -> window background color -- 
               		    blue component (integer 0 - 255) 
	width     -> shadow width (integer)
	border    -> border width (integer)

  description:
	One draw-function can be associated with a particular window.
	This function changes the draw function of a previously defined
	window refered to by the string <name> to a function that draws
	a shadowed rectangle.

  example:
  	(rectify "our-break-window" 200 0 200 0 0 0 0 0)


        ------------------------------------------
                       report-window
        ------------------------------------------

report-window (window)

  where:
	window   -> window name (string)

  description:
	Function which reports the (x, y) position of the upper
	left corner of the window <window> (relative to its parent), 
	and the width and height of window <window>.

	NOTE:  This returns a list of four elements.  The macros
	       "window-x", "window-y", "window-width", and
	       "window-height" can be used to extract the appropriate
	       element from this list.

  example:
	(report-window "our-break-window")


        ------------------------------------------
                           resizer
        ------------------------------------------

resizer (window resize-window echo)

  where:
	window        -> name of window to give resize do-function (string)
	resize-window -> name of window to be resized (string)
	echo          -> cursor type (string)

  description:
	Function which changes the do-function of window <window>
	to be the resize function.

  example:
	(resizer "our-break-window" "our-break-window" "pointer")


        ------------------------------------------
                           wimp
        ------------------------------------------

wimp (window)

  where:
	Window   -> Name of window (string)

  description:
	Function which redirects the do-function for window <window>
	to be the do-function of the window directly underneath it.

  example:
	(wimp "our-break-window")
