original commit: 8073fed7691153883d2d46f1d404c40cbbb47c1c
This commit is contained in:
Robby Findler 2002-06-25 18:43:27 +00:00
parent de52b148a2
commit d970b7734a
3 changed files with 40 additions and 3 deletions

View File

@ -152,7 +152,7 @@
"Anyway\"}. The result symbol indicates the user's choice. If"
"\\var{can-save-now?} is \\rawscm{\\#f}, this function does not"
"give the user the ``Save'' option and thus will not return"
"\rawscm{'save}.")
"\\rawscm{'save}.")
(gui-utils:get-choice
(opt->
@ -178,7 +178,7 @@
"clicks on \\var{false-choice}, \\rawscm{\\#f} is returned."
""
"The argument \\var{default-result} determines how closing the window is"
"treated. If the argument is \rawscm{'disallow-close}, closing the window"
"treated. If the argument is \\rawscm{'disallow-close}, closing the window"
"is not allowed. If it is anything else, that value is returned when"
"the user closes the window."
""

View File

@ -319,7 +319,7 @@
(lambda (name)
(let ([filename (if name
(file-name-from-path (normalize-path name))
"")])
(gui-utils:next-untitled-name))])
(for-each (lambda (canvas)
(let ([tlw (send canvas get-top-level-window)])
(when (and (is-a? tlw frame:editor<%>)

View File

@ -878,6 +878,43 @@
(define open-here-mixin
(mixin (-editor<%>) (open-here<%>)
(rename [super-file-menu:new-on-demand file-menu:new-on-demand])
(define/override (file-menu:new-on-demand item)
(super-file-menu:new-on-demand item)
(send item set-label (if (preferences:get 'framework:open-here?)
(string-constant new-...-menu-item)
(string-constant new-menu-item))))
(rename [super-file-menu:new-callback file-menu:new-callback])
(define/override (file-menu:new-callback item event)
(cond
[(preferences:get 'framework:open-here?)
(let ([clear-current (ask-about-new-here)])
(cond
[(eq? clear-current 'cancel) (void)]
[clear-current
(let ([editor (get-editor)])
(send editor begin-edit-sequence)
(send editor set-filename #f)
(send editor erase)
(send editor set-modified #f)
(send editor end-edit-sequence))]
[else (super-file-menu:new-callback item event)]))]
[else (super-file-menu:new-callback item event)]))
;; ask-about-new-here : -> (union 'cancel boolean?)
;; prompts the user about creating a new window
;; or "reusing" the current one.
(define/private (ask-about-new-here)
(gui-utils:get-choice
(string-constant create-new-window-or-clear-current)
(string-constant clear-current)
(string-constant new-window)
(string-constant drscheme)
'cancel
this))
(rename [super-file-menu:open-on-demand file-menu:open-on-demand])
(define/override (file-menu:open-on-demand item)
(super-file-menu:open-on-demand item)