diff --git a/collects/framework/private/frame.ss b/collects/framework/private/frame.ss index 1b96e48973..a7dea8f133 100644 --- a/collects/framework/private/frame.ss +++ b/collects/framework/private/frame.ss @@ -1673,7 +1673,6 @@ (define searchable<%> (interface (basic<%>) search search-replace - search-skip replace-all get-text-to-search @@ -1985,6 +1984,8 @@ (define searchable-mixin (mixin (standard-menus<%>) (searchable<%>) + (inherit edit-menu:get-show/hide-replace-item) + (define super-root 'unitiaialized-super-root) (define case-sensitive-search? (preferences:get 'framework:case-sensitive-search?)) @@ -2006,12 +2007,26 @@ #t) (define/override (edit-menu:create-find?) #t) - (define/override (edit-menu:find-again-callback menu evt) (search 'forward) #t) - (define/override (edit-menu:create-find-again?) #t) + (define/override (edit-menu:find-next-callback menu evt) (search 'forward) #t) + (define/override (edit-menu:create-find-next?) #t) - (define/override (edit-menu:find-again-backwards-callback menu evt) (search 'backward) #t) - (define/override (edit-menu:create-find-again-backwards?) #t) + (define/override (edit-menu:find-previous-callback menu evt) (search 'backward) #t) + (define/override (edit-menu:create-find-previous?) #t) + (define/override (edit-menu:create-show/hide-replace?) #t) + (define/override (edit-menu:show/hide-replace-callback a b) (set-replace-visible? (not replace-visible?))) + (define/override (edit-menu:show/hide-replace-string) + (if replace-visible? + (string-constant hide-replace-menu-item) + (string-constant show-replace-menu-item))) + (define/override (edit-menu:show/hide-replace-on-demand item) + (send item enable (not hidden?))) + + (define/override (edit-menu:replace-callback a b) (search-replace)) + (define/override (edit-menu:create-replace?) #t) + (define/override (edit-menu:replace-on-demand item) + (send item enable (and (not hidden?) replace-visible?))) + (define/override (edit-menu:find-case-sensitive-callback menu evt) (set! case-sensitive-search? (not case-sensitive-search?)) (preferences:set 'framework:case-sensitive-search? case-sensitive-search?) @@ -2100,10 +2115,7 @@ (unhide-search #f) (send find-edit search searching-direction #t)) - (define/public (search-replace) (skip/replace #t)) - (define/public (search-skip) (skip/replace #f)) - - (define/private (skip/replace replace?) + (define/public (search-replace) (let ([text-to-search (get-text-to-search)]) (when text-to-search (let ([replacee-start (send text-to-search get-replace-search-hit)]) @@ -2111,9 +2123,8 @@ (let ([replacee-end (+ replacee-start (send find-edit last-position))]) (send text-to-search begin-edit-sequence) (send text-to-search set-position replacee-end replacee-end) - (when replace? - (send text-to-search delete replacee-start replacee-end) - (copy-over replace-edit 0 (send replace-edit last-position) text-to-search replacee-start)) + (send text-to-search delete replacee-start replacee-end) + (copy-over replace-edit 0 (send replace-edit last-position) text-to-search replacee-start) (let ([str (send find-edit get-text)]) (send text-to-search set-searching-state (if (equal? str "") #f str) @@ -2123,18 +2134,18 @@ ;; if a relacement has happened. (send text-to-search get-start-position)) - ;; move the insertion point to the start of the editor if there are - ;; more replacements to do starting there + + ;; set the selection to the next place to replace (let-values ([(before-caret-hits hits) (send text-to-search get-search-hit-count)]) (unless (zero? hits) - (unless (send text-to-search get-replace-search-hit) - (send text-to-search set-position 0 0)))) + (unless (send text-to-search get-replace-search-hit) + (send text-to-search set-position 0 0)) + (let ([next-start (send text-to-search get-replace-search-hit)]) + (when next-start ;; this shouldn't ever matter ...? + (send text-to-search set-position next-start (+ next-start (send find-edit last-position))))))) (search-hits-changed)) (send text-to-search end-edit-sequence) - (let ([next-hit (send text-to-search get-replace-search-hit)]) - (when next-hit - (send text-to-search scroll-to-position next-hit))) #t)))))) (define/private (copy-over src-txt src-start src-end dest-txt dest-pos) @@ -2215,8 +2226,15 @@ (unless (equal? replace-visible? r?) (set! replace-visible? r?) (preferences:set 'framework:replace-visible? r?) + (show/hide-replace) + (send (edit-menu:get-show/hide-replace-item) set-label + (if replace-visible? + (string-constant hide-replace-menu-item) + (string-constant show-replace-menu-item))) (search-parameters-changed))) + (define show/hide-replace void) + (define/private (build-search-gui-in-frame) (unless search-gui-built? (set! search-gui-built? #t) @@ -2258,6 +2276,12 @@ [parent search-panel] [callback (λ (x y) (search 'forward))] [font small-control-font])) + (define search-prev-button (new button% + [label (string-constant search-previous)] + [vert-margin 0] + [parent search-panel] + [callback (λ (x y) (search 'backward))] + [font small-control-font])) (define hits-panel (new vertical-panel% [parent search-panel] @@ -2303,35 +2327,33 @@ [vert-margin 0] [parent replace-panel] [font small-control-font] - [callback (λ (x y) (search-skip))])) + [callback (λ (x y) (search 'forward))])) (define show-replace-button (new button% [label (string-constant search-show-replace)] [font small-control-font] - [callback (λ (a b) - (set-replace-visible? #t) - (show/hide-replace))] + [callback (λ (a b) (set-replace-visible? #t))] [parent replace-panel])) (define hide-replace-button (new button% [label (string-constant search-hide-replace)] [font small-control-font] - [callback (λ (a b) - (set-replace-visible? #f) - (show/hide-replace))] + [callback (λ (a b) (set-replace-visible? #f))] [parent replace-panel])) - (define (show/hide-replace) - (send replace-panel begin-container-sequence) - (cond - [replace-visible? - (send replace-panel change-children (λ (l) all-replace-children)) - (send replace-panel stretchable-width #t)] - [else - (send replace-panel change-children (λ (l) (list show-replace-button))) - (send replace-panel stretchable-width #f)]) - (send replace-panel end-container-sequence)) + (define stupid-internal-definitions-syntax2 + (set! show/hide-replace + (λ () + (send replace-panel begin-container-sequence) + (cond + [replace-visible? + (send replace-panel change-children (λ (l) all-replace-children)) + (send replace-panel stretchable-width #t)] + [else + (send replace-panel change-children (λ (l) (list show-replace-button))) + (send replace-panel stretchable-width #f)]) + (send replace-panel end-container-sequence)))) (define all-replace-children (list replace-canvas diff --git a/collects/framework/private/standard-menus-items.ss b/collects/framework/private/standard-menus-items.ss index 1728412d5a..05ae052766 100644 --- a/collects/framework/private/standard-menus-items.ss +++ b/collects/framework/private/standard-menus-items.ss @@ -360,37 +360,37 @@ edit-menu:edit-target-on-demand #f) - (make-an-item 'edit-menu 'find-again - '(string-constant find-again-info) + (make-an-item 'edit-menu 'find-next + '(string-constant find-next-info) '(λ (item control) (void)) #\g '(get-default-shortcut-prefix) - '(string-constant find-again-menu-item) + '(string-constant find-next-menu-item) edit-menu:edit-target-on-demand #f) - (make-an-item 'edit-menu 'find-again-backwards - '(string-constant find-again-backwards-info) + (make-an-item 'edit-menu 'find-previous + '(string-constant find-previous-info) '(λ (item control) (void)) #\g '(cons 'shift (get-default-shortcut-prefix)) - '(string-constant find-again-backwards-menu-item) + '(string-constant find-previous-menu-item) edit-menu:edit-target-on-demand #f) - (make-an-item 'edit-menu 'replace-and-find-again - '(string-constant replace-and-find-again-info) - '(λ (item control) (void)) - #\r - '(get-default-shortcut-prefix) - '(string-constant replace-and-find-again-menu-item) - edit-menu:edit-target-on-demand - #f) - (make-an-item 'edit-menu 'replace-and-find-again-backwards - '(string-constant replace-and-find-again-backwards-info) + (make-an-item 'edit-menu 'show/hide-replace + '(string-constant show/hide-replace-info) '(λ (item control) (void)) #\r '(cons 'shift (get-default-shortcut-prefix)) - '(string-constant replace-and-find-again-backwards-menu-item) - edit-menu:edit-target-on-demand + '(string-constant show-replace-menu-item) + on-demand-do-nothing + #f) + (make-an-item 'edit-menu 'replace + '(string-constant replace-info) + '(λ (item control) (void)) + #\r + '(get-default-shortcut-prefix) + '(string-constant replace-menu-item) + on-demand-do-nothing #f) (make-an-item 'edit-menu 'replace-all '(string-constant replace-all-info) @@ -398,7 +398,7 @@ #f '(get-default-shortcut-prefix) '(string-constant replace-all-menu-item) - edit-menu:edit-target-on-demand + on-demand-do-nothing #f) (make-a-checkable-item 'edit-menu 'find-case-sensitive diff --git a/collects/framework/private/standard-menus.ss b/collects/framework/private/standard-menus.ss index ef4de94284..a0999f6725 100644 --- a/collects/framework/private/standard-menus.ss +++ b/collects/framework/private/standard-menus.ss @@ -122,30 +122,30 @@ edit-menu:find-help-string edit-menu:find-on-demand edit-menu:create-find? - edit-menu:find-again-callback - edit-menu:get-find-again-item - edit-menu:find-again-string - edit-menu:find-again-help-string - edit-menu:find-again-on-demand - edit-menu:create-find-again? - edit-menu:find-again-backwards-callback - edit-menu:get-find-again-backwards-item - edit-menu:find-again-backwards-string - edit-menu:find-again-backwards-help-string - edit-menu:find-again-backwards-on-demand - edit-menu:create-find-again-backwards? - edit-menu:replace-and-find-again-callback - edit-menu:get-replace-and-find-again-item - edit-menu:replace-and-find-again-string - edit-menu:replace-and-find-again-help-string - edit-menu:replace-and-find-again-on-demand - edit-menu:create-replace-and-find-again? - edit-menu:replace-and-find-again-backwards-callback - edit-menu:get-replace-and-find-again-backwards-item - edit-menu:replace-and-find-again-backwards-string - edit-menu:replace-and-find-again-backwards-help-string - edit-menu:replace-and-find-again-backwards-on-demand - edit-menu:create-replace-and-find-again-backwards? + edit-menu:find-next-callback + edit-menu:get-find-next-item + edit-menu:find-next-string + edit-menu:find-next-help-string + edit-menu:find-next-on-demand + edit-menu:create-find-next? + edit-menu:find-previous-callback + edit-menu:get-find-previous-item + edit-menu:find-previous-string + edit-menu:find-previous-help-string + edit-menu:find-previous-on-demand + edit-menu:create-find-previous? + edit-menu:show/hide-replace-callback + edit-menu:get-show/hide-replace-item + edit-menu:show/hide-replace-string + edit-menu:show/hide-replace-help-string + edit-menu:show/hide-replace-on-demand + edit-menu:create-show/hide-replace? + edit-menu:replace-callback + edit-menu:get-replace-item + edit-menu:replace-string + edit-menu:replace-help-string + edit-menu:replace-on-demand + edit-menu:create-replace? edit-menu:replace-all-callback edit-menu:get-replace-all-item edit-menu:replace-all-string @@ -188,24 +188,35 @@ (when (is-a? menu menu:can-restore<%>) (if v (send menu restore-keybinding) (send menu set-shortcut #f))) (when (is-a? menu menu:can-restore-underscore<%>) - (if v (send menu restore-underscores) (send menu erase-underscores))) - (when (is-a? menu menu-item-container<%>) (for-each loop (send menu get-items))))))) + (if v + (send menu restore-underscores) + (send menu erase-underscores))) + (when (is-a? menu menu-item-container<%>) + (for-each loop (send menu get-items))))))) (inherit get-menu-bar show can-close? get-edit-target-object) - (define/augment on-close (λ () (remove-prefs-callback) (inner (void) on-close))) + (define/augment + on-close + (λ () (remove-prefs-callback) (inner (void) on-close))) (define/public get-menu% (λ () menu:can-restore-underscore-menu%)) (define/public get-menu-item% (λ () menu:can-restore-menu-item%)) - (define/public get-checkable-menu-item% (λ () menu:can-restore-checkable-menu-item%)) + (define/public + get-checkable-menu-item% + (λ () menu:can-restore-checkable-menu-item%)) (define/public get-file-menu (λ () file-menu)) (define/public get-edit-menu (λ () edit-menu)) (define/public get-help-menu (λ () help-menu)) - (define/public file-menu:new-callback (λ (item control) (handler:edit-file #f) #t)) + (define/public + file-menu:new-callback + (λ (item control) (handler:edit-file #f) #t)) (define/public (file-menu:get-new-item) file-menu:new-item) (define/public (file-menu:new-string) (string-constant new-menu-item)) (define/public (file-menu:new-help-string) (string-constant new-info)) (define/public file-menu:new-on-demand (λ (menu-item) (void))) (define/public (file-menu:create-new?) #t) (define/public file-menu:between-new-and-open (λ (menu) (void))) - (define/public file-menu:open-callback (λ (item control) (handler:open-file) #t)) + (define/public + file-menu:open-callback + (λ (item control) (handler:open-file) #t)) (define/public (file-menu:get-open-item) file-menu:open-item) (define/public (file-menu:open-string) (string-constant open-menu-item)) (define/public (file-menu:open-help-string) (string-constant open-info)) @@ -213,9 +224,15 @@ (define/public (file-menu:create-open?) #t) (define/public file-menu:open-recent-callback (λ (x y) (void))) (define/public (file-menu:get-open-recent-item) file-menu:open-recent-item) - (define/public (file-menu:open-recent-string) (string-constant open-recent-menu-item)) - (define/public (file-menu:open-recent-help-string) (string-constant open-recent-info)) - (define/public file-menu:open-recent-on-demand (λ (menu) (handler:install-recent-items menu))) + (define/public + (file-menu:open-recent-string) + (string-constant open-recent-menu-item)) + (define/public + (file-menu:open-recent-help-string) + (string-constant open-recent-info)) + (define/public + file-menu:open-recent-on-demand + (λ (menu) (handler:install-recent-items menu))) (define/public (file-menu:create-open-recent?) #t) (define/public file-menu:between-open-and-revert (λ (menu) (void))) (define/public file-menu:revert-callback (λ (item control) (void))) @@ -233,8 +250,12 @@ (define/public (file-menu:create-save?) #f) (define/public file-menu:save-as-callback (λ (item control) (void))) (define/public (file-menu:get-save-as-item) file-menu:save-as-item) - (define/public (file-menu:save-as-string) (string-constant save-as-menu-item)) - (define/public (file-menu:save-as-help-string) (string-constant save-as-info)) + (define/public + (file-menu:save-as-string) + (string-constant save-as-menu-item)) + (define/public + (file-menu:save-as-help-string) + (string-constant save-as-info)) (define/public file-menu:save-as-on-demand (λ (menu-item) (void))) (define/public (file-menu:create-save-as?) #f) (define/public file-menu:between-save-as-and-print (λ (menu) (void))) @@ -244,15 +265,21 @@ (define/public (file-menu:print-help-string) (string-constant print-info)) (define/public file-menu:print-on-demand (λ (menu-item) (void))) (define/public (file-menu:create-print?) #f) - (define/public file-menu:between-print-and-close (λ (menu) (make-object separator-menu-item% menu))) - (define/public file-menu:close-callback (λ (item control) (when (can-close?) (on-close) (show #f)) #t)) + (define/public + file-menu:between-print-and-close + (λ (menu) (make-object separator-menu-item% menu))) + (define/public + file-menu:close-callback + (λ (item control) (when (can-close?) (on-close) (show #f)) #t)) (define/public (file-menu:get-close-item) file-menu:close-item) (define/public (file-menu:close-string) (string-constant close-menu-item)) (define/public (file-menu:close-help-string) (string-constant close-info)) (define/public file-menu:close-on-demand (λ (menu-item) (void))) (define/public (file-menu:create-close?) #t) (define/public file-menu:between-close-and-quit (λ (menu) (void))) - (define/public file-menu:quit-callback (λ (item control) (when (exit:user-oks-exit) (exit:exit)))) + (define/public + file-menu:quit-callback + (λ (item control) (when (exit:user-oks-exit) (exit:exit)))) (define/public (file-menu:get-quit-item) file-menu:quit-item) (define/public (file-menu:quit-string) @@ -261,13 +288,16 @@ (string-constant quit-menu-item-others))) (define/public (file-menu:quit-help-string) (string-constant quit-info)) (define/public file-menu:quit-on-demand (λ (menu-item) (void))) - (define/public (file-menu:create-quit?) (not (current-eventspace-has-standard-menus?))) + (define/public + (file-menu:create-quit?) + (not (current-eventspace-has-standard-menus?))) (define/public file-menu:after-quit (λ (menu) (void))) (define/public edit-menu:undo-callback (λ (menu evt) (let ((edit (get-edit-target-object))) - (when (and edit (is-a? edit editor<%>)) (send edit do-edit-operation 'undo))) + (when (and edit (is-a? edit editor<%>)) + (send edit do-edit-operation 'undo))) #t)) (define/public (edit-menu:get-undo-item) edit-menu:undo-item) (define/public (edit-menu:undo-string) (string-constant undo-menu-item)) @@ -276,14 +306,18 @@ edit-menu:undo-on-demand (λ (item) (let* ((editor (get-edit-target-object)) - (enable? (and editor (is-a? editor editor<%>) (send editor can-do-edit-operation? 'undo)))) + (enable? + (and editor + (is-a? editor editor<%>) + (send editor can-do-edit-operation? 'undo)))) (send item enable enable?)))) (define/public (edit-menu:create-undo?) #t) (define/public edit-menu:redo-callback (λ (menu evt) (let ((edit (get-edit-target-object))) - (when (and edit (is-a? edit editor<%>)) (send edit do-edit-operation 'redo))) + (when (and edit (is-a? edit editor<%>)) + (send edit do-edit-operation 'redo))) #t)) (define/public (edit-menu:get-redo-item) edit-menu:redo-item) (define/public (edit-menu:redo-string) (string-constant redo-menu-item)) @@ -292,15 +326,21 @@ edit-menu:redo-on-demand (λ (item) (let* ((editor (get-edit-target-object)) - (enable? (and editor (is-a? editor editor<%>) (send editor can-do-edit-operation? 'redo)))) + (enable? + (and editor + (is-a? editor editor<%>) + (send editor can-do-edit-operation? 'redo)))) (send item enable enable?)))) (define/public (edit-menu:create-redo?) #t) - (define/public edit-menu:between-redo-and-cut (λ (menu) (make-object separator-menu-item% menu))) + (define/public + edit-menu:between-redo-and-cut + (λ (menu) (make-object separator-menu-item% menu))) (define/public edit-menu:cut-callback (λ (menu evt) (let ((edit (get-edit-target-object))) - (when (and edit (is-a? edit editor<%>)) (send edit do-edit-operation 'cut))) + (when (and edit (is-a? edit editor<%>)) + (send edit do-edit-operation 'cut))) #t)) (define/public (edit-menu:get-cut-item) edit-menu:cut-item) (define/public (edit-menu:cut-string) (string-constant cut-menu-item)) @@ -309,7 +349,10 @@ edit-menu:cut-on-demand (λ (item) (let* ((editor (get-edit-target-object)) - (enable? (and editor (is-a? editor editor<%>) (send editor can-do-edit-operation? 'cut)))) + (enable? + (and editor + (is-a? editor editor<%>) + (send editor can-do-edit-operation? 'cut)))) (send item enable enable?)))) (define/public (edit-menu:create-cut?) #t) (define/public edit-menu:between-cut-and-copy (λ (menu) (void))) @@ -317,7 +360,8 @@ edit-menu:copy-callback (λ (menu evt) (let ((edit (get-edit-target-object))) - (when (and edit (is-a? edit editor<%>)) (send edit do-edit-operation 'copy))) + (when (and edit (is-a? edit editor<%>)) + (send edit do-edit-operation 'copy))) #t)) (define/public (edit-menu:get-copy-item) edit-menu:copy-item) (define/public (edit-menu:copy-string) (string-constant copy-menu-item)) @@ -326,7 +370,10 @@ edit-menu:copy-on-demand (λ (item) (let* ((editor (get-edit-target-object)) - (enable? (and editor (is-a? editor editor<%>) (send editor can-do-edit-operation? 'copy)))) + (enable? + (and editor + (is-a? editor editor<%>) + (send editor can-do-edit-operation? 'copy)))) (send item enable enable?)))) (define/public (edit-menu:create-copy?) #t) (define/public edit-menu:between-copy-and-paste (λ (menu) (void))) @@ -334,7 +381,8 @@ edit-menu:paste-callback (λ (menu evt) (let ((edit (get-edit-target-object))) - (when (and edit (is-a? edit editor<%>)) (send edit do-edit-operation 'paste))) + (when (and edit (is-a? edit editor<%>)) + (send edit do-edit-operation 'paste))) #t)) (define/public (edit-menu:get-paste-item) edit-menu:paste-item) (define/public (edit-menu:paste-string) (string-constant paste-menu-item)) @@ -343,7 +391,10 @@ edit-menu:paste-on-demand (λ (item) (let* ((editor (get-edit-target-object)) - (enable? (and editor (is-a? editor editor<%>) (send editor can-do-edit-operation? 'paste)))) + (enable? + (and editor + (is-a? editor editor<%>) + (send editor can-do-edit-operation? 'paste)))) (send item enable enable?)))) (define/public (edit-menu:create-paste?) #t) (define/public edit-menu:between-paste-and-clear (λ (menu) (void))) @@ -351,7 +402,8 @@ edit-menu:clear-callback (λ (menu evt) (let ((edit (get-edit-target-object))) - (when (and edit (is-a? edit editor<%>)) (send edit do-edit-operation 'clear))) + (when (and edit (is-a? edit editor<%>)) + (send edit do-edit-operation 'clear))) #t)) (define/public (edit-menu:get-clear-item) edit-menu:clear-item) (define/public @@ -364,7 +416,10 @@ edit-menu:clear-on-demand (λ (item) (let* ((editor (get-edit-target-object)) - (enable? (and editor (is-a? editor editor<%>) (send editor can-do-edit-operation? 'clear)))) + (enable? + (and editor + (is-a? editor editor<%>) + (send editor can-do-edit-operation? 'clear)))) (send item enable enable?)))) (define/public (edit-menu:create-clear?) #t) (define/public edit-menu:between-clear-and-select-all (λ (menu) (void))) @@ -372,90 +427,148 @@ edit-menu:select-all-callback (λ (menu evt) (let ((edit (get-edit-target-object))) - (when (and edit (is-a? edit editor<%>)) (send edit do-edit-operation 'select-all))) + (when (and edit (is-a? edit editor<%>)) + (send edit do-edit-operation 'select-all))) #t)) (define/public (edit-menu:get-select-all-item) edit-menu:select-all-item) - (define/public (edit-menu:select-all-string) (string-constant select-all-menu-item)) - (define/public (edit-menu:select-all-help-string) (string-constant select-all-info)) + (define/public + (edit-menu:select-all-string) + (string-constant select-all-menu-item)) + (define/public + (edit-menu:select-all-help-string) + (string-constant select-all-info)) (define/public edit-menu:select-all-on-demand (λ (item) (let* ((editor (get-edit-target-object)) - (enable? (and editor (is-a? editor editor<%>) (send editor can-do-edit-operation? 'select-all)))) + (enable? + (and editor + (is-a? editor editor<%>) + (send editor can-do-edit-operation? 'select-all)))) (send item enable enable?)))) (define/public (edit-menu:create-select-all?) #t) - (define/public edit-menu:between-select-all-and-find (λ (menu) (make-object separator-menu-item% menu))) + (define/public + edit-menu:between-select-all-and-find + (λ (menu) (make-object separator-menu-item% menu))) (define/public edit-menu:find-callback (λ (item control) (void))) (define/public (edit-menu:get-find-item) edit-menu:find-item) (define/public (edit-menu:find-string) (string-constant find-menu-item)) (define/public (edit-menu:find-help-string) (string-constant find-info)) (define/public edit-menu:find-on-demand - (λ (item) (send item enable (let ((target (get-edit-target-object))) (and target (is-a? target editor<%>)))))) + (λ (item) + (send item enable + (let + ((target (get-edit-target-object))) + (and target (is-a? target editor<%>)))))) (define/public (edit-menu:create-find?) #f) - (define/public edit-menu:find-again-callback (λ (item control) (void))) - (define/public (edit-menu:get-find-again-item) edit-menu:find-again-item) - (define/public (edit-menu:find-again-string) (string-constant find-again-menu-item)) - (define/public (edit-menu:find-again-help-string) (string-constant find-again-info)) + (define/public edit-menu:find-next-callback (λ (item control) (void))) + (define/public (edit-menu:get-find-next-item) edit-menu:find-next-item) (define/public - edit-menu:find-again-on-demand - (λ (item) (send item enable (let ((target (get-edit-target-object))) (and target (is-a? target editor<%>)))))) - (define/public (edit-menu:create-find-again?) #f) - (define/public edit-menu:find-again-backwards-callback (λ (item control) (void))) - (define/public (edit-menu:get-find-again-backwards-item) edit-menu:find-again-backwards-item) - (define/public (edit-menu:find-again-backwards-string) (string-constant find-again-backwards-menu-item)) - (define/public (edit-menu:find-again-backwards-help-string) (string-constant find-again-backwards-info)) + (edit-menu:find-next-string) + (string-constant find-next-menu-item)) (define/public - edit-menu:find-again-backwards-on-demand - (λ (item) (send item enable (let ((target (get-edit-target-object))) (and target (is-a? target editor<%>)))))) - (define/public (edit-menu:create-find-again-backwards?) #f) - (define/public edit-menu:replace-and-find-again-callback (λ (item control) (void))) - (define/public (edit-menu:get-replace-and-find-again-item) edit-menu:replace-and-find-again-item) - (define/public (edit-menu:replace-and-find-again-string) (string-constant replace-and-find-again-menu-item)) - (define/public (edit-menu:replace-and-find-again-help-string) (string-constant replace-and-find-again-info)) + (edit-menu:find-next-help-string) + (string-constant find-next-info)) (define/public - edit-menu:replace-and-find-again-on-demand - (λ (item) (send item enable (let ((target (get-edit-target-object))) (and target (is-a? target editor<%>)))))) - (define/public (edit-menu:create-replace-and-find-again?) #f) - (define/public edit-menu:replace-and-find-again-backwards-callback (λ (item control) (void))) + edit-menu:find-next-on-demand + (λ (item) + (send item enable + (let + ((target (get-edit-target-object))) + (and target (is-a? target editor<%>)))))) + (define/public (edit-menu:create-find-next?) #f) + (define/public edit-menu:find-previous-callback (λ (item control) (void))) (define/public - (edit-menu:get-replace-and-find-again-backwards-item) - edit-menu:replace-and-find-again-backwards-item) + (edit-menu:get-find-previous-item) + edit-menu:find-previous-item) (define/public - (edit-menu:replace-and-find-again-backwards-string) - (string-constant replace-and-find-again-backwards-menu-item)) + (edit-menu:find-previous-string) + (string-constant find-previous-menu-item)) (define/public - (edit-menu:replace-and-find-again-backwards-help-string) - (string-constant replace-and-find-again-backwards-info)) + (edit-menu:find-previous-help-string) + (string-constant find-previous-info)) (define/public - edit-menu:replace-and-find-again-backwards-on-demand - (λ (item) (send item enable (let ((target (get-edit-target-object))) (and target (is-a? target editor<%>)))))) - (define/public (edit-menu:create-replace-and-find-again-backwards?) #f) + edit-menu:find-previous-on-demand + (λ (item) + (send item enable + (let + ((target (get-edit-target-object))) + (and target (is-a? target editor<%>)))))) + (define/public (edit-menu:create-find-previous?) #f) + (define/public + edit-menu:show/hide-replace-callback + (λ (item control) (void))) + (define/public + (edit-menu:get-show/hide-replace-item) + edit-menu:show/hide-replace-item) + (define/public + (edit-menu:show/hide-replace-string) + (string-constant show-replace-menu-item)) + (define/public + (edit-menu:show/hide-replace-help-string) + (string-constant show/hide-replace-info)) + (define/public edit-menu:show/hide-replace-on-demand (λ (menu-item) (void))) + (define/public (edit-menu:create-show/hide-replace?) #f) + (define/public edit-menu:replace-callback (λ (item control) (void))) + (define/public (edit-menu:get-replace-item) edit-menu:replace-item) + (define/public + (edit-menu:replace-string) + (string-constant replace-menu-item)) + (define/public + (edit-menu:replace-help-string) + (string-constant replace-info)) + (define/public edit-menu:replace-on-demand (λ (menu-item) (void))) + (define/public (edit-menu:create-replace?) #f) (define/public edit-menu:replace-all-callback (λ (item control) (void))) (define/public (edit-menu:get-replace-all-item) edit-menu:replace-all-item) - (define/public (edit-menu:replace-all-string) (string-constant replace-all-menu-item)) - (define/public (edit-menu:replace-all-help-string) (string-constant replace-all-info)) (define/public - edit-menu:replace-all-on-demand - (λ (item) (send item enable (let ((target (get-edit-target-object))) (and target (is-a? target editor<%>)))))) + (edit-menu:replace-all-string) + (string-constant replace-all-menu-item)) + (define/public + (edit-menu:replace-all-help-string) + (string-constant replace-all-info)) + (define/public edit-menu:replace-all-on-demand (λ (menu-item) (void))) (define/public (edit-menu:create-replace-all?) #f) - (define/public edit-menu:find-case-sensitive-callback (λ (item control) (void))) - (define/public (edit-menu:get-find-case-sensitive-item) edit-menu:find-case-sensitive-item) - (define/public (edit-menu:find-case-sensitive-string) (string-constant find-case-sensitive-menu-item)) - (define/public (edit-menu:find-case-sensitive-help-string) (string-constant find-case-sensitive-info)) + (define/public + edit-menu:find-case-sensitive-callback + (λ (item control) (void))) + (define/public + (edit-menu:get-find-case-sensitive-item) + edit-menu:find-case-sensitive-item) + (define/public + (edit-menu:find-case-sensitive-string) + (string-constant find-case-sensitive-menu-item)) + (define/public + (edit-menu:find-case-sensitive-help-string) + (string-constant find-case-sensitive-info)) (define/public edit-menu:find-case-sensitive-on-demand - (λ (item) (send item enable (let ((target (get-edit-target-object))) (and target (is-a? target editor<%>)))))) + (λ (item) + (send item enable + (let + ((target (get-edit-target-object))) + (and target (is-a? target editor<%>)))))) (define/public (edit-menu:create-find-case-sensitive?) #f) (define/public edit-menu:between-find-and-preferences - (λ (menu) (unless (current-eventspace-has-standard-menus?) (make-object separator-menu-item% menu)))) - (define/public edit-menu:preferences-callback (λ (item control) (preferences:show-dialog) #t)) + (λ (menu) + (unless (current-eventspace-has-standard-menus?) + (make-object separator-menu-item% menu)))) + (define/public + edit-menu:preferences-callback + (λ (item control) (preferences:show-dialog) #t)) (define/public (edit-menu:get-preferences-item) edit-menu:preferences-item) - (define/public (edit-menu:preferences-string) (string-constant preferences-menu-item)) - (define/public (edit-menu:preferences-help-string) (string-constant preferences-info)) + (define/public + (edit-menu:preferences-string) + (string-constant preferences-menu-item)) + (define/public + (edit-menu:preferences-help-string) + (string-constant preferences-info)) (define/public edit-menu:preferences-on-demand (λ (menu-item) (void))) - (define/public (edit-menu:create-preferences?) (not (current-eventspace-has-standard-menus?))) + (define/public + (edit-menu:create-preferences?) + (not (current-eventspace-has-standard-menus?))) (define/public edit-menu:after-preferences (λ (menu) (void))) (define/public help-menu:before-about (λ (menu) (void))) (define/public help-menu:about-callback (λ (item control) (void))) @@ -466,9 +579,18 @@ (define/public (help-menu:create-about?) #f) (define/public help-menu:after-about (λ (menu) (void))) (super-instantiate ()) - (define file-menu (make-object (get-menu%) (string-constant file-menu-label) (get-menu-bar))) - (define edit-menu (make-object (get-menu%) (string-constant edit-menu-label) (get-menu-bar))) - (define help-menu (make-object (get-menu%) (string-constant help-menu-label) (get-menu-bar))) + (define file-menu + (make-object (get-menu%) + (string-constant file-menu-label) + (get-menu-bar))) + (define edit-menu + (make-object (get-menu%) + (string-constant edit-menu-label) + (get-menu-bar))) + (define help-menu + (make-object (get-menu%) + (string-constant help-menu-label) + (get-menu-bar))) (define file-menu:new-item (and (file-menu:create-new?) (new @@ -476,12 +598,14 @@ (label (file-menu:new-string)) (parent file-menu) (callback - (let ((file-menu:new-callback (λ (item evt) (file-menu:new-callback item evt)))) + (let ((file-menu:new-callback + (λ (item evt) (file-menu:new-callback item evt)))) file-menu:new-callback)) (shortcut #\n) (shortcut-prefix (get-default-shortcut-prefix)) (help-string (file-menu:new-help-string)) - (demand-callback (λ (menu-item) (file-menu:new-on-demand menu-item)))))) + (demand-callback + (λ (menu-item) (file-menu:new-on-demand menu-item)))))) (file-menu:between-new-and-open (get-file-menu)) (define file-menu:open-item (and (file-menu:create-open?) @@ -490,12 +614,14 @@ (label (file-menu:open-string)) (parent file-menu) (callback - (let ((file-menu:open-callback (λ (item evt) (file-menu:open-callback item evt)))) + (let ((file-menu:open-callback + (λ (item evt) (file-menu:open-callback item evt)))) file-menu:open-callback)) (shortcut #\o) (shortcut-prefix (get-default-shortcut-prefix)) (help-string (file-menu:open-help-string)) - (demand-callback (λ (menu-item) (file-menu:open-on-demand menu-item)))))) + (demand-callback + (λ (menu-item) (file-menu:open-on-demand menu-item)))))) (define file-menu:open-recent-item (and (file-menu:create-open-recent?) (new @@ -503,7 +629,8 @@ (label (file-menu:open-recent-string)) (parent file-menu) (help-string (file-menu:open-recent-help-string)) - (demand-callback (λ (menu-item) (file-menu:open-recent-on-demand menu-item)))))) + (demand-callback + (λ (menu-item) (file-menu:open-recent-on-demand menu-item)))))) (file-menu:between-open-and-revert (get-file-menu)) (define file-menu:revert-item (and (file-menu:create-revert?) @@ -512,12 +639,14 @@ (label (file-menu:revert-string)) (parent file-menu) (callback - (let ((file-menu:revert-callback (λ (item evt) (file-menu:revert-callback item evt)))) + (let ((file-menu:revert-callback + (λ (item evt) (file-menu:revert-callback item evt)))) file-menu:revert-callback)) (shortcut #f) (shortcut-prefix (get-default-shortcut-prefix)) (help-string (file-menu:revert-help-string)) - (demand-callback (λ (menu-item) (file-menu:revert-on-demand menu-item)))))) + (demand-callback + (λ (menu-item) (file-menu:revert-on-demand menu-item)))))) (file-menu:between-revert-and-save (get-file-menu)) (define file-menu:save-item (and (file-menu:create-save?) @@ -526,12 +655,14 @@ (label (file-menu:save-string)) (parent file-menu) (callback - (let ((file-menu:save-callback (λ (item evt) (file-menu:save-callback item evt)))) + (let ((file-menu:save-callback + (λ (item evt) (file-menu:save-callback item evt)))) file-menu:save-callback)) (shortcut #\s) (shortcut-prefix (get-default-shortcut-prefix)) (help-string (file-menu:save-help-string)) - (demand-callback (λ (menu-item) (file-menu:save-on-demand menu-item)))))) + (demand-callback + (λ (menu-item) (file-menu:save-on-demand menu-item)))))) (define file-menu:save-as-item (and (file-menu:create-save-as?) (new @@ -539,12 +670,14 @@ (label (file-menu:save-as-string)) (parent file-menu) (callback - (let ((file-menu:save-as-callback (λ (item evt) (file-menu:save-as-callback item evt)))) + (let ((file-menu:save-as-callback + (λ (item evt) (file-menu:save-as-callback item evt)))) file-menu:save-as-callback)) (shortcut #f) (shortcut-prefix (get-default-shortcut-prefix)) (help-string (file-menu:save-as-help-string)) - (demand-callback (λ (menu-item) (file-menu:save-as-on-demand menu-item)))))) + (demand-callback + (λ (menu-item) (file-menu:save-as-on-demand menu-item)))))) (file-menu:between-save-as-and-print (get-file-menu)) (define file-menu:print-item (and (file-menu:create-print?) @@ -553,12 +686,14 @@ (label (file-menu:print-string)) (parent file-menu) (callback - (let ((file-menu:print-callback (λ (item evt) (file-menu:print-callback item evt)))) + (let ((file-menu:print-callback + (λ (item evt) (file-menu:print-callback item evt)))) file-menu:print-callback)) (shortcut #\p) (shortcut-prefix (get-default-shortcut-prefix)) (help-string (file-menu:print-help-string)) - (demand-callback (λ (menu-item) (file-menu:print-on-demand menu-item)))))) + (demand-callback + (λ (menu-item) (file-menu:print-on-demand menu-item)))))) (file-menu:between-print-and-close (get-file-menu)) (define file-menu:close-item (and (file-menu:create-close?) @@ -567,12 +702,14 @@ (label (file-menu:close-string)) (parent file-menu) (callback - (let ((file-menu:close-callback (λ (item evt) (file-menu:close-callback item evt)))) + (let ((file-menu:close-callback + (λ (item evt) (file-menu:close-callback item evt)))) file-menu:close-callback)) (shortcut #\w) (shortcut-prefix (get-default-shortcut-prefix)) (help-string (file-menu:close-help-string)) - (demand-callback (λ (menu-item) (file-menu:close-on-demand menu-item)))))) + (demand-callback + (λ (menu-item) (file-menu:close-on-demand menu-item)))))) (file-menu:between-close-and-quit (get-file-menu)) (define file-menu:quit-item (and (file-menu:create-quit?) @@ -581,12 +718,14 @@ (label (file-menu:quit-string)) (parent file-menu) (callback - (let ((file-menu:quit-callback (λ (item evt) (file-menu:quit-callback item evt)))) + (let ((file-menu:quit-callback + (λ (item evt) (file-menu:quit-callback item evt)))) file-menu:quit-callback)) (shortcut #\q) (shortcut-prefix (get-default-shortcut-prefix)) (help-string (file-menu:quit-help-string)) - (demand-callback (λ (menu-item) (file-menu:quit-on-demand menu-item)))))) + (demand-callback + (λ (menu-item) (file-menu:quit-on-demand menu-item)))))) (file-menu:after-quit (get-file-menu)) (define edit-menu:undo-item (and (edit-menu:create-undo?) @@ -595,12 +734,14 @@ (label (edit-menu:undo-string)) (parent edit-menu) (callback - (let ((edit-menu:undo-callback (λ (item evt) (edit-menu:undo-callback item evt)))) + (let ((edit-menu:undo-callback + (λ (item evt) (edit-menu:undo-callback item evt)))) edit-menu:undo-callback)) (shortcut #\z) (shortcut-prefix (get-default-shortcut-prefix)) (help-string (edit-menu:undo-help-string)) - (demand-callback (λ (menu-item) (edit-menu:undo-on-demand menu-item)))))) + (demand-callback + (λ (menu-item) (edit-menu:undo-on-demand menu-item)))))) (define edit-menu:redo-item (and (edit-menu:create-redo?) (new @@ -608,7 +749,8 @@ (label (edit-menu:redo-string)) (parent edit-menu) (callback - (let ((edit-menu:redo-callback (λ (item evt) (edit-menu:redo-callback item evt)))) + (let ((edit-menu:redo-callback + (λ (item evt) (edit-menu:redo-callback item evt)))) edit-menu:redo-callback)) (shortcut (if (eq? (system-type) 'windows) #\y #\z)) (shortcut-prefix @@ -616,7 +758,8 @@ (get-default-shortcut-prefix) (cons 'shift (get-default-shortcut-prefix)))) (help-string (edit-menu:redo-help-string)) - (demand-callback (λ (menu-item) (edit-menu:redo-on-demand menu-item)))))) + (demand-callback + (λ (menu-item) (edit-menu:redo-on-demand menu-item)))))) (edit-menu:between-redo-and-cut (get-edit-menu)) (define edit-menu:cut-item (and (edit-menu:create-cut?) @@ -625,12 +768,14 @@ (label (edit-menu:cut-string)) (parent edit-menu) (callback - (let ((edit-menu:cut-callback (λ (item evt) (edit-menu:cut-callback item evt)))) + (let ((edit-menu:cut-callback + (λ (item evt) (edit-menu:cut-callback item evt)))) edit-menu:cut-callback)) (shortcut #\x) (shortcut-prefix (get-default-shortcut-prefix)) (help-string (edit-menu:cut-help-string)) - (demand-callback (λ (menu-item) (edit-menu:cut-on-demand menu-item)))))) + (demand-callback + (λ (menu-item) (edit-menu:cut-on-demand menu-item)))))) (edit-menu:between-cut-and-copy (get-edit-menu)) (define edit-menu:copy-item (and (edit-menu:create-copy?) @@ -639,12 +784,14 @@ (label (edit-menu:copy-string)) (parent edit-menu) (callback - (let ((edit-menu:copy-callback (λ (item evt) (edit-menu:copy-callback item evt)))) + (let ((edit-menu:copy-callback + (λ (item evt) (edit-menu:copy-callback item evt)))) edit-menu:copy-callback)) (shortcut #\c) (shortcut-prefix (get-default-shortcut-prefix)) (help-string (edit-menu:copy-help-string)) - (demand-callback (λ (menu-item) (edit-menu:copy-on-demand menu-item)))))) + (demand-callback + (λ (menu-item) (edit-menu:copy-on-demand menu-item)))))) (edit-menu:between-copy-and-paste (get-edit-menu)) (define edit-menu:paste-item (and (edit-menu:create-paste?) @@ -653,12 +800,14 @@ (label (edit-menu:paste-string)) (parent edit-menu) (callback - (let ((edit-menu:paste-callback (λ (item evt) (edit-menu:paste-callback item evt)))) + (let ((edit-menu:paste-callback + (λ (item evt) (edit-menu:paste-callback item evt)))) edit-menu:paste-callback)) (shortcut #\v) (shortcut-prefix (get-default-shortcut-prefix)) (help-string (edit-menu:paste-help-string)) - (demand-callback (λ (menu-item) (edit-menu:paste-on-demand menu-item)))))) + (demand-callback + (λ (menu-item) (edit-menu:paste-on-demand menu-item)))))) (edit-menu:between-paste-and-clear (get-edit-menu)) (define edit-menu:clear-item (and (edit-menu:create-clear?) @@ -667,12 +816,14 @@ (label (edit-menu:clear-string)) (parent edit-menu) (callback - (let ((edit-menu:clear-callback (λ (item evt) (edit-menu:clear-callback item evt)))) + (let ((edit-menu:clear-callback + (λ (item evt) (edit-menu:clear-callback item evt)))) edit-menu:clear-callback)) (shortcut #f) (shortcut-prefix (get-default-shortcut-prefix)) (help-string (edit-menu:clear-help-string)) - (demand-callback (λ (menu-item) (edit-menu:clear-on-demand menu-item)))))) + (demand-callback + (λ (menu-item) (edit-menu:clear-on-demand menu-item)))))) (edit-menu:between-clear-and-select-all (get-edit-menu)) (define edit-menu:select-all-item (and (edit-menu:create-select-all?) @@ -681,12 +832,14 @@ (label (edit-menu:select-all-string)) (parent edit-menu) (callback - (let ((edit-menu:select-all-callback (λ (item evt) (edit-menu:select-all-callback item evt)))) + (let ((edit-menu:select-all-callback + (λ (item evt) (edit-menu:select-all-callback item evt)))) edit-menu:select-all-callback)) (shortcut #\a) (shortcut-prefix (get-default-shortcut-prefix)) (help-string (edit-menu:select-all-help-string)) - (demand-callback (λ (menu-item) (edit-menu:select-all-on-demand menu-item)))))) + (demand-callback + (λ (menu-item) (edit-menu:select-all-on-demand menu-item)))))) (edit-menu:between-select-all-and-find (get-edit-menu)) (define edit-menu:find-item (and (edit-menu:create-find?) @@ -695,67 +848,76 @@ (label (edit-menu:find-string)) (parent edit-menu) (callback - (let ((edit-menu:find-callback (λ (item evt) (edit-menu:find-callback item evt)))) + (let ((edit-menu:find-callback + (λ (item evt) (edit-menu:find-callback item evt)))) edit-menu:find-callback)) (shortcut #\f) (shortcut-prefix (get-default-shortcut-prefix)) (help-string (edit-menu:find-help-string)) - (demand-callback (λ (menu-item) (edit-menu:find-on-demand menu-item)))))) - (define edit-menu:find-again-item - (and (edit-menu:create-find-again?) + (demand-callback + (λ (menu-item) (edit-menu:find-on-demand menu-item)))))) + (define edit-menu:find-next-item + (and (edit-menu:create-find-next?) (new (get-menu-item%) - (label (edit-menu:find-again-string)) + (label (edit-menu:find-next-string)) (parent edit-menu) (callback - (let ((edit-menu:find-again-callback (λ (item evt) (edit-menu:find-again-callback item evt)))) - edit-menu:find-again-callback)) + (let ((edit-menu:find-next-callback + (λ (item evt) (edit-menu:find-next-callback item evt)))) + edit-menu:find-next-callback)) (shortcut #\g) (shortcut-prefix (get-default-shortcut-prefix)) - (help-string (edit-menu:find-again-help-string)) - (demand-callback (λ (menu-item) (edit-menu:find-again-on-demand menu-item)))))) - (define edit-menu:find-again-backwards-item - (and (edit-menu:create-find-again-backwards?) + (help-string (edit-menu:find-next-help-string)) + (demand-callback + (λ (menu-item) (edit-menu:find-next-on-demand menu-item)))))) + (define edit-menu:find-previous-item + (and (edit-menu:create-find-previous?) (new (get-menu-item%) - (label (edit-menu:find-again-backwards-string)) + (label (edit-menu:find-previous-string)) (parent edit-menu) (callback - (let ((edit-menu:find-again-backwards-callback - (λ (item evt) (edit-menu:find-again-backwards-callback item evt)))) - edit-menu:find-again-backwards-callback)) + (let ((edit-menu:find-previous-callback + (λ (item evt) (edit-menu:find-previous-callback item evt)))) + edit-menu:find-previous-callback)) (shortcut #\g) (shortcut-prefix (cons 'shift (get-default-shortcut-prefix))) - (help-string (edit-menu:find-again-backwards-help-string)) - (demand-callback (λ (menu-item) (edit-menu:find-again-backwards-on-demand menu-item)))))) - (define edit-menu:replace-and-find-again-item - (and (edit-menu:create-replace-and-find-again?) + (help-string (edit-menu:find-previous-help-string)) + (demand-callback + (λ (menu-item) (edit-menu:find-previous-on-demand menu-item)))))) + (define edit-menu:show/hide-replace-item + (and (edit-menu:create-show/hide-replace?) (new (get-menu-item%) - (label (edit-menu:replace-and-find-again-string)) + (label (edit-menu:show/hide-replace-string)) (parent edit-menu) (callback - (let ((edit-menu:replace-and-find-again-callback - (λ (item evt) (edit-menu:replace-and-find-again-callback item evt)))) - edit-menu:replace-and-find-again-callback)) - (shortcut #\r) - (shortcut-prefix (get-default-shortcut-prefix)) - (help-string (edit-menu:replace-and-find-again-help-string)) - (demand-callback (λ (menu-item) (edit-menu:replace-and-find-again-on-demand menu-item)))))) - (define edit-menu:replace-and-find-again-backwards-item - (and (edit-menu:create-replace-and-find-again-backwards?) - (new - (get-menu-item%) - (label (edit-menu:replace-and-find-again-backwards-string)) - (parent edit-menu) - (callback - (let ((edit-menu:replace-and-find-again-backwards-callback - (λ (item evt) (edit-menu:replace-and-find-again-backwards-callback item evt)))) - edit-menu:replace-and-find-again-backwards-callback)) + (let ((edit-menu:show/hide-replace-callback + (λ (item evt) + (edit-menu:show/hide-replace-callback item evt)))) + edit-menu:show/hide-replace-callback)) (shortcut #\r) (shortcut-prefix (cons 'shift (get-default-shortcut-prefix))) - (help-string (edit-menu:replace-and-find-again-backwards-help-string)) - (demand-callback (λ (menu-item) (edit-menu:replace-and-find-again-backwards-on-demand menu-item)))))) + (help-string (edit-menu:show/hide-replace-help-string)) + (demand-callback + (λ (menu-item) + (edit-menu:show/hide-replace-on-demand menu-item)))))) + (define edit-menu:replace-item + (and (edit-menu:create-replace?) + (new + (get-menu-item%) + (label (edit-menu:replace-string)) + (parent edit-menu) + (callback + (let ((edit-menu:replace-callback + (λ (item evt) (edit-menu:replace-callback item evt)))) + edit-menu:replace-callback)) + (shortcut #\r) + (shortcut-prefix (get-default-shortcut-prefix)) + (help-string (edit-menu:replace-help-string)) + (demand-callback + (λ (menu-item) (edit-menu:replace-on-demand menu-item)))))) (define edit-menu:replace-all-item (and (edit-menu:create-replace-all?) (new @@ -763,12 +925,14 @@ (label (edit-menu:replace-all-string)) (parent edit-menu) (callback - (let ((edit-menu:replace-all-callback (λ (item evt) (edit-menu:replace-all-callback item evt)))) + (let ((edit-menu:replace-all-callback + (λ (item evt) (edit-menu:replace-all-callback item evt)))) edit-menu:replace-all-callback)) (shortcut #f) (shortcut-prefix (get-default-shortcut-prefix)) (help-string (edit-menu:replace-all-help-string)) - (demand-callback (λ (menu-item) (edit-menu:replace-all-on-demand menu-item)))))) + (demand-callback + (λ (menu-item) (edit-menu:replace-all-on-demand menu-item)))))) (define edit-menu:find-case-sensitive-item (and (edit-menu:create-find-case-sensitive?) (new @@ -777,12 +941,15 @@ (parent edit-menu) (callback (let ((edit-menu:find-case-sensitive-callback - (λ (item evt) (edit-menu:find-case-sensitive-callback item evt)))) + (λ (item evt) + (edit-menu:find-case-sensitive-callback item evt)))) edit-menu:find-case-sensitive-callback)) (shortcut #f) (shortcut-prefix (get-default-shortcut-prefix)) (help-string (edit-menu:find-case-sensitive-help-string)) - (demand-callback (λ (menu-item) (edit-menu:find-case-sensitive-on-demand menu-item)))))) + (demand-callback + (λ (menu-item) + (edit-menu:find-case-sensitive-on-demand menu-item)))))) (edit-menu:between-find-and-preferences (get-edit-menu)) (define edit-menu:preferences-item (and (edit-menu:create-preferences?) @@ -791,12 +958,14 @@ (label (edit-menu:preferences-string)) (parent edit-menu) (callback - (let ((edit-menu:preferences-callback (λ (item evt) (edit-menu:preferences-callback item evt)))) + (let ((edit-menu:preferences-callback + (λ (item evt) (edit-menu:preferences-callback item evt)))) edit-menu:preferences-callback)) (shortcut (case (system-type) ((macosx) #\,) (else #\;))) (shortcut-prefix (get-default-shortcut-prefix)) (help-string (edit-menu:preferences-help-string)) - (demand-callback (λ (menu-item) (edit-menu:preferences-on-demand menu-item)))))) + (demand-callback + (λ (menu-item) (edit-menu:preferences-on-demand menu-item)))))) (edit-menu:after-preferences (get-edit-menu)) (help-menu:before-about (get-help-menu)) (define help-menu:about-item @@ -806,11 +975,13 @@ (label (help-menu:about-string)) (parent help-menu) (callback - (let ((help-menu:about-callback (λ (item evt) (help-menu:about-callback item evt)))) + (let ((help-menu:about-callback + (λ (item evt) (help-menu:about-callback item evt)))) help-menu:about-callback)) (shortcut #f) (shortcut-prefix (get-default-shortcut-prefix)) (help-string (help-menu:about-help-string)) - (demand-callback (λ (menu-item) (help-menu:about-on-demand menu-item)))))) + (demand-callback + (λ (menu-item) (help-menu:about-on-demand menu-item)))))) (help-menu:after-about (get-help-menu)) (reorder-menus this))) diff --git a/collects/scribblings/framework/frame.scrbl b/collects/scribblings/framework/frame.scrbl index 314ea82c12..d59547487b 100644 --- a/collects/scribblings/framework/frame.scrbl +++ b/collects/scribblings/framework/frame.scrbl @@ -901,10 +901,6 @@ framework)) @(require (for-label scheme/gui)) @(require are no more search hits after the insertion point, but there are search hits before it). } - @defmethod[(search-skip) boolean?]{ - Just like @method[frame:searchable<%> search-replace], - but does not do the replace. - } @defmethod[(replace-all) void?]{ Loops through the text from the beginning to the end, replacing all occurrences of the search string with the contents of the replace diff --git a/collects/scribblings/framework/standard-menus.scrbl b/collects/scribblings/framework/standard-menus.scrbl index 984057777c..68ea66be92 100644 --- a/collects/scribblings/framework/standard-menus.scrbl +++ b/collects/scribblings/framework/standard-menus.scrbl @@ -245,53 +245,53 @@ @(defmethod (edit-menu:find-help-string) string? "The result of this method is used as the help string" "\n" "when the " (scheme menu-item%) " object is created." "\n" "\n" "Defaults to " (scheme (string-constant find-info)) ".") -@(defmethod (edit-menu:get-find-again-item) (or/c false/c (is-a?/c menu-item%)) "This method returns the " (scheme menu-item%) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-find-again?) ").") +@(defmethod (edit-menu:get-find-next-item) (or/c false/c (is-a?/c menu-item%)) "This method returns the " (scheme menu-item%) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-find-next?) ").") -@(defmethod (edit-menu:create-find-again?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (scheme #f) ".") +@(defmethod (edit-menu:create-find-next?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (scheme #f) ".") -@(defmethod (edit-menu:find-again-callback (item (is-a?/c menu-item%)) (control (is-a?/c control-event%))) void? "Defaults to " (schemeblock (void)) " ") +@(defmethod (edit-menu:find-next-callback (item (is-a?/c menu-item%)) (control (is-a?/c control-event%))) void? "Defaults to " (schemeblock (void)) " ") -@(defmethod (edit-menu:find-again-on-demand (item (is-a?/c menu-item%))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (schemeblock (send item enable (let ((target (get-edit-target-object))) (and target (is-a? target editor<%>)))))) +@(defmethod (edit-menu:find-next-on-demand (item (is-a?/c menu-item%))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (schemeblock (send item enable (let ((target (get-edit-target-object))) (and target (is-a? target editor<%>)))))) -@(defmethod (edit-menu:find-again-string) string? "The result of this method is used as the name of the " (scheme menu-item%) "." "\n" "\n" "Defaults to " (scheme (string-constant find-again-menu-item)) ".") +@(defmethod (edit-menu:find-next-string) string? "The result of this method is used as the name of the " (scheme menu-item%) "." "\n" "\n" "Defaults to " (scheme (string-constant find-next-menu-item)) ".") -@(defmethod (edit-menu:find-again-help-string) string? "The result of this method is used as the help string" "\n" "when the " (scheme menu-item%) " object is created." "\n" "\n" "Defaults to " (scheme (string-constant find-again-info)) ".") +@(defmethod (edit-menu:find-next-help-string) string? "The result of this method is used as the help string" "\n" "when the " (scheme menu-item%) " object is created." "\n" "\n" "Defaults to " (scheme (string-constant find-next-info)) ".") -@(defmethod (edit-menu:get-find-again-backwards-item) (or/c false/c (is-a?/c menu-item%)) "This method returns the " (scheme menu-item%) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-find-again-backwards?) ").") +@(defmethod (edit-menu:get-find-previous-item) (or/c false/c (is-a?/c menu-item%)) "This method returns the " (scheme menu-item%) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-find-previous?) ").") -@(defmethod (edit-menu:create-find-again-backwards?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (scheme #f) ".") +@(defmethod (edit-menu:create-find-previous?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (scheme #f) ".") -@(defmethod (edit-menu:find-again-backwards-callback (item (is-a?/c menu-item%)) (control (is-a?/c control-event%))) void? "Defaults to " (schemeblock (void)) " ") +@(defmethod (edit-menu:find-previous-callback (item (is-a?/c menu-item%)) (control (is-a?/c control-event%))) void? "Defaults to " (schemeblock (void)) " ") -@(defmethod (edit-menu:find-again-backwards-on-demand (item (is-a?/c menu-item%))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (schemeblock (send item enable (let ((target (get-edit-target-object))) (and target (is-a? target editor<%>)))))) +@(defmethod (edit-menu:find-previous-on-demand (item (is-a?/c menu-item%))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (schemeblock (send item enable (let ((target (get-edit-target-object))) (and target (is-a? target editor<%>)))))) -@(defmethod (edit-menu:find-again-backwards-string) string? "The result of this method is used as the name of the " (scheme menu-item%) "." "\n" "\n" "Defaults to " (scheme (string-constant find-again-backwards-menu-item)) ".") +@(defmethod (edit-menu:find-previous-string) string? "The result of this method is used as the name of the " (scheme menu-item%) "." "\n" "\n" "Defaults to " (scheme (string-constant find-previous-menu-item)) ".") -@(defmethod (edit-menu:find-again-backwards-help-string) string? "The result of this method is used as the help string" "\n" "when the " (scheme menu-item%) " object is created." "\n" "\n" "Defaults to " (scheme (string-constant find-again-backwards-info)) ".") +@(defmethod (edit-menu:find-previous-help-string) string? "The result of this method is used as the help string" "\n" "when the " (scheme menu-item%) " object is created." "\n" "\n" "Defaults to " (scheme (string-constant find-previous-info)) ".") -@(defmethod (edit-menu:get-replace-and-find-again-item) (or/c false/c (is-a?/c menu-item%)) "This method returns the " (scheme menu-item%) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-replace-and-find-again?) ").") +@(defmethod (edit-menu:get-show/hide-replace-item) (or/c false/c (is-a?/c menu-item%)) "This method returns the " (scheme menu-item%) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-show/hide-replace?) ").") -@(defmethod (edit-menu:create-replace-and-find-again?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (scheme #f) ".") +@(defmethod (edit-menu:create-show/hide-replace?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (scheme #f) ".") -@(defmethod (edit-menu:replace-and-find-again-callback (item (is-a?/c menu-item%)) (control (is-a?/c control-event%))) void? "Defaults to " (schemeblock (void)) " ") +@(defmethod (edit-menu:show/hide-replace-callback (item (is-a?/c menu-item%)) (control (is-a?/c control-event%))) void? "Defaults to " (schemeblock (void)) " ") -@(defmethod (edit-menu:replace-and-find-again-on-demand (item (is-a?/c menu-item%))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (schemeblock (send item enable (let ((target (get-edit-target-object))) (and target (is-a? target editor<%>)))))) +@(defmethod (edit-menu:show/hide-replace-on-demand (menu-item (is-a?/c menu-item%))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (schemeblock (void))) -@(defmethod (edit-menu:replace-and-find-again-string) string? "The result of this method is used as the name of the " (scheme menu-item%) "." "\n" "\n" "Defaults to " (scheme (string-constant replace-and-find-again-menu-item)) ".") +@(defmethod (edit-menu:show/hide-replace-string) string? "The result of this method is used as the name of the " (scheme menu-item%) "." "\n" "\n" "Defaults to " (scheme (string-constant show-replace-menu-item)) ".") -@(defmethod (edit-menu:replace-and-find-again-help-string) string? "The result of this method is used as the help string" "\n" "when the " (scheme menu-item%) " object is created." "\n" "\n" "Defaults to " (scheme (string-constant replace-and-find-again-info)) ".") +@(defmethod (edit-menu:show/hide-replace-help-string) string? "The result of this method is used as the help string" "\n" "when the " (scheme menu-item%) " object is created." "\n" "\n" "Defaults to " (scheme (string-constant show/hide-replace-info)) ".") -@(defmethod (edit-menu:get-replace-and-find-again-backwards-item) (or/c false/c (is-a?/c menu-item%)) "This method returns the " (scheme menu-item%) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-replace-and-find-again-backwards?) ").") +@(defmethod (edit-menu:get-replace-item) (or/c false/c (is-a?/c menu-item%)) "This method returns the " (scheme menu-item%) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-replace?) ").") -@(defmethod (edit-menu:create-replace-and-find-again-backwards?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (scheme #f) ".") +@(defmethod (edit-menu:create-replace?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (scheme #f) ".") -@(defmethod (edit-menu:replace-and-find-again-backwards-callback (item (is-a?/c menu-item%)) (control (is-a?/c control-event%))) void? "Defaults to " (schemeblock (void)) " ") +@(defmethod (edit-menu:replace-callback (item (is-a?/c menu-item%)) (control (is-a?/c control-event%))) void? "Defaults to " (schemeblock (void)) " ") -@(defmethod (edit-menu:replace-and-find-again-backwards-on-demand (item (is-a?/c menu-item%))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (schemeblock (send item enable (let ((target (get-edit-target-object))) (and target (is-a? target editor<%>)))))) +@(defmethod (edit-menu:replace-on-demand (menu-item (is-a?/c menu-item%))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (schemeblock (void))) -@(defmethod (edit-menu:replace-and-find-again-backwards-string) string? "The result of this method is used as the name of the " (scheme menu-item%) "." "\n" "\n" "Defaults to " (scheme (string-constant replace-and-find-again-backwards-menu-item)) ".") +@(defmethod (edit-menu:replace-string) string? "The result of this method is used as the name of the " (scheme menu-item%) "." "\n" "\n" "Defaults to " (scheme (string-constant replace-menu-item)) ".") -@(defmethod (edit-menu:replace-and-find-again-backwards-help-string) string? "The result of this method is used as the help string" "\n" "when the " (scheme menu-item%) " object is created." "\n" "\n" "Defaults to " (scheme (string-constant replace-and-find-again-backwards-info)) ".") +@(defmethod (edit-menu:replace-help-string) string? "The result of this method is used as the help string" "\n" "when the " (scheme menu-item%) " object is created." "\n" "\n" "Defaults to " (scheme (string-constant replace-info)) ".") @(defmethod (edit-menu:get-replace-all-item) (or/c false/c (is-a?/c menu-item%)) "This method returns the " (scheme menu-item%) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-replace-all?) ").") @@ -299,7 +299,7 @@ @(defmethod (edit-menu:replace-all-callback (item (is-a?/c menu-item%)) (control (is-a?/c control-event%))) void? "Defaults to " (schemeblock (void)) " ") -@(defmethod (edit-menu:replace-all-on-demand (item (is-a?/c menu-item%))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (schemeblock (send item enable (let ((target (get-edit-target-object))) (and target (is-a? target editor<%>)))))) +@(defmethod (edit-menu:replace-all-on-demand (menu-item (is-a?/c menu-item%))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (schemeblock (void))) @(defmethod (edit-menu:replace-all-string) string? "The result of this method is used as the name of the " (scheme menu-item%) "." "\n" "\n" "Defaults to " (scheme (string-constant replace-all-menu-item)) ".") diff --git a/collects/string-constants/english-string-constants.ss b/collects/string-constants/english-string-constants.ss index 3a02bf5ed9..0d1f03c844 100644 --- a/collects/string-constants/english-string-constants.ss +++ b/collects/string-constants/english-string-constants.ss @@ -503,6 +503,7 @@ please adhere to these guidelines: ;;; find/replace (search-next "Next") + (search-previous "Prev") (search-match "Match") ;;; this one and the next one are singular/plural variants of each other (search-matches "Matches") (search-replace "Replace") @@ -653,17 +654,18 @@ please adhere to these guidelines: (find-menu-item "Find") ;; menu item (find-info "Toggles the keyboard focus between the window being searched and the search bar") - (find-again-info "Skip to the next occurrence of the string in the find window") - (find-again-menu-item "Find Again") + (find-next-info "Skip to the next occurrence of the string in the find window") + (find-next-menu-item "Find Next") - (find-again-backwards-info "Skip to the previous occurrence of the string in the find window") - (find-again-backwards-menu-item "Find Again Backwards") + (find-previous-info "Skip to the previous occurrence of the string in the find window") + (find-previous-menu-item "Find Previous") - (replace-and-find-again-info "Replace the current text and skip to the next occurrence") - (replace-and-find-again-menu-item "Replace && Find Again") + (show-replace-menu-item "Show Replace") + (hide-replace-menu-item "Hide Replace") + (show/hide-replace-info "Toggles the visibility of the replace panel") - (replace-and-find-again-backwards-info "Replace the current text and skip to the previous occurrence") - (replace-and-find-again-backwards-menu-item "Replace && Find Again Backwards") + (replace-menu-item "Replace") + (replace-info "Replace the search hit in the dark circle") (replace-all-info "Replace all occurrences of the search string") (replace-all-menu-item "Replace All")