diff --git a/collects/teachpack/htdp/Docs/arrow-gui.scrbl b/collects/teachpack/htdp/Docs/arrow-gui.scrbl new file mode 100644 index 0000000000..d80d71c3a5 --- /dev/null +++ b/collects/teachpack/htdp/Docs/arrow-gui.scrbl @@ -0,0 +1,45 @@ +#lang scribble/doc + +@(require scribble/manual + (for-label scheme + teachpack/htdp/arrow-gui)) + +@title[#:tag "arrow-gui"]{An Arrow GUI: arrow-gui.ss} + +@declare-exporting[teachpack/htdp/arrow-gui] + +The teachpack provides operations for creating and manipulating an arrow +GUI. We recommend using the @seclink["world"]{world teachpack} instead. + +@deftech{modelT} @scheme[(-> button% event% true)] + +A @tech{modelT} is a function that accepts and ignores two arguments. + +@defproc[(control) symbol?]{Reads out the current state of the message +field.} + +@defproc[(view [s (or/c string? symbol?)]) true]{Displays @scheme[s] in the +message field.} + +@defproc[(connect [l (unsyntax @tech{modelT})][r (unsyntax @tech{modelT})][u (unsyntax @tech{modelT})][d (unsyntax @tech{modelT})]) true]{Connects four +controllers with the four directions in the arrow window.} + +Example: +@(begin +#reader scribble/comment-reader +(schemeblock +;; Advanced +(define (make-model dir) + (lambda (b e) + (begin + (view dir) + (printf "~a ~n" (control))))) + +(connect + (make-model "left") + (make-model "right") + (make-model "up") + (make-model "down")) +)) +Now click on the four arrows. The message field contains the current +direction, the print-out the prior contents of the message field. diff --git a/collects/teachpack/htdp/Docs/arrow-gui.thtml b/collects/teachpack/htdp/Docs/arrow-gui.thtml deleted file mode 100644 index 2874dff8e1..0000000000 --- a/collects/teachpack/htdp/Docs/arrow-gui.thtml +++ /dev/null @@ -1,34 +0,0 @@ -{ (define LIBNAME "Arrows GUI") - (include "head.tinc") } - -
The teachpack arrow-gui.ss
implements three functions:
-
Example: -
-> (define (make-model dir) - (lambda (b e) - (begin - (view dir) - (printf "~a ~n" (control))))) - -> (connect - (make-model "left") - (make-model "right") - (make-model "up") - (make-model "down")) --Now click on the four arrows. The message field will contain the current -direction, the print-out the prior contents of the message field. - -{(include "foot.tinc")} diff --git a/collects/teachpack/htdp/Docs/convert.scrbl b/collects/teachpack/htdp/Docs/convert.scrbl index b7e74779b5..8ccd4ba6ed 100644 --- a/collects/teachpack/htdp/Docs/convert.scrbl +++ b/collects/teachpack/htdp/Docs/convert.scrbl @@ -4,7 +4,7 @@ (for-label scheme teachpack/htdp/convert)) -@title[#:tag "convert"]{Converting Temperaturs: convert.ss} +@title[#:tag "convert"]{Converting Temperatures: convert.ss} @declare-exporting[teachpack/htdp/convert] diff --git a/collects/teachpack/htdp/Docs/dir.scrbl b/collects/teachpack/htdp/Docs/dir.scrbl new file mode 100644 index 0000000000..172444c581 --- /dev/null +++ b/collects/teachpack/htdp/Docs/dir.scrbl @@ -0,0 +1,41 @@ +#lang scribble/doc + +@(require scribble/manual + (for-label (except-in scheme/base file-size) + teachpack/htdp/dir)) + +@title[#:tag "dir"]{Working with Files and Directories: dir.ss} + +@declare-exporting[teachpack/htdp/dir] + +The teachpack provides structures and operations for working with files and +directories: + +@defstruct[dir ([name string?][dirs (list-of dir?)][files (list-of file?)])]{} + +@defstruct[file ([name string?][content (list-of char?)])]{} + +@defproc[(create-dir [path string?]) dir?]{ + Turns the directory found at @scheme[path] on your computer into an instance of @scheme[dir?].} + +Sample: Set teachpack to
dir.ss
and click RUN:
+@(begin
+#reader scribble/comment-reader
+(schemeblock
+> (create-dir ".")
+(make-dir
+ '|.|
+ empty
+ (cons (make-file 'ball1.gif 1289 empty)
+ (cons (make-file 'blueball.gif 205 empty)
+ (cons (make-file 'greenbal.gif 204 empty)
+ (cons (make-file 'redball.gif 203 empty)
+ (cons (make-file 'ufo.gif 1044 empty)
+ (cons (make-file 'gif-test.ss 5811 empty)
+ empty)))))))
+))
+Using ``.'' usually means the directory in which your program is
+located. In this case, the directory contains no sub-directories and six
+files.
+
+Note: Softlinks are always treated as if they were empty files.
diff --git a/collects/teachpack/htdp/Docs/dir.thtml b/collects/teachpack/htdp/Docs/dir.thtml
deleted file mode 100644
index 8ff9259cdf..0000000000
--- a/collects/teachpack/htdp/Docs/dir.thtml
+++ /dev/null
@@ -1,41 +0,0 @@
-{ (define LIBNAME "Directories")
- (include "head.tinc") }
-
-The teachpack dir.ss
provides two-structures and one
-operation:
-
The teachpack relies on two data definitions: -
- -Sample: Set teachpack todir.ss
and execute. Then evaluate
--> (create-dir ".") -(make-dir - '|.| - empty - (cons (make-file 'ball1.gif 1289 empty) - (cons (make-file 'blueball.gif 205 empty) - (cons (make-file 'greenbal.gif 204 empty) - (cons (make-file 'redball.gif 203 empty) - (cons (make-file 'ufo.gif 1044 empty) - (cons (make-file 'gif-test.ss 5811 empty) - empty))))))) -- -
Note: Softlinks are always treated as if they were empty files.
-
-{(include "foot.tinc")}
diff --git a/collects/teachpack/htdp/Docs/graphing.scrbl b/collects/teachpack/htdp/Docs/graphing.scrbl
new file mode 100644
index 0000000000..93112856e8
--- /dev/null
+++ b/collects/teachpack/htdp/Docs/graphing.scrbl
@@ -0,0 +1,23 @@
+#lang scribble/doc
+
+@(require scribble/manual
+ (for-label scheme
+ teachpack/htdp/graphing))
+
+@title[#:tag "graphing"]{Graphing Functions: graphing.ss}
+
+@declare-exporting[teachpack/htdp/graphing]
+
+The teachpack provides two operations for graphing functions in the regular
+(upper right) quadrant of the Cartesian plane (between 0 and 10 in both
+directions):
+
+@defproc[(graph-fun [f (-> number? number?)][color symbol?]) true]{
+Draws the graph of @scheme[f] with the given @scheme[color].}
+
+@defproc[(graph-line [line (-> number? number?)][color symbol?]) true]{
+Draws @scheme[line], a function representing a straight line, with a given
+color.}
+
+For color symbols, see @secref{draw}.
+
diff --git a/collects/teachpack/htdp/Docs/graphing.thtml b/collects/teachpack/htdp/Docs/graphing.thtml
deleted file mode 100644
index c1eeac03cb..0000000000
--- a/collects/teachpack/htdp/Docs/graphing.thtml
+++ /dev/null
@@ -1,18 +0,0 @@
-{ (define LIBNAME "Graphing Functions")
- (include "head.tinc") }
-
-The teachpack graphing.ss
provides two operations for
-graphing functions in the regular (north-east) quadrant of the Cartesian
-plane (between 0 and 10 in both directions):
-graphics functions:
-
The teachpack gui.ss
provides the following operations:
-
Example 1: -
-> (define w (create-window (list (list (make-button "QUIT" (lambda (e) (hide-window w))))))) --A button appears on the screen. Click on the button and it will disappear. -
-> (show-window w) --The frame reappears. - -
Example 2: -
-; text1 : GUI-ITEM -(define text1 - (make-text "Please enter your name")) - -; msg1 : GUI-ITEM -(define msg1 - (make-message (string-append "Hello, World" (make-string 33 #\SPACE)))) - -; Event -> true -; draws the current contents of text1 into msg1, prepended with "Hello, " -(define (respond e) - (draw-message msg1 (string-append "Hello, " (text-contents text1)))) - -; set up window with three "lines": a text field, a message, and two buttons -; fill in text and click OKAY -(define w - (create-window - (list - (list text1) - (list msg1) - (list (make-button "OKAY" respond) - (make-button "QUIT" (lambda (e) (hide-window w))))))) -- -{(include "foot.tinc")} diff --git a/collects/teachpack/htdp/Docs/htdp.scrbl b/collects/teachpack/htdp/Docs/htdp.scrbl index 7d984469ab..ad3c62aaa6 100644 --- a/collects/teachpack/htdp/Docs/htdp.scrbl +++ b/collects/teachpack/htdp/Docs/htdp.scrbl @@ -17,15 +17,14 @@ @include-section["hangman.scrbl"] @include-section["arrow.scrbl"] @include-section["docs.scrbl"] +@include-section["dir.scrbl"] +@include-section["graphing.scrbl"] +@include-section["gui.scrbl"] +@include-section["arrow-gui.scrbl"] -@;include-section["files-directories.scrbl"] -@;include-section["graphing.scrbl"] -@;include-section["gui.scrbl"] -@;include-section["lookup-gui.scrbl"] -@;include-section["arrows-gui.scrbl"] @;include-section["guess-gui.scrbl"] @;include-section["elevator.scrbl"] -@;include-section["Simplified Scheme Web Servlets" -@;include-section["Scheme Web Servlets" +@;include-section["Simplified Scheme Web Servlets"] +@;include-section["Scheme Web Servlets"] @;include-section["queen.scrbl"]