From d2f2856dc32c017ea45ae2eb9379d3e4f7da893d Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sat, 12 Sep 1998 18:38:06 +0000 Subject: [PATCH] . original commit: 9cf4ab5a9f724133a5283203ff9fe3f5ef16f56b --- collects/tests/mred/draw-info.txt | 11 +++++++++++ collects/tests/mred/draw.ss | 14 +++++++++++++- src/mred/wrap/mred.ss | 7 +++---- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/collects/tests/mred/draw-info.txt b/collects/tests/mred/draw-info.txt index 776e18ab..c01af50f 100644 --- a/collects/tests/mred/draw-info.txt +++ b/collects/tests/mred/draw-info.txt @@ -108,3 +108,14 @@ file. The "icons" and "stipple" boxes just enable those parts of the drawing. PostScript drawing of icons and stipples can be slow. + +---------- + +Finally, print these instructions by hitting the "Print" button at the +top of the window. The following lines are for the printing test; they +should wrap aroundneatly on the printed page. (Don't add any +newlines.) Check to make sure no lines are skipped or duplicated across +page breaks. Try different page orientations. + +0 1 2 3 4 5 6 7 8 9 X O T T F +012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 diff --git a/collects/tests/mred/draw.ss b/collects/tests/mred/draw.ss index dd6f6dce..b2f3e3bb 100644 --- a/collects/tests/mred/draw.ss +++ b/collects/tests/mred/draw.ss @@ -11,6 +11,18 @@ (define (get-icon) (make-object icon% (sys-path "mred.xbm") 'xbm)) +(define (show-instructions file) + (letrec ([f (make-object frame% file #f 400 400)] + [print (make-object button% "Print" f + (lambda (b ev) + (send e print)))] + [c (make-object editor-canvas% f)] + [e (make-object text%)]) + (send e load-file file) + (send e lock #t) + (send c set-editor e) + (send f show #t))) + (let* ([f (make-object frame% "Graphics Test" #f 300 450)] [vp (make-object vertical-panel% f)] [hp0 (make-object horizontal-panel% vp)] @@ -32,7 +44,7 @@ (send hp stretchable-height #f) (make-object button% "What Should I See?" hp0 (lambda (b e) - (send (send (edit-file (local-path "draw-info.txt")) get-edit) lock #t))) + (show-instructions (local-path "draw-info.txt")))) (let ([canvas (make-object (class canvas% args diff --git a/src/mred/wrap/mred.ss b/src/mred/wrap/mred.ss index eabcb6cb..ee0631ac 100644 --- a/src/mred/wrap/mred.ss +++ b/src/mred/wrap/mred.ss @@ -1408,8 +1408,8 @@ (lambda () (send child set-size (max 0 (+ x xm)) (max 0 (+ y ym)) - (max minw (- w (* 2 xm))) - (max minh (- h (* 2 ym))))) + (- (max minw w) (* 2 xm)) + (- (max minh h) (* 2 ym)))) (lambda () (set! ignore-redraw-request? #f))) (send child on-container-resize)))) childs @@ -1858,8 +1858,7 @@ (define (check-container-parent who p) (unless (is-a? p internal-container<%>) - (raise-type-error (string->symbol (constructor-name who)) - "built-in container<%> object" p))) + (raise-type-error (constructor-name who) "built-in container<%> object" p))) (define (check-top-level-parent/false who p) (unless (or (not p) (is-a? p frame%) (is-a? p dialog%))