original commit: ad1b5fd375b0df06d58375f26b44b1eb0b755dac
This commit is contained in:
Robby Findler 1999-02-15 22:18:00 +00:00
parent 71a0132b23
commit 619a4e70e3
5 changed files with 24 additions and 15 deletions

View File

@ -450,13 +450,12 @@
[bottom-panel (make-object horizontal-panel% main-panel)] [bottom-panel (make-object horizontal-panel% main-panel)]
[directory-field [directory-field
(make-object text-field% (make-object text-field%
"Full pathname" "Full pathname"
directory-panel directory-panel
(lambda (evt txt) (lambda (txt evt)
(when (eq? (send evt get-type) 'text-enter) (when (eq? (send evt get-event-type) 'text-field-enter)
(do-ok))))] (do-ok))))]
[result-list [result-list

View File

@ -105,7 +105,9 @@
(send (get-editor) on-close))] (send (get-editor) on-close))]
[get-area-container% (lambda () panel:vertical-editor%)]) [get-area-container% (lambda () panel:vertical-editor%)])
(private (private
[label file-name] [label (let-values ([(base name dir?) (split-path file-name)])
(or name
file-name))]
[label-prefix (application:current-app-name)] [label-prefix (application:current-app-name)]
[do-label [do-label
(lambda () (lambda ()

View File

@ -87,7 +87,7 @@
(opt-lambda (filename (opt-lambda (filename
[make-default [make-default
(lambda () (lambda ()
(make-object frame:text-info-file% filename))]) (send (make-object frame:text-info-file% filename) show #t))])
(gui-utils:show-busy-cursor (gui-utils:show-busy-cursor
(lambda () (lambda ()
(if filename (if filename

View File

@ -89,11 +89,9 @@
tmp-file-name)]) tmp-file-name)])
(test (test
name name
(lambda (x) (lambda (x)
(delete-file tmp-file) (delete-file tmp-file)
(equal? x test-file-contents)) (equal? x test-file-contents))
(lambda () (lambda ()
(send-sexp-to-mred (send-sexp-to-mred
`(begin `(begin
@ -103,20 +101,31 @@
(send-sexp-to-mred (send-sexp-to-mred
`(test:menu-select "File" "Open...")) `(test:menu-select "File" "Open..."))
(wait-for-frame "Get file") (wait-for-frame "Get file")
(call-with-output-file tmp-file-name (call-with-output-file tmp-file
(lambda (port) (lambda (port)
(display test-file-contents port)) (display test-file-contents port))
'truncate) 'truncate)
(send-sexp-to-mred (send-sexp-to-mred
`(begin (send (find-labelled-window "Full pathname") focus) `(begin (send (find-labelled-window "Full pathname") focus)
,(case (system-type)
[(macos unix) `(test:keystroke #\a '(meta))]
[(windows) `(test:keystroke #\a '(control))]
[else (error "unknown system type")])
(for-each test:keystroke (for-each test:keystroke
(string->list ,tmp-file)) (string->list ,tmp-file))
(test:keystroke #\return))) (test:keystroke #\return)))
(wait-for-frame (format "framework - ~a" tmp-file-name)) (wait-for-frame tmp-file-name)
(begin0
(send-sexp-to-mred (send-sexp-to-mred
`(let* ([w (get-top-level-focus-window)] `(let* ([w (get-top-level-focus-window)]
[t (send (send w get-editor) get-text)]) [t (send (send w get-editor) get-text)])
(test:close-window w) (test:close-top-level-window w)
t)))))) t))
(wait-for-frame "test open")
(send-sexp-to-mred
`(test:close-top-level-window (get-top-level-focus-window))))))))
(test-open "frame:editor open" 'frame:text%) (test-open "frame:editor open" 'frame:text%)
(test-open "frame:editor open" 'frame:searchable%)
(test-open "frame:editor open" 'frame:text-info%)
(test-open "frame:editor open" 'frame:text-info-file%)

View File

@ -207,7 +207,6 @@
(define (wait-for-frame name) (define (wait-for-frame name)
(wait-for `(let ([win (get-top-level-focus-window)]) (wait-for `(let ([win (get-top-level-focus-window)])
(printf "name: ~a~n" (and win (box (send win get-label))))
(and win (string=? (send win get-label) ,name))))))) (and win (string=? (send win get-label) ,name)))))))
(define Engine (define Engine