diff --git a/collects/framework/private/gen-standard-menus.ss b/collects/framework/private/gen-standard-menus.ss index f9601c83da..bde2184482 100644 --- a/collects/framework/private/gen-standard-menus.ss +++ b/collects/framework/private/gen-standard-menus.ss @@ -1,120 +1,208 @@ +#reader scribble/reader +#lang scheme -(module gen-standard-menus mzscheme - (require mzlib/pretty) - (require mzlib/list) - (require "standard-menus-items.ss") - - ;; build-before-super-item-clause : an-item -> (listof clause) - (define build-before-super-item-clause - (λ (item) - (list - `[define/public ,(an-item->callback-name item) ,(an-item-proc item)] - `(define/public (,(an-item->get-item-name item)) - ,(an-item->item-name item)) - `(define/public (,(an-item->string-name item)) - ,(an-item-menu-string item)) - `(define/public (,(an-item->help-string-name item)) - ,(an-item-help-string item)) - `(define/public ,(an-item->on-demand-name item) ,(an-item-on-demand item)) - `(define/public (,(an-item->create-menu-item-name item)) - ,(an-item-create item))))) - - ;; build-before-super-clause : ((X -> sym) (X sexp) -> X -> (listof clause)) - (define build-before-super-clause - (λ (->name -procedure) - (λ (obj) - (list `(define/public ,(->name obj) - ,(case (-procedure obj) - [(nothing) '(λ (menu) (void))] - [(separator) '(λ (menu) (make-object separator-menu-item% menu))] - [(nothing-with-standard-menus) - '(λ (menu) - (unless (current-eventspace-has-standard-menus?) - (make-object separator-menu-item% menu)))] - [else (error 'gen-standard-menus "unknown between sym: ~e" (-procedure obj))])))))) - - ;; build-before-super-between-clause : between -> (listof clause) - (define build-before-super-between-clause - (build-before-super-clause - between->name - between-procedure)) - - ;; build-before-super-before/after-clause : before/after -> (listof clause) - (define build-before-super-before/after-clause - (build-before-super-clause - before/after->name - before/after-procedure)) - - ;; build-after-super-item-clause : an-item -> (list clause) - (define (build-after-super-item-clause item) - (let* ([callback-name (an-item->callback-name item)] - [create-menu-item-name (an-item->create-menu-item-name item)] - [callback-name-string (symbol->string callback-name)] - [key (an-item-key item)]) - (list `(define - ,(an-item->item-name item) - (and (,create-menu-item-name) - ,(if (a-submenu-item? item) - `(instantiate (get-menu%) () - (label (,(an-item->string-name item))) - (parent ,(menu-item-menu-name item)) - (help-string (,(an-item->help-string-name item))) - (demand-callback (λ (menu-item) (,(an-item->on-demand-name item) menu-item)))) - `(instantiate (get-menu-item%) () - (label (,(an-item->string-name item))) - (parent ,(menu-item-menu-name item)) - (callback (let ([,callback-name (λ (item evt) (,callback-name item evt))]) - ,callback-name)) - (shortcut ,key) - (help-string (,(an-item->help-string-name item))) - (demand-callback (λ (menu-item) (,(an-item->on-demand-name item) menu-item)))))))))) - - ;; build-after-super-clause : ((X -> symbol) -> X -> (listof clause)) - (define build-after-super-clause - (λ (->name) - (λ (between/after) - (list - `(,(->name between/after) - (,(menu-name->get-menu-name between/after))))))) - - ;; build-after-super-between-clause : between -> (listof clause) - (define build-after-super-between-clause (build-after-super-clause between->name)) - ;; build-after-super-before/after-clause : before/after -> (listof clause) - (define build-after-super-before/after-clause (build-after-super-clause before/after->name)) - - ;; build-after-super-generic-clause : generic -> (listof clause) - (define (build-after-super-generic-clause x) - (cond - [(generic-private-field? x) - (list `(define - ,(generic-name x) - ,(generic-initializer x)))] - [(generic-override? x) - (list)] - [(generic-augment? x) - (list)] - [(generic-method? x) - null])) - - ;; build-before-super-generic-clause : generic -> (listof clause) - (define (build-before-super-generic-clause generic) - (cond - [(generic-private-field? generic) - null] - [(generic-override? generic) - (list `(define/override ,(generic-name generic) - ,(generic-initializer generic)))] - [(generic-augment? generic) - (list `(define/augment ,(generic-name generic) - ,(generic-initializer generic)))] - [(generic-method? generic) - (list `(define/public ,(generic-name generic) - ,(generic-initializer generic)))])) - - - (define standard-menus.ss-filename (build-path (collection-path "framework" "private") "standard-menus.ss")) +(require scheme/pretty + scheme/runtime-path) +(require "standard-menus-items.ss") + +(define-runtime-path here ".") + +;; build-before-super-item-clause : an-item -> (listof clause) +(define build-before-super-item-clause + (λ (item) + (list + `[define/public ,(an-item->callback-name item) ,(an-item-proc item)] + `(define/public (,(an-item->get-item-name item)) + ,(an-item->item-name item)) + `(define/public (,(an-item->string-name item)) + ,(an-item-menu-string item)) + `(define/public (,(an-item->help-string-name item)) + ,(an-item-help-string item)) + `(define/public ,(an-item->on-demand-name item) ,(an-item-on-demand item)) + `(define/public (,(an-item->create-menu-item-name item)) + ,(an-item-create item))))) + +;; build-before-super-clause : ((X -> sym) (X sexp) -> X -> (listof clause)) +(define build-before-super-clause + (λ (->name -procedure) + (λ (obj) + (list `(define/public ,(->name obj) + ,(case (-procedure obj) + [(nothing) '(λ (menu) (void))] + [(separator) '(λ (menu) (make-object separator-menu-item% menu))] + [(nothing-with-standard-menus) + '(λ (menu) + (unless (current-eventspace-has-standard-menus?) + (make-object separator-menu-item% menu)))] + [else (error 'gen-standard-menus "unknown between sym: ~e" (-procedure obj))])))))) + +;; build-before-super-between-clause : between -> (listof clause) +(define build-before-super-between-clause + (build-before-super-clause + between->name + between-procedure)) + +;; build-before-super-before/after-clause : before/after -> (listof clause) +(define build-before-super-before/after-clause + (build-before-super-clause + before/after->name + before/after-procedure)) + +;; build-after-super-item-clause : an-item -> (list clause) +(define (build-after-super-item-clause item) + (let* ([callback-name (an-item->callback-name item)] + [create-menu-item-name (an-item->create-menu-item-name item)] + [callback-name-string (symbol->string callback-name)] + [key (an-item-shortcut item)]) + (list `(define + ,(an-item->item-name item) + (and (,create-menu-item-name) + ,(if (a-submenu-item? item) + `(new (get-menu%) + (label (,(an-item->string-name item))) + (parent ,(menu-item-menu-name item)) + (help-string (,(an-item->help-string-name item))) + (demand-callback (λ (menu-item) (,(an-item->on-demand-name item) menu-item)))) + `(new (get-menu-item%) + (label (,(an-item->string-name item))) + (parent ,(menu-item-menu-name item)) + (callback (let ([,callback-name (λ (item evt) (,callback-name item evt))]) + ,callback-name)) + (shortcut ,key) + (shortcut-prefix ,(an-item-shortcut-prefix item)) + (help-string (,(an-item->help-string-name item))) + (demand-callback (λ (menu-item) (,(an-item->on-demand-name item) menu-item)))))))))) + +;; build-after-super-clause : ((X -> symbol) -> X -> (listof clause)) +(define build-after-super-clause + (λ (->name) + (λ (between/after) + (list + `(,(->name between/after) + (,(menu-name->get-menu-name between/after))))))) + +;; build-after-super-between-clause : between -> (listof clause) +(define build-after-super-between-clause (build-after-super-clause between->name)) +;; build-after-super-before/after-clause : before/after -> (listof clause) +(define build-after-super-before/after-clause (build-after-super-clause before/after->name)) + +;; build-after-super-generic-clause : generic -> (listof clause) +(define (build-after-super-generic-clause x) + (cond + [(generic-private-field? x) + (list `(define + ,(generic-name x) + ,(generic-initializer x)))] + [(generic-override? x) + (list)] + [(generic-augment? x) + (list)] + [(generic-method? x) + null])) + +;; build-before-super-generic-clause : generic -> (listof clause) +(define (build-before-super-generic-clause generic) + (cond + [(generic-private-field? generic) + null] + [(generic-override? generic) + (list `(define/override ,(generic-name generic) + ,(generic-initializer generic)))] + [(generic-augment? generic) + (list `(define/augment ,(generic-name generic) + ,(generic-initializer generic)))] + [(generic-method? generic) + (list `(define/public ,(generic-name generic) + ,(generic-initializer generic)))])) + +(define standard-menus.ss-filename (build-path here "standard-menus.ss")) +(define docs-menus.ss-filename (simplify-path (build-path here 'up 'up "scribblings" "framework" "standard-menus.scrbl"))) + +(define (main) + (write-standard-menus.ss) + (write-docs)) + +(define (write-docs) + (printf "writing to ~a~n" docs-menus.ss-filename) + (call-with-output-file docs-menus.ss-filename + (λ (port) + (define (pop-out sexp) + (display "@" port) + (write sexp port) + (newline port) + (newline port)) + (display docs-header-text port) + (for-each (λ (x) + (cond + [(generic/docs? x) + (for-each + (λ (x) (unless (string? x) (pop-out x))) + (generic/docs-documentation x))] + [(before/after? x) + (pop-out + `@defmethod[(,(before/after->name x) [menu (is-a?/c menu-item%)]) void?]{ + This method is called @,(if (before? x) "before" "after") the addition of the + @tt[,(format "~a" (before/after-name x))] menu-item. Override it to add additional + menu items at that point. })] + [(between? x) + (pop-out + `@defmethod[(,(between->name x) [menu (is-a?/c menu-item%)]) void?]{ + This method is called between the addition of the + @tt[,(format "~a" (between-before x))] and the @tt[,(format "~a" (between-after x))] menu-item. + Override it to add additional menu items at that point. })] + [(an-item? x) + (pop-out + `@defmethod[(,(an-item->get-item-name x)) (or/c false/c (is-a?/c menu-item%))]{ + This method returns the @scheme[menu-item%] object corresponding + to this menu item, if it has been created (as controlled by + @method[frame:standard-menus<%> ,(an-item->create-menu-item-name x)]).}) + + (pop-out + `@defmethod[(,(an-item->create-menu-item-name x)) boolean?]{ + The result of this method determines if the corresponding + menu item is created. Override it to control the creation of the menu item. + + Defaults to @scheme[,(an-item-create x)].}) + + (match (an-item-proc x) + [`(λ (,item-name ,evt-name) ,bodies ...) + (pop-out + `@defmethod[(,(an-item->callback-name x) + [,item-name (is-a?/c menu-item%)] + [,evt-name (is-a?/c control-event%)]) + void?]{ + Defaults to @schemeblock[,(if (= 1 (length bodies)) + (car bodies) + `(begin ,@bodies))] })]) + + (match (an-item-on-demand x) + [`(λ (,item-name) ,body) + (pop-out + `@defmethod[(,(an-item->on-demand-name x) [,item-name (is-a?/c menu-item%)]) void?]{ + The menu item's on-demand proc calls this method. + + Defaults to @schemeblock[,body]})]) + + (pop-out + `@defmethod[(,(an-item->string-name x)) string?]{ + The result of this method is used as the name of the @scheme[menu-item%]. + + Defaults to @scheme[,(an-item-menu-string x)].}) + + (pop-out + `@defmethod[(,(an-item->help-string-name x)) string?]{ + The result of this method is used as the help string + when the @scheme[menu-item%] object is created. + + Defaults to @scheme[,(an-item-help-string x)].})])) + + items) + (display docs-footer-text port)) + #:exists 'truncate)) + +(define (write-standard-menus.ss) (printf "writing to ~a~n" standard-menus.ss-filename) - + (call-with-output-file standard-menus.ss-filename (λ (port) (pretty-print @@ -182,5 +270,16 @@ items)) (reorder-menus this))) port)) - 'text - 'truncate)) + #:mode 'text + #:exists 'truncate)) + + +(define docs-footer-text "}") + +(define docs-header-text #<<-- +;; THIS FILE IS GENERATED. DO NOT EDIT. + +@definterface[frame:standard-menus<%> (frame:basic<%>)]{ + +-- +) \ No newline at end of file diff --git a/collects/framework/private/standard-menus-items.ss b/collects/framework/private/standard-menus-items.ss index ef95607124..7f51a95ade 100644 --- a/collects/framework/private/standard-menus-items.ss +++ b/collects/framework/private/standard-menus-items.ss @@ -1,387 +1,399 @@ -(module standard-menus-items mzscheme +#reader scribble/reader +#lang scheme/base - (provide - (struct generic (name initializer)) - - (struct generic/docs (documentation)) - - (struct generic-override ()) - (struct generic-augment ()) - (struct generic-method ()) - (struct generic-private-field ()) - - (struct menu-item (menu-name)) - menu-name->get-menu-name ;; : menu-item -> symbol - - (struct before/after (name procedure)) - (struct before ()) - (struct after ()) - - (struct between (before after procedure)) - - (struct an-item (item-name help-string proc key menu-string on-demand create)) - (struct a-submenu-item ()) - - ;; an-item -> symbol - ;; calcualates the names of various identifiers associated with the item. - an-item->callback-name - an-item->create-menu-item-name - an-item->get-item-name - an-item->item-name - an-item->on-demand-name - an-item->string-name - an-item->help-string-name - - before/after->name - between->name - - items) - - (define-struct generic (name initializer)) - (define-struct (generic/docs generic) (documentation)) - (define-struct (generic-override generic/docs) ()) - (define-struct (generic-augment generic/docs) ()) - (define-struct (generic-method generic/docs) ()) - (define-struct (generic-private-field generic) ()) - - (define-struct menu-item (menu-name)) - (define (menu-name->get-menu-name menu-item) - (string->symbol - (format "get-~a" (menu-item-menu-name menu-item)))) - - (define-struct (before/after menu-item) (name procedure)) - (define-struct (before before/after) ()) - (define-struct (after before/after) ()) - (define (before/after->name before/after) - (string->symbol (format "~a:~a-~a" - (menu-item-menu-name before/after) - (if (before? before/after) - "before" - "after") - (before/after-name before/after)))) - - (define-struct (between menu-item) (before after procedure)) - (define (between->name between) - (string->symbol (format "~a:between-~a-and-~a" - (menu-item-menu-name between) - (between-before between) - (between-after between)))) - - (define-struct (an-item menu-item) - (item-name - help-string - proc - key - menu-string - on-demand - create)) - (define-struct (a-submenu-item an-item) ()) - - (define (an-item->callback-name item) - (string->symbol - (format "~a:~a-callback" (menu-item-menu-name item) (an-item-item-name item)))) - (define (an-item->create-menu-item-name item) - (string->symbol - (format "~a:create-~a?" (menu-item-menu-name item) (an-item-item-name item)))) - (define (an-item->get-item-name item) - (string->symbol - (format "~a:get-~a-item" (menu-item-menu-name item) (an-item-item-name item)))) - (define (an-item->item-name item) - (string->symbol - (format "~a:~a-item" (menu-item-menu-name item) (an-item-item-name item)))) - (define (an-item->on-demand-name item) - (string->symbol - (format "~a:~a-on-demand" (menu-item-menu-name item) (an-item-item-name item)))) - (define (an-item->string-name item) - (string->symbol - (format "~a:~a-string" (menu-item-menu-name item) (an-item-item-name item)))) - (define (an-item->help-string-name item) - (string->symbol - (format "~a:~a-help-string" (menu-item-menu-name item) (an-item-item-name item)))) - - (define (edit-menu:do const) - `(λ (menu evt) - (let ([edit (get-edit-target-object)]) - (when (and edit - (is-a? edit editor<%>)) - (send edit do-edit-operation ',const))) - #t)) - - (define (edit-menu:can-do-on-demand const) - `(λ (item) - (let* ([editor (get-edit-target-object)] - [enable? - (and editor - (is-a? editor editor<%>) - (send editor can-do-edit-operation? ',const))]) - (send item enable enable?)))) - - (define edit-menu:edit-target-on-demand - `(λ (item) - (send item enable - (let ([target (get-edit-target-object)]) - (and target (is-a? target editor<%>)))))) - - (define on-demand-do-nothing '(λ (menu-item) (void))) +(provide + (struct-out generic) + + (struct-out generic/docs) + + (struct-out generic-override) + (struct-out generic-augment) + (struct-out generic-method) + (struct-out generic-private-field) + + (struct-out menu-item) + menu-name->get-menu-name ;; : menu-item -> symbol + + (struct-out before/after) + (struct-out before) + (struct-out after) + + (struct-out between) + + (struct-out an-item) + (struct-out a-submenu-item) + + ;; an-item -> symbol + ;; calcualates the names of various identifiers associated with the item. + an-item->callback-name + an-item->create-menu-item-name + an-item->get-item-name + an-item->item-name + an-item->on-demand-name + an-item->string-name + an-item->help-string-name + + before/after->name + between->name + + items) - (define items - (list (make-generic-augment - 'on-close - '(lambda () - (remove-prefs-callback) - (inner (void) on-close)) - '("@return : void" - "Removes the preferences callbacks for the menu items")) - (make-generic-method - 'get-menu% '(λ () menu:can-restore-underscore-menu%) - '("The result of this method is used as the class" - "for creating the result of these methods:" - "@ilink frame:standard-menus get-file-menu %" - ", " - "@ilink frame:standard-menus get-edit-menu %" - ", " - "@ilink frame:standard-menus get-help-menu %" - ". " - "" - "@return : (derived-from \\iscmclass{menu:can-restore-underscore-menu})" - "" - "defaultly returns" - "@link menu")) - (make-generic-method - 'get-menu-item% '(λ () menu:can-restore-menu-item%) - '("The result of this method is used as the class for creating" - "the menu items in this frame (see " - "@link frame:standard-menus" - "for a list)." - "" - "@return : (derived-from \\iscmclass{menu-item})" - "" - "defaultly returns" - "@link menu:can-restore-menu-item %" - ".")) - (make-generic-method - 'get-checkable-menu-item% '(λ () menu:can-restore-checkable-menu-item%) - '("The result of this method is used as the class for creating" - "checkable menu items in this class (see " - "@link frame:standard-menus" - "for a list)." - "" - "@return : (derived-from \\iscmclass{checkable-menu-item})" - "" - "defaultly returns" - "@link menu:can-restore-checkable-menu-item %" - ".")) - - (make-generic-method - 'get-file-menu - '(λ () file-menu) - '("Returns the file menu" - "See also" - "@ilink frame:standard-menus get-menu\\%" - "" - "@return : (instance (derived-from \\iscmclass{menu}))")) - (make-generic-private-field - 'file-menu - '(make-object (get-menu%) - (string-constant file-menu-label) - (get-menu-bar))) - (make-generic-method - 'get-edit-menu - '(λ () edit-menu) - - '("Returns the edit menu" - "See also" - "@ilink frame:standard-menus get-menu\\%" - "" - "@return : (instance (derived-from \\iscmclass{menu}))")) - (make-generic-private-field - 'edit-menu - '(make-object (get-menu%) (string-constant edit-menu-label) (get-menu-bar))) - (make-generic-method - 'get-help-menu - '(λ () help-menu) - - '("Returns the help menu" - "See also" - "@ilink frame:standard-menus get-menu\\%" - "" - "@return : (instance (derived-from \\iscmclass{menu}))")) - (make-generic-private-field - 'help-menu - '(make-object (get-menu%) (string-constant help-menu-label) (get-menu-bar))) - - (make-an-item 'file-menu 'new - '(string-constant new-info) - '(λ (item control) (handler:edit-file #f) #t) - #\n - '(string-constant new-menu-item) - on-demand-do-nothing - #t) - (make-between 'file-menu 'new 'open 'nothing) - (make-an-item 'file-menu 'open '(string-constant open-info) - '(λ (item control) (handler:open-file) #t) - #\o - '(string-constant open-menu-item) - on-demand-do-nothing - #t) - (make-a-submenu-item 'file-menu 'open-recent - '(string-constant open-recent-info) - '(λ (x y) (void)) - #f - '(string-constant open-recent-menu-item) - '(λ (menu) - (handler:install-recent-items menu)) - #t) - (make-between 'file-menu 'open 'revert 'nothing) - (make-an-item 'file-menu 'revert - '(string-constant revert-info) - '(λ (item control) (void)) - #f - '(string-constant revert-menu-item) - on-demand-do-nothing - #f) - (make-between 'file-menu 'revert 'save 'nothing) - (make-an-item 'file-menu 'save - '(string-constant save-info) - '(λ (item control) (void)) - #\s - '(string-constant save-menu-item) - on-demand-do-nothing - #f) - (make-an-item 'file-menu 'save-as - '(string-constant save-as-info) - '(λ (item control) (void)) - #f - '(string-constant save-as-menu-item) - on-demand-do-nothing - #f) - (make-between 'file-menu 'save-as 'print 'nothing) - (make-an-item 'file-menu 'print - '(string-constant print-info) - '(λ (item control) (void)) - #\p - '(string-constant print-menu-item) - on-demand-do-nothing - #f) - (make-between 'file-menu 'print 'close 'separator) - (make-an-item 'file-menu 'close - '(string-constant close-info) - '(λ (item control) (when (can-close?) (on-close) (show #f)) #t) - #\w - '(string-constant close-menu-item) - on-demand-do-nothing - #t) - (make-between 'file-menu 'close 'quit 'nothing) - (make-an-item 'file-menu 'quit - '(string-constant quit-info) - '(λ (item control) - (when (exit:user-oks-exit) - (exit:exit))) - #\q - '(if (eq? (system-type) 'windows) - (string-constant quit-menu-item-windows) - (string-constant quit-menu-item-others)) - on-demand-do-nothing - '(not (current-eventspace-has-standard-menus?))) - (make-after 'file-menu 'quit 'nothing) - - (make-an-item 'edit-menu 'undo - '(string-constant undo-info) - (edit-menu:do 'undo) - #\z - '(string-constant undo-menu-item) - (edit-menu:can-do-on-demand 'undo) - #t) - (make-an-item 'edit-menu 'redo - '(string-constant redo-info) - (edit-menu:do 'redo) - #\y - '(string-constant redo-menu-item) - (edit-menu:can-do-on-demand 'redo) - #t) - (make-between 'edit-menu 'redo 'cut 'separator) - (make-an-item 'edit-menu 'cut '(string-constant cut-info) - (edit-menu:do 'cut) - #\x - '(string-constant cut-menu-item) - (edit-menu:can-do-on-demand 'cut) - #t) - (make-between 'edit-menu 'cut 'copy 'nothing) - (make-an-item 'edit-menu 'copy - '(string-constant copy-info) - (edit-menu:do 'copy) - #\c - '(string-constant copy-menu-item) - (edit-menu:can-do-on-demand 'copy) - #t) - (make-between 'edit-menu 'copy 'paste 'nothing) - (make-an-item 'edit-menu 'paste - '(string-constant paste-info) - (edit-menu:do 'paste) - #\v - '(string-constant paste-menu-item) - (edit-menu:can-do-on-demand 'paste) - #t) - (make-between 'edit-menu 'paste 'clear 'nothing) - (make-an-item 'edit-menu 'clear - '(string-constant clear-info) - (edit-menu:do 'clear) - #f - '(if (eq? (system-type) 'windows) - (string-constant clear-menu-item-windows) - (string-constant clear-menu-item-windows)) - (edit-menu:can-do-on-demand 'clear) - #t) - (make-between 'edit-menu 'clear 'select-all 'nothing) - (make-an-item 'edit-menu 'select-all - '(string-constant select-all-info) - (edit-menu:do 'select-all) - #\a - '(string-constant select-all-menu-item) - (edit-menu:can-do-on-demand 'select-all) - #t) - (make-between 'edit-menu 'select-all 'find 'separator) +(define-struct generic (name initializer)) +(define-struct (generic/docs generic) (documentation)) +(define-struct (generic-override generic/docs) ()) +(define-struct (generic-augment generic/docs) ()) +(define-struct (generic-method generic/docs) ()) +(define-struct (generic-private-field generic) ()) - (make-an-item 'edit-menu 'find - '(string-constant find-info) - '(λ (item control) (void)) - #\f - '(string-constant find-menu-item) - edit-menu:edit-target-on-demand - #f) - (make-an-item 'edit-menu 'find-again - '(string-constant find-again-info) - '(λ (item control) (void)) - #\g - '(string-constant find-again-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)) - '(if (eq? (system-type) 'macosx) #f #\h) - '(string-constant replace-and-find-again-menu-item) - edit-menu:edit-target-on-demand - #f) - - (make-between 'edit-menu 'find 'preferences 'nothing-with-standard-menus) - (make-an-item 'edit-menu 'preferences - '(string-constant preferences-info) - '(λ (item control) (preferences:show-dialog) #t) - '(case (system-type) - [(macosx) #\,] - [else #\;]) - '(string-constant preferences-menu-item) - on-demand-do-nothing - '(not (current-eventspace-has-standard-menus?))) - (make-after 'edit-menu 'preferences 'nothing) - - (make-before 'help-menu 'about 'nothing) - (make-an-item 'help-menu 'about - '(string-constant about-info) - '(λ (item control) (void)) - #f - '(string-constant about-menu-item) - on-demand-do-nothing - #f) - (make-after 'help-menu 'about 'nothing)))) +(define-struct menu-item (menu-name)) +(define (menu-name->get-menu-name menu-item) + (string->symbol + (format "get-~a" (menu-item-menu-name menu-item)))) + +(define-struct (before/after menu-item) (name procedure)) +(define-struct (before before/after) ()) +(define-struct (after before/after) ()) +(define (before/after->name before/after) + (string->symbol (format "~a:~a-~a" + (menu-item-menu-name before/after) + (if (before? before/after) + "before" + "after") + (before/after-name before/after)))) + +(define-struct (between menu-item) (before after procedure)) +(define (between->name between) + (string->symbol (format "~a:between-~a-and-~a" + (menu-item-menu-name between) + (between-before between) + (between-after between)))) + +(define-struct (an-item menu-item) + (item-name + help-string + proc + shortcut + shortcut-prefix + menu-string + on-demand + create)) +(define-struct (a-submenu-item an-item) ()) + +(define (an-item->callback-name item) + (string->symbol + (format "~a:~a-callback" (menu-item-menu-name item) (an-item-item-name item)))) +(define (an-item->create-menu-item-name item) + (string->symbol + (format "~a:create-~a?" (menu-item-menu-name item) (an-item-item-name item)))) +(define (an-item->get-item-name item) + (string->symbol + (format "~a:get-~a-item" (menu-item-menu-name item) (an-item-item-name item)))) +(define (an-item->item-name item) + (string->symbol + (format "~a:~a-item" (menu-item-menu-name item) (an-item-item-name item)))) +(define (an-item->on-demand-name item) + (string->symbol + (format "~a:~a-on-demand" (menu-item-menu-name item) (an-item-item-name item)))) +(define (an-item->string-name item) + (string->symbol + (format "~a:~a-string" (menu-item-menu-name item) (an-item-item-name item)))) +(define (an-item->help-string-name item) + (string->symbol + (format "~a:~a-help-string" (menu-item-menu-name item) (an-item-item-name item)))) + +(define (edit-menu:do const) + `(λ (menu evt) + (let ([edit (get-edit-target-object)]) + (when (and edit + (is-a? edit editor<%>)) + (send edit do-edit-operation ',const))) + #t)) + +(define (edit-menu:can-do-on-demand const) + `(λ (item) + (let* ([editor (get-edit-target-object)] + [enable? + (and editor + (is-a? editor editor<%>) + (send editor can-do-edit-operation? ',const))]) + (send item enable enable?)))) + +(define edit-menu:edit-target-on-demand + `(λ (item) + (send item enable + (let ([target (get-edit-target-object)]) + (and target (is-a? target editor<%>)))))) + +(define on-demand-do-nothing '(λ (menu-item) (void))) + +(define items + (list (make-generic-augment + 'on-close + '(λ () + (remove-prefs-callback) + (inner (void) on-close)) + (list + '@defmethod[(on-close) void?]{ + Removes the preferences callbacks for the menu items + })) + (make-generic-method + 'get-menu% '(λ () menu:can-restore-underscore-menu%) + (list + '@defmethod[(get-menu%) + (is-a?/c menu:can-restore-underscore-menu%)]{ + The result of this method is used as the class + for creating the result of these methods: + @method[frame:standard-menus get-file-menu], + @method[frame:standard-menus get-edit-menu], and + @method[frame:standard-menus get-help-menu].})) + (make-generic-method + 'get-menu-item% '(λ () menu:can-restore-menu-item%) + (list + '@defmethod[(get-menu-item%) (is-a?/c menu:can-restore-menu-item%)]{ + The result of this method is used as the class for creating + the menu items in this frame. + + Defaultly returns @scheme[menu:can-restore-menu-item].})) + (make-generic-method + 'get-checkable-menu-item% '(λ () menu:can-restore-checkable-menu-item%) + (list + '@defmethod[(get-checkable-menu-item%) (is-a?/c menu:can-restore-checkable-menu-item%)]{ + The result of this method is used as the class for creating + checkable menu items in this class. + + Defaultly returns @scheme[menu:can-restore-checkable-menu-item].})) + + (make-generic-method + 'get-file-menu + '(λ () file-menu) + (list + '@defmethod[(get-file-menu) (is-a?/c menu%)]{ + Returns the file menu. + See also @method[frame:standard-menus<%> get-menu%].})) + + (make-generic-private-field + 'file-menu + '(make-object (get-menu%) + (string-constant file-menu-label) + (get-menu-bar))) + (make-generic-method + 'get-edit-menu + '(λ () edit-menu) + (list + '@defmethod[(get-edit-menu) (is-a?/c menu%)]{ + Returns the edit menu. + See also @method[frame:standard-menus<%> get-menu%].})) + (make-generic-private-field + 'edit-menu + '(make-object (get-menu%) (string-constant edit-menu-label) (get-menu-bar))) + (make-generic-method + 'get-help-menu + '(λ () help-menu) + (list + '@defmethod[(get-help-menu) (is-a?/c menu%)]{ + Returns the help menu. + See also @method[frame:standard-menus<%> get-menu%].})) + (make-generic-private-field + 'help-menu + '(make-object (get-menu%) (string-constant help-menu-label) (get-menu-bar))) + + (make-an-item 'file-menu 'new + '(string-constant new-info) + '(λ (item control) (handler:edit-file #f) #t) + #\n + '(get-default-shortcut-prefix) + '(string-constant new-menu-item) + on-demand-do-nothing + #t) + (make-between 'file-menu 'new 'open 'nothing) + (make-an-item 'file-menu 'open '(string-constant open-info) + '(λ (item control) (handler:open-file) #t) + #\o + '(get-default-shortcut-prefix) + '(string-constant open-menu-item) + on-demand-do-nothing + #t) + (make-a-submenu-item 'file-menu 'open-recent + '(string-constant open-recent-info) + '(λ (x y) (void)) + #f + '(get-default-shortcut-prefix) + '(string-constant open-recent-menu-item) + '(λ (menu) + (handler:install-recent-items menu)) + #t) + (make-between 'file-menu 'open 'revert 'nothing) + (make-an-item 'file-menu 'revert + '(string-constant revert-info) + '(λ (item control) (void)) + #f + '(get-default-shortcut-prefix) + '(string-constant revert-menu-item) + on-demand-do-nothing + #f) + (make-between 'file-menu 'revert 'save 'nothing) + (make-an-item 'file-menu 'save + '(string-constant save-info) + '(λ (item control) (void)) + #\s + '(get-default-shortcut-prefix) + '(string-constant save-menu-item) + on-demand-do-nothing + #f) + (make-an-item 'file-menu 'save-as + '(string-constant save-as-info) + '(λ (item control) (void)) + #f + '(get-default-shortcut-prefix) + '(string-constant save-as-menu-item) + on-demand-do-nothing + #f) + (make-between 'file-menu 'save-as 'print 'nothing) + (make-an-item 'file-menu 'print + '(string-constant print-info) + '(λ (item control) (void)) + #\p + '(get-default-shortcut-prefix) + '(string-constant print-menu-item) + on-demand-do-nothing + #f) + (make-between 'file-menu 'print 'close 'separator) + (make-an-item 'file-menu 'close + '(string-constant close-info) + '(λ (item control) (when (can-close?) (on-close) (show #f)) #t) + #\w + '(get-default-shortcut-prefix) + '(string-constant close-menu-item) + on-demand-do-nothing + #t) + (make-between 'file-menu 'close 'quit 'nothing) + (make-an-item 'file-menu 'quit + '(string-constant quit-info) + '(λ (item control) + (when (exit:user-oks-exit) + (exit:exit))) + #\q + '(get-default-shortcut-prefix) + '(if (eq? (system-type) 'windows) + (string-constant quit-menu-item-windows) + (string-constant quit-menu-item-others)) + on-demand-do-nothing + '(not (current-eventspace-has-standard-menus?))) + (make-after 'file-menu 'quit 'nothing) + + (make-an-item 'edit-menu 'undo + '(string-constant undo-info) + (edit-menu:do 'undo) + #\z + '(get-default-shortcut-prefix) + '(string-constant undo-menu-item) + (edit-menu:can-do-on-demand 'undo) + #t) + (make-an-item 'edit-menu 'redo + '(string-constant redo-info) + (edit-menu:do 'redo) + '(if (eq? (system-type) 'macosx) + #\z + #\y) + '(if (eq? (system-type) 'macosx) + (cons 'shift (get-default-shortcut-prefix)) + (get-default-shortcut-prefix)) + '(string-constant redo-menu-item) + (edit-menu:can-do-on-demand 'redo) + #t) + (make-between 'edit-menu 'redo 'cut 'separator) + (make-an-item 'edit-menu 'cut '(string-constant cut-info) + (edit-menu:do 'cut) + #\x + '(get-default-shortcut-prefix) + '(string-constant cut-menu-item) + (edit-menu:can-do-on-demand 'cut) + #t) + (make-between 'edit-menu 'cut 'copy 'nothing) + (make-an-item 'edit-menu 'copy + '(string-constant copy-info) + (edit-menu:do 'copy) + #\c + '(get-default-shortcut-prefix) + '(string-constant copy-menu-item) + (edit-menu:can-do-on-demand 'copy) + #t) + (make-between 'edit-menu 'copy 'paste 'nothing) + (make-an-item 'edit-menu 'paste + '(string-constant paste-info) + (edit-menu:do 'paste) + #\v + '(get-default-shortcut-prefix) + '(string-constant paste-menu-item) + (edit-menu:can-do-on-demand 'paste) + #t) + (make-between 'edit-menu 'paste 'clear 'nothing) + (make-an-item 'edit-menu 'clear + '(string-constant clear-info) + (edit-menu:do 'clear) + #f + '(get-default-shortcut-prefix) + '(if (eq? (system-type) 'windows) + (string-constant clear-menu-item-windows) + (string-constant clear-menu-item-windows)) + (edit-menu:can-do-on-demand 'clear) + #t) + (make-between 'edit-menu 'clear 'select-all 'nothing) + (make-an-item 'edit-menu 'select-all + '(string-constant select-all-info) + (edit-menu:do 'select-all) + #\a + '(get-default-shortcut-prefix) + '(string-constant select-all-menu-item) + (edit-menu:can-do-on-demand 'select-all) + #t) + (make-between 'edit-menu 'select-all 'find 'separator) + + (make-an-item 'edit-menu 'find + '(string-constant find-info) + '(λ (item control) (void)) + #\f + '(get-default-shortcut-prefix) + '(string-constant find-menu-item) + edit-menu:edit-target-on-demand + #f) + (make-an-item 'edit-menu 'find-again + '(string-constant find-again-info) + '(λ (item control) (void)) + #\g + '(get-default-shortcut-prefix) + '(string-constant find-again-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)) + '(if (eq? (system-type) 'macosx) #f #\h) + '(get-default-shortcut-prefix) + '(string-constant replace-and-find-again-menu-item) + edit-menu:edit-target-on-demand + #f) + + (make-between 'edit-menu 'find 'preferences 'nothing-with-standard-menus) + (make-an-item 'edit-menu 'preferences + '(string-constant preferences-info) + '(λ (item control) (preferences:show-dialog) #t) + '(case (system-type) + [(macosx) #\,] + [else #\;]) + '(get-default-shortcut-prefix) + '(string-constant preferences-menu-item) + on-demand-do-nothing + '(not (current-eventspace-has-standard-menus?))) + (make-after 'edit-menu 'preferences 'nothing) + + (make-before 'help-menu 'about 'nothing) + (make-an-item 'help-menu 'about + '(string-constant about-info) + '(λ (item control) (void)) + #f + '(get-default-shortcut-prefix) + '(string-constant about-menu-item) + on-demand-do-nothing + #f) + (make-after 'help-menu 'about 'nothing))) \ No newline at end of file diff --git a/collects/framework/private/standard-menus.ss b/collects/framework/private/standard-menus.ss index fb6834fd21..718dae4511 100644 --- a/collects/framework/private/standard-menus.ss +++ b/collects/framework/private/standard-menus.ss @@ -1,155 +1,155 @@ (define standard-menus<%> (interface - (basic<%>) - get-menu% - get-menu-item% - get-checkable-menu-item% - get-file-menu - get-edit-menu - get-help-menu - file-menu:new-callback - file-menu:get-new-item - file-menu:new-string - file-menu:new-help-string - file-menu:new-on-demand - file-menu:create-new? - file-menu:between-new-and-open - file-menu:open-callback - file-menu:get-open-item - file-menu:open-string - file-menu:open-help-string - file-menu:open-on-demand - file-menu:create-open? - file-menu:open-recent-callback - file-menu:get-open-recent-item - file-menu:open-recent-string - file-menu:open-recent-help-string - file-menu:open-recent-on-demand - file-menu:create-open-recent? - file-menu:between-open-and-revert - file-menu:revert-callback - file-menu:get-revert-item - file-menu:revert-string - file-menu:revert-help-string - file-menu:revert-on-demand - file-menu:create-revert? - file-menu:between-revert-and-save - file-menu:save-callback - file-menu:get-save-item - file-menu:save-string - file-menu:save-help-string - file-menu:save-on-demand - file-menu:create-save? - file-menu:save-as-callback - file-menu:get-save-as-item - file-menu:save-as-string - file-menu:save-as-help-string - file-menu:save-as-on-demand - file-menu:create-save-as? - file-menu:between-save-as-and-print - file-menu:print-callback - file-menu:get-print-item - file-menu:print-string - file-menu:print-help-string - file-menu:print-on-demand - file-menu:create-print? - file-menu:between-print-and-close - file-menu:close-callback - file-menu:get-close-item - file-menu:close-string - file-menu:close-help-string - file-menu:close-on-demand - file-menu:create-close? - file-menu:between-close-and-quit - file-menu:quit-callback - file-menu:get-quit-item - file-menu:quit-string - file-menu:quit-help-string - file-menu:quit-on-demand - file-menu:create-quit? - file-menu:after-quit - edit-menu:undo-callback - edit-menu:get-undo-item - edit-menu:undo-string - edit-menu:undo-help-string - edit-menu:undo-on-demand - edit-menu:create-undo? - edit-menu:redo-callback - edit-menu:get-redo-item - edit-menu:redo-string - edit-menu:redo-help-string - edit-menu:redo-on-demand - edit-menu:create-redo? - edit-menu:between-redo-and-cut - edit-menu:cut-callback - edit-menu:get-cut-item - edit-menu:cut-string - edit-menu:cut-help-string - edit-menu:cut-on-demand - edit-menu:create-cut? - edit-menu:between-cut-and-copy - edit-menu:copy-callback - edit-menu:get-copy-item - edit-menu:copy-string - edit-menu:copy-help-string - edit-menu:copy-on-demand - edit-menu:create-copy? - edit-menu:between-copy-and-paste - edit-menu:paste-callback - edit-menu:get-paste-item - edit-menu:paste-string - edit-menu:paste-help-string - edit-menu:paste-on-demand - edit-menu:create-paste? - edit-menu:between-paste-and-clear - edit-menu:clear-callback - edit-menu:get-clear-item - edit-menu:clear-string - edit-menu:clear-help-string - edit-menu:clear-on-demand - edit-menu:create-clear? - edit-menu:between-clear-and-select-all - edit-menu:select-all-callback - edit-menu:get-select-all-item - edit-menu:select-all-string - edit-menu:select-all-help-string - edit-menu:select-all-on-demand - edit-menu:create-select-all? - edit-menu:between-select-all-and-find - edit-menu:find-callback - edit-menu:get-find-item - edit-menu:find-string - 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: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:between-find-and-preferences - edit-menu:preferences-callback - edit-menu:get-preferences-item - edit-menu:preferences-string - edit-menu:preferences-help-string - edit-menu:preferences-on-demand - edit-menu:create-preferences? - edit-menu:after-preferences - help-menu:before-about - help-menu:about-callback - help-menu:get-about-item - help-menu:about-string - help-menu:about-help-string - help-menu:about-on-demand - help-menu:create-about? - help-menu:after-about)) + (basic<%>) + get-menu% + get-menu-item% + get-checkable-menu-item% + get-file-menu + get-edit-menu + get-help-menu + file-menu:new-callback + file-menu:get-new-item + file-menu:new-string + file-menu:new-help-string + file-menu:new-on-demand + file-menu:create-new? + file-menu:between-new-and-open + file-menu:open-callback + file-menu:get-open-item + file-menu:open-string + file-menu:open-help-string + file-menu:open-on-demand + file-menu:create-open? + file-menu:open-recent-callback + file-menu:get-open-recent-item + file-menu:open-recent-string + file-menu:open-recent-help-string + file-menu:open-recent-on-demand + file-menu:create-open-recent? + file-menu:between-open-and-revert + file-menu:revert-callback + file-menu:get-revert-item + file-menu:revert-string + file-menu:revert-help-string + file-menu:revert-on-demand + file-menu:create-revert? + file-menu:between-revert-and-save + file-menu:save-callback + file-menu:get-save-item + file-menu:save-string + file-menu:save-help-string + file-menu:save-on-demand + file-menu:create-save? + file-menu:save-as-callback + file-menu:get-save-as-item + file-menu:save-as-string + file-menu:save-as-help-string + file-menu:save-as-on-demand + file-menu:create-save-as? + file-menu:between-save-as-and-print + file-menu:print-callback + file-menu:get-print-item + file-menu:print-string + file-menu:print-help-string + file-menu:print-on-demand + file-menu:create-print? + file-menu:between-print-and-close + file-menu:close-callback + file-menu:get-close-item + file-menu:close-string + file-menu:close-help-string + file-menu:close-on-demand + file-menu:create-close? + file-menu:between-close-and-quit + file-menu:quit-callback + file-menu:get-quit-item + file-menu:quit-string + file-menu:quit-help-string + file-menu:quit-on-demand + file-menu:create-quit? + file-menu:after-quit + edit-menu:undo-callback + edit-menu:get-undo-item + edit-menu:undo-string + edit-menu:undo-help-string + edit-menu:undo-on-demand + edit-menu:create-undo? + edit-menu:redo-callback + edit-menu:get-redo-item + edit-menu:redo-string + edit-menu:redo-help-string + edit-menu:redo-on-demand + edit-menu:create-redo? + edit-menu:between-redo-and-cut + edit-menu:cut-callback + edit-menu:get-cut-item + edit-menu:cut-string + edit-menu:cut-help-string + edit-menu:cut-on-demand + edit-menu:create-cut? + edit-menu:between-cut-and-copy + edit-menu:copy-callback + edit-menu:get-copy-item + edit-menu:copy-string + edit-menu:copy-help-string + edit-menu:copy-on-demand + edit-menu:create-copy? + edit-menu:between-copy-and-paste + edit-menu:paste-callback + edit-menu:get-paste-item + edit-menu:paste-string + edit-menu:paste-help-string + edit-menu:paste-on-demand + edit-menu:create-paste? + edit-menu:between-paste-and-clear + edit-menu:clear-callback + edit-menu:get-clear-item + edit-menu:clear-string + edit-menu:clear-help-string + edit-menu:clear-on-demand + edit-menu:create-clear? + edit-menu:between-clear-and-select-all + edit-menu:select-all-callback + edit-menu:get-select-all-item + edit-menu:select-all-string + edit-menu:select-all-help-string + edit-menu:select-all-on-demand + edit-menu:create-select-all? + edit-menu:between-select-all-and-find + edit-menu:find-callback + edit-menu:get-find-item + edit-menu:find-string + 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: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:between-find-and-preferences + edit-menu:preferences-callback + edit-menu:get-preferences-item + edit-menu:preferences-string + edit-menu:preferences-help-string + edit-menu:preferences-on-demand + edit-menu:create-preferences? + edit-menu:after-preferences + help-menu:before-about + help-menu:about-callback + help-menu:get-about-item + help-menu:about-string + help-menu:about-help-string + help-menu:about-on-demand + help-menu:create-about? + help-menu:after-about)) (define standard-menus-mixin (mixin @@ -158,32 +158,32 @@ (inherit on-menu-char on-traverse-char) (define remove-prefs-callback (preferences:add-callback - 'framework:menu-bindings - (λ (p v) - (let loop ((menu (get-menu-bar))) - (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))))))) + 'framework:menu-bindings + (λ (p v) + (let loop ((menu (get-menu-bar))) + (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))))))) (inherit get-menu-bar show can-close? get-edit-target-object) (define/augment - on-close - (lambda () (remove-prefs-callback) (inner (void) on-close))) + on-close + (lambda () (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%)) + 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)) + 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)) @@ -191,8 +191,8 @@ (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)) + 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)) @@ -201,14 +201,14 @@ (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)) + (file-menu:open-recent-string) + (string-constant open-recent-menu-item)) (define/public - (file-menu:open-recent-help-string) - (string-constant open-recent-info)) + (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))) + 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))) @@ -227,11 +227,11 @@ (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)) + (file-menu:save-as-string) + (string-constant save-as-menu-item)) (define/public - (file-menu:save-as-help-string) - (string-constant save-as-info)) + (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))) @@ -242,11 +242,11 @@ (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))) + 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)) + 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)) @@ -254,245 +254,245 @@ (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)))) + 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) - (if (eq? (system-type) 'windows) - (string-constant quit-menu-item-windows) - (string-constant quit-menu-item-others))) + (file-menu:quit-string) + (if (eq? (system-type) 'windows) + (string-constant quit-menu-item-windows) + (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?))) + (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))) - #t)) + 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))) + #t)) (define/public (edit-menu:get-undo-item) edit-menu:undo-item) (define/public (edit-menu:undo-string) (string-constant undo-menu-item)) (define/public (edit-menu:undo-help-string) (string-constant undo-info)) (define/public - 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)))) - (send item enable enable?)))) + 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)))) + (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))) - #t)) + 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))) + #t)) (define/public (edit-menu:get-redo-item) edit-menu:redo-item) (define/public (edit-menu:redo-string) (string-constant redo-menu-item)) (define/public (edit-menu:redo-help-string) (string-constant redo-info)) (define/public - 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)))) - (send item enable enable?)))) + 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)))) + (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))) + 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))) - #t)) + 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))) + #t)) (define/public (edit-menu:get-cut-item) edit-menu:cut-item) (define/public (edit-menu:cut-string) (string-constant cut-menu-item)) (define/public (edit-menu:cut-help-string) (string-constant cut-info)) (define/public - 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)))) - (send item enable enable?)))) + 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)))) + (send item enable enable?)))) (define/public (edit-menu:create-cut?) #t) (define/public edit-menu:between-cut-and-copy (λ (menu) (void))) (define/public - 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))) - #t)) + 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))) + #t)) (define/public (edit-menu:get-copy-item) edit-menu:copy-item) (define/public (edit-menu:copy-string) (string-constant copy-menu-item)) (define/public (edit-menu:copy-help-string) (string-constant copy-info)) (define/public - 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)))) - (send item enable enable?)))) + 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)))) + (send item enable enable?)))) (define/public (edit-menu:create-copy?) #t) (define/public edit-menu:between-copy-and-paste (λ (menu) (void))) (define/public - 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))) - #t)) + 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))) + #t)) (define/public (edit-menu:get-paste-item) edit-menu:paste-item) (define/public (edit-menu:paste-string) (string-constant paste-menu-item)) (define/public (edit-menu:paste-help-string) (string-constant paste-info)) (define/public - 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)))) - (send item enable enable?)))) + 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)))) + (send item enable enable?)))) (define/public (edit-menu:create-paste?) #t) (define/public edit-menu:between-paste-and-clear (λ (menu) (void))) (define/public - 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))) - #t)) + 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))) + #t)) (define/public (edit-menu:get-clear-item) edit-menu:clear-item) (define/public - (edit-menu:clear-string) - (if (eq? (system-type) 'windows) - (string-constant clear-menu-item-windows) - (string-constant clear-menu-item-windows))) + (edit-menu:clear-string) + (if (eq? (system-type) 'windows) + (string-constant clear-menu-item-windows) + (string-constant clear-menu-item-windows))) (define/public (edit-menu:clear-help-string) (string-constant clear-info)) (define/public - 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)))) - (send item enable enable?)))) + 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)))) + (send item enable enable?)))) (define/public (edit-menu:create-clear?) #t) (define/public edit-menu:between-clear-and-select-all (λ (menu) (void))) (define/public - 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))) - #t)) + 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))) + #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)) + (edit-menu:select-all-string) + (string-constant select-all-menu-item)) (define/public - (edit-menu:select-all-help-string) - (string-constant select-all-info)) + (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)))) - (send item enable enable?)))) + 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)))) + (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))) + 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<%>)))))) + edit-menu:find-on-demand + (λ (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)) + (edit-menu:find-again-string) + (string-constant find-again-menu-item)) (define/public - (edit-menu:find-again-help-string) - (string-constant find-again-info)) + (edit-menu:find-again-help-string) + (string-constant find-again-info)) (define/public - edit-menu:find-again-on-demand - (λ (item) - (send item enable - (let - ((target (get-edit-target-object))) - (and target (is-a? target editor<%>)))))) + 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:replace-and-find-again-callback - (λ (item control) (void))) + 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) + (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)) + (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:replace-and-find-again-help-string) + (string-constant replace-and-find-again-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<%>)))))) + 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:between-find-and-preferences - (λ (menu) - (unless (current-eventspace-has-standard-menus?) - (make-object separator-menu-item% menu)))) + 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)) + 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)) + (edit-menu:preferences-string) + (string-constant preferences-menu-item)) (define/public - (edit-menu:preferences-help-string) - (string-constant preferences-info)) + (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?))) + (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))) @@ -517,291 +517,333 @@ (get-menu-bar))) (define file-menu:new-item (and (file-menu:create-new?) - (instantiate (get-menu-item%) () - (label (file-menu:new-string)) - (parent file-menu) - (callback - (let ((file-menu:new-callback - (λ (item evt) (file-menu:new-callback item evt)))) - file-menu:new-callback)) - (shortcut #\n) - (help-string (file-menu:new-help-string)) - (demand-callback - (λ (menu-item) (file-menu:new-on-demand menu-item)))))) + (new + (get-menu-item%) + (label (file-menu:new-string)) + (parent file-menu) + (callback + (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)))))) (file-menu:between-new-and-open (get-file-menu)) (define file-menu:open-item (and (file-menu:create-open?) - (instantiate (get-menu-item%) () - (label (file-menu:open-string)) - (parent file-menu) - (callback - (let ((file-menu:open-callback - (λ (item evt) (file-menu:open-callback item evt)))) - file-menu:open-callback)) - (shortcut #\o) - (help-string (file-menu:open-help-string)) - (demand-callback - (λ (menu-item) (file-menu:open-on-demand menu-item)))))) + (new + (get-menu-item%) + (label (file-menu:open-string)) + (parent file-menu) + (callback + (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)))))) (define file-menu:open-recent-item (and (file-menu:create-open-recent?) - (instantiate (get-menu%) () - (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)))))) + (new + (get-menu%) + (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)))))) (file-menu:between-open-and-revert (get-file-menu)) (define file-menu:revert-item (and (file-menu:create-revert?) - (instantiate (get-menu-item%) () - (label (file-menu:revert-string)) - (parent file-menu) - (callback - (let ((file-menu:revert-callback - (λ (item evt) (file-menu:revert-callback item evt)))) - file-menu:revert-callback)) - (shortcut #f) - (help-string (file-menu:revert-help-string)) - (demand-callback - (λ (menu-item) (file-menu:revert-on-demand menu-item)))))) + (new + (get-menu-item%) + (label (file-menu:revert-string)) + (parent file-menu) + (callback + (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)))))) (file-menu:between-revert-and-save (get-file-menu)) (define file-menu:save-item (and (file-menu:create-save?) - (instantiate (get-menu-item%) () - (label (file-menu:save-string)) - (parent file-menu) - (callback - (let ((file-menu:save-callback - (λ (item evt) (file-menu:save-callback item evt)))) - file-menu:save-callback)) - (shortcut #\s) - (help-string (file-menu:save-help-string)) - (demand-callback - (λ (menu-item) (file-menu:save-on-demand menu-item)))))) + (new + (get-menu-item%) + (label (file-menu:save-string)) + (parent file-menu) + (callback + (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)))))) (define file-menu:save-as-item (and (file-menu:create-save-as?) - (instantiate (get-menu-item%) () - (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)))) - file-menu:save-as-callback)) - (shortcut #f) - (help-string (file-menu:save-as-help-string)) - (demand-callback - (λ (menu-item) (file-menu:save-as-on-demand menu-item)))))) + (new + (get-menu-item%) + (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)))) + 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)))))) (file-menu:between-save-as-and-print (get-file-menu)) (define file-menu:print-item (and (file-menu:create-print?) - (instantiate (get-menu-item%) () - (label (file-menu:print-string)) - (parent file-menu) - (callback - (let ((file-menu:print-callback - (λ (item evt) (file-menu:print-callback item evt)))) - file-menu:print-callback)) - (shortcut #\p) - (help-string (file-menu:print-help-string)) - (demand-callback - (λ (menu-item) (file-menu:print-on-demand menu-item)))))) + (new + (get-menu-item%) + (label (file-menu:print-string)) + (parent file-menu) + (callback + (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)))))) (file-menu:between-print-and-close (get-file-menu)) (define file-menu:close-item (and (file-menu:create-close?) - (instantiate (get-menu-item%) () - (label (file-menu:close-string)) - (parent file-menu) - (callback - (let ((file-menu:close-callback - (λ (item evt) (file-menu:close-callback item evt)))) - file-menu:close-callback)) - (shortcut #\w) - (help-string (file-menu:close-help-string)) - (demand-callback - (λ (menu-item) (file-menu:close-on-demand menu-item)))))) + (new + (get-menu-item%) + (label (file-menu:close-string)) + (parent file-menu) + (callback + (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)))))) (file-menu:between-close-and-quit (get-file-menu)) (define file-menu:quit-item (and (file-menu:create-quit?) - (instantiate (get-menu-item%) () - (label (file-menu:quit-string)) - (parent file-menu) - (callback - (let ((file-menu:quit-callback - (λ (item evt) (file-menu:quit-callback item evt)))) - file-menu:quit-callback)) - (shortcut #\q) - (help-string (file-menu:quit-help-string)) - (demand-callback - (λ (menu-item) (file-menu:quit-on-demand menu-item)))))) + (new + (get-menu-item%) + (label (file-menu:quit-string)) + (parent file-menu) + (callback + (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)))))) (file-menu:after-quit (get-file-menu)) (define edit-menu:undo-item (and (edit-menu:create-undo?) - (instantiate (get-menu-item%) () - (label (edit-menu:undo-string)) - (parent edit-menu) - (callback - (let ((edit-menu:undo-callback - (λ (item evt) (edit-menu:undo-callback item evt)))) - edit-menu:undo-callback)) - (shortcut #\z) - (help-string (edit-menu:undo-help-string)) - (demand-callback - (λ (menu-item) (edit-menu:undo-on-demand menu-item)))))) + (new + (get-menu-item%) + (label (edit-menu:undo-string)) + (parent edit-menu) + (callback + (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)))))) (define edit-menu:redo-item (and (edit-menu:create-redo?) - (instantiate (get-menu-item%) () - (label (edit-menu:redo-string)) - (parent edit-menu) - (callback - (let ((edit-menu:redo-callback - (λ (item evt) (edit-menu:redo-callback item evt)))) - edit-menu:redo-callback)) - (shortcut #\y) - (help-string (edit-menu:redo-help-string)) - (demand-callback - (λ (menu-item) (edit-menu:redo-on-demand menu-item)))))) + (new + (get-menu-item%) + (label (edit-menu:redo-string)) + (parent edit-menu) + (callback + (let ((edit-menu:redo-callback + (λ (item evt) (edit-menu:redo-callback item evt)))) + edit-menu:redo-callback)) + (shortcut (if (eq? (system-type) 'macosx) #\z #\y)) + (shortcut-prefix + (if (eq? (system-type) 'macosx) + (cons 'shift (get-default-shortcut-prefix)) + (get-default-shortcut-prefix))) + (help-string (edit-menu:redo-help-string)) + (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?) - (instantiate (get-menu-item%) () - (label (edit-menu:cut-string)) - (parent edit-menu) - (callback - (let ((edit-menu:cut-callback - (λ (item evt) (edit-menu:cut-callback item evt)))) - edit-menu:cut-callback)) - (shortcut #\x) - (help-string (edit-menu:cut-help-string)) - (demand-callback - (λ (menu-item) (edit-menu:cut-on-demand menu-item)))))) + (new + (get-menu-item%) + (label (edit-menu:cut-string)) + (parent edit-menu) + (callback + (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)))))) (edit-menu:between-cut-and-copy (get-edit-menu)) (define edit-menu:copy-item (and (edit-menu:create-copy?) - (instantiate (get-menu-item%) () - (label (edit-menu:copy-string)) - (parent edit-menu) - (callback - (let ((edit-menu:copy-callback - (λ (item evt) (edit-menu:copy-callback item evt)))) - edit-menu:copy-callback)) - (shortcut #\c) - (help-string (edit-menu:copy-help-string)) - (demand-callback - (λ (menu-item) (edit-menu:copy-on-demand menu-item)))))) + (new + (get-menu-item%) + (label (edit-menu:copy-string)) + (parent edit-menu) + (callback + (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)))))) (edit-menu:between-copy-and-paste (get-edit-menu)) (define edit-menu:paste-item (and (edit-menu:create-paste?) - (instantiate (get-menu-item%) () - (label (edit-menu:paste-string)) - (parent edit-menu) - (callback - (let ((edit-menu:paste-callback - (λ (item evt) (edit-menu:paste-callback item evt)))) - edit-menu:paste-callback)) - (shortcut #\v) - (help-string (edit-menu:paste-help-string)) - (demand-callback - (λ (menu-item) (edit-menu:paste-on-demand menu-item)))))) + (new + (get-menu-item%) + (label (edit-menu:paste-string)) + (parent edit-menu) + (callback + (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)))))) (edit-menu:between-paste-and-clear (get-edit-menu)) (define edit-menu:clear-item (and (edit-menu:create-clear?) - (instantiate (get-menu-item%) () - (label (edit-menu:clear-string)) - (parent edit-menu) - (callback - (let ((edit-menu:clear-callback - (λ (item evt) (edit-menu:clear-callback item evt)))) - edit-menu:clear-callback)) - (shortcut #f) - (help-string (edit-menu:clear-help-string)) - (demand-callback - (λ (menu-item) (edit-menu:clear-on-demand menu-item)))))) + (new + (get-menu-item%) + (label (edit-menu:clear-string)) + (parent edit-menu) + (callback + (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)))))) (edit-menu:between-clear-and-select-all (get-edit-menu)) (define edit-menu:select-all-item (and (edit-menu:create-select-all?) - (instantiate (get-menu-item%) () - (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)))) - edit-menu:select-all-callback)) - (shortcut #\a) - (help-string (edit-menu:select-all-help-string)) - (demand-callback - (λ (menu-item) (edit-menu:select-all-on-demand menu-item)))))) + (new + (get-menu-item%) + (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)))) + 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)))))) (edit-menu:between-select-all-and-find (get-edit-menu)) (define edit-menu:find-item (and (edit-menu:create-find?) - (instantiate (get-menu-item%) () - (label (edit-menu:find-string)) - (parent edit-menu) - (callback - (let ((edit-menu:find-callback - (λ (item evt) (edit-menu:find-callback item evt)))) - edit-menu:find-callback)) - (shortcut #\f) - (help-string (edit-menu:find-help-string)) - (demand-callback - (λ (menu-item) (edit-menu:find-on-demand menu-item)))))) + (new + (get-menu-item%) + (label (edit-menu:find-string)) + (parent edit-menu) + (callback + (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?) - (instantiate (get-menu-item%) () - (label (edit-menu:find-again-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)) - (shortcut #\g) - (help-string (edit-menu:find-again-help-string)) - (demand-callback - (λ (menu-item) (edit-menu:find-again-on-demand menu-item)))))) + (new + (get-menu-item%) + (label (edit-menu:find-again-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)) + (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:replace-and-find-again-item (and (edit-menu:create-replace-and-find-again?) - (instantiate (get-menu-item%) () - (label (edit-menu:replace-and-find-again-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 (if (eq? (system-type) 'macosx) #f #\h)) - (help-string (edit-menu:replace-and-find-again-help-string)) - (demand-callback - (λ (menu-item) - (edit-menu:replace-and-find-again-on-demand menu-item)))))) + (new + (get-menu-item%) + (label (edit-menu:replace-and-find-again-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 (if (eq? (system-type) 'macosx) #f #\h)) + (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)))))) (edit-menu:between-find-and-preferences (get-edit-menu)) (define edit-menu:preferences-item (and (edit-menu:create-preferences?) - (instantiate (get-menu-item%) () - (label (edit-menu:preferences-string)) - (parent edit-menu) - (callback - (let ((edit-menu:preferences-callback - (λ (item evt) (edit-menu:preferences-callback item evt)))) - edit-menu:preferences-callback)) - (shortcut - (begin - (case (system-type) ((macosx) #\,) (else #\;)))) - (help-string (edit-menu:preferences-help-string)) - (demand-callback - (λ (menu-item) (edit-menu:preferences-on-demand menu-item)))))) + (new + (get-menu-item%) + (label (edit-menu:preferences-string)) + (parent edit-menu) + (callback + (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)))))) (edit-menu:after-preferences (get-edit-menu)) (help-menu:before-about (get-help-menu)) (define help-menu:about-item (and (help-menu:create-about?) - (instantiate (get-menu-item%) () - (label (help-menu:about-string)) - (parent help-menu) - (callback - (let ((help-menu:about-callback - (λ (item evt) (help-menu:about-callback item evt)))) - help-menu:about-callback)) - (shortcut #f) - (help-string (help-menu:about-help-string)) - (demand-callback - (λ (menu-item) (help-menu:about-on-demand menu-item)))))) + (new + (get-menu-item%) + (label (help-menu:about-string)) + (parent help-menu) + (callback + (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)))))) (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 ba58130ce2..69ccc94c15 100644 --- a/collects/scribblings/framework/frame.scrbl +++ b/collects/scribblings/framework/frame.scrbl @@ -1,7 +1,8 @@ #lang scribble/doc -@(require scribble/manual scribble/extract) +@(require scribble/manual scribble/extract scheme/include) @(require (for-label framework)) @(require (for-label scheme/gui)) +@(require (for-syntax (prefix-in s: scribble/reader))) @title{Frame} @definterface[frame:basic<%> (frame%)]{ @@ -36,7 +37,8 @@ @schemeblock[ (class ... ... - (rename [super-make-root-area-container make-root-area-container]) + (rename [super-make-root-area-container + make-root-area-container]) (field [status-panel #f]) (define/override (make-root-area-container cls parent) @@ -44,7 +46,7 @@ (super-make-root-area-container vertical-panel% parent)) (let ([root (make-object cls status-panel)]) - ; ... add other children to status-panel ... + (code:comment "... add other children to status-panel ...") root)) ...)] @@ -465,1319 +467,9 @@ @defmixin[frame:pasteboard-info-mixin (frame:basic<%>) (frame:pasteboard-info<%>)]{ } -@definterface[frame:standard-menus<%> (frame:basic<%>)]{ - @itemize{ - @item{ - @method[frame:standard-menus<%> file-menu:new-callback], - @method[frame:standard-menus<%> file-menu:create-new?], - @method[frame:standard-menus<%> file-menu:new-string], - @method[frame:standard-menus<%> file-menu:new-help-string], - @method[frame:standard-menus<%> file-menu:new-on-demand], - @method[frame:standard-menus<%> file-menu:get-new-item]} - @item{ - @method[frame:standard-menus<%> file-menu:between-new-and-open]} +@(include/reader "standard-menus.scrbl" s:read-syntax) - @item{ - @method[frame:standard-menus<%> file-menu:open-callback], - @method[frame:standard-menus<%> file-menu:create-open?], - @method[frame:standard-menus<%> file-menu:open-string], - @method[frame:standard-menus<%> file-menu:open-help-string], - @method[frame:standard-menus<%> file-menu:open-on-demand], - @method[frame:standard-menus<%> file-menu:get-open-item]} - - @item{ - @method[frame:standard-menus<%> file-menu:open-recent-callback], - @method[frame:standard-menus<%> file-menu:create-open-recent?], - @method[frame:standard-menus<%> file-menu:open-recent-string], - @method[frame:standard-menus<%> file-menu:open-recent-help-string], - @method[frame:standard-menus<%> file-menu:open-recent-on-demand], - @method[frame:standard-menus<%> file-menu:get-open-recent-item]} - - @item{ - @method[frame:standard-menus<%> file-menu:between-open-and-revert]} - - @item{ - @method[frame:standard-menus<%> file-menu:revert-callback], - @method[frame:standard-menus<%> file-menu:create-revert?], - @method[frame:standard-menus<%> file-menu:revert-string], - @method[frame:standard-menus<%> file-menu:revert-help-string], - @method[frame:standard-menus<%> file-menu:revert-on-demand], - @method[frame:standard-menus<%> file-menu:get-revert-item]} - - @item{ - @method[frame:standard-menus<%> file-menu:between-revert-and-save]} - - @item{ - @method[frame:standard-menus<%> file-menu:save-callback], - @method[frame:standard-menus<%> file-menu:create-save?], - @method[frame:standard-menus<%> file-menu:save-string], - @method[frame:standard-menus<%> file-menu:save-help-string], - @method[frame:standard-menus<%> file-menu:save-on-demand], - @method[frame:standard-menus<%> file-menu:get-save-item]} - - @item{ - @method[frame:standard-menus<%> file-menu:save-as-callback], - @method[frame:standard-menus<%> file-menu:create-save-as?], - @method[frame:standard-menus<%> file-menu:save-as-string], - @method[frame:standard-menus<%> file-menu:save-as-help-string], - @method[frame:standard-menus<%> file-menu:save-as-on-demand], - @method[frame:standard-menus<%> file-menu:get-save-as-item]} - - @item{ - @method[frame:standard-menus<%> file-menu:between-save-as-and-print]} - - @item{ - @method[frame:standard-menus<%> file-menu:print-callback], - @method[frame:standard-menus<%> file-menu:create-print?], - @method[frame:standard-menus<%> file-menu:print-string], - @method[frame:standard-menus<%> file-menu:print-help-string], - @method[frame:standard-menus<%> file-menu:print-on-demand], - @method[frame:standard-menus<%> file-menu:get-print-item]} - - @item{ - @method[frame:standard-menus<%> file-menu:between-print-and-close]} - - @item{ - @method[frame:standard-menus<%> file-menu:close-callback], - @method[frame:standard-menus<%> file-menu:create-close?], - @method[frame:standard-menus<%> file-menu:close-string], - @method[frame:standard-menus<%> file-menu:close-help-string], - @method[frame:standard-menus<%> file-menu:close-on-demand], - @method[frame:standard-menus<%> file-menu:get-close-item]} - - @item{ - @method[frame:standard-menus<%> file-menu:between-close-and-quit]} - - @item{ - @method[frame:standard-menus<%> file-menu:quit-callback], - @method[frame:standard-menus<%> file-menu:create-quit?], - @method[frame:standard-menus<%> file-menu:quit-string], - @method[frame:standard-menus<%> file-menu:quit-help-string], - @method[frame:standard-menus<%> file-menu:quit-on-demand], - @method[frame:standard-menus<%> file-menu:get-quit-item]} - - @item{ - @method[frame:standard-menus<%> file-menu:after-quit]} - - @item{ - @method[frame:standard-menus<%> edit-menu:undo-callback], - @method[frame:standard-menus<%> edit-menu:create-undo?], - @method[frame:standard-menus<%> edit-menu:undo-string], - @method[frame:standard-menus<%> edit-menu:undo-help-string], - @method[frame:standard-menus<%> edit-menu:undo-on-demand], - @method[frame:standard-menus<%> edit-menu:get-undo-item]} - - @item{ - @method[frame:standard-menus<%> edit-menu:redo-callback], - @method[frame:standard-menus<%> edit-menu:create-redo?], - @method[frame:standard-menus<%> edit-menu:redo-string], - @method[frame:standard-menus<%> edit-menu:redo-help-string], - @method[frame:standard-menus<%> edit-menu:redo-on-demand], - @method[frame:standard-menus<%> edit-menu:get-redo-item]} - - @item{ - @method[frame:standard-menus<%> edit-menu:between-redo-and-cut]} - - @item{ - @method[frame:standard-menus<%> edit-menu:cut-callback], - @method[frame:standard-menus<%> edit-menu:create-cut?], - @method[frame:standard-menus<%> edit-menu:cut-string], - @method[frame:standard-menus<%> edit-menu:cut-help-string], - @method[frame:standard-menus<%> edit-menu:cut-on-demand], - @method[frame:standard-menus<%> edit-menu:get-cut-item] - - }@item{ - @method[frame:standard-menus<%> edit-menu:between-cut-and-copy] - - }@item{ - @method[frame:standard-menus<%> edit-menu:copy-callback], - @method[frame:standard-menus<%> edit-menu:create-copy?], - @method[frame:standard-menus<%> edit-menu:copy-string], - @method[frame:standard-menus<%> edit-menu:copy-help-string], - @method[frame:standard-menus<%> edit-menu:copy-on-demand], - @method[frame:standard-menus<%> edit-menu:get-copy-item] - - }@item{ - @method[frame:standard-menus<%> edit-menu:between-copy-and-paste] - - }@item{ - @method[frame:standard-menus<%> edit-menu:paste-callback], - @method[frame:standard-menus<%> edit-menu:create-paste?], - @method[frame:standard-menus<%> edit-menu:paste-string], - @method[frame:standard-menus<%> edit-menu:paste-help-string], - @method[frame:standard-menus<%> edit-menu:paste-on-demand], - @method[frame:standard-menus<%> edit-menu:get-paste-item] - - }@item{ - @method[frame:standard-menus<%> edit-menu:between-paste-and-clear] - - }@item{ - @method[frame:standard-menus<%> edit-menu:clear-callback], - @method[frame:standard-menus<%> edit-menu:create-clear?], - @method[frame:standard-menus<%> edit-menu:clear-string], - @method[frame:standard-menus<%> edit-menu:clear-help-string], - @method[frame:standard-menus<%> edit-menu:clear-on-demand], - @method[frame:standard-menus<%> edit-menu:get-clear-item] - - }@item{ - @method[frame:standard-menus<%> edit-menu:between-clear-and-select-all] - - }@item{ - @method[frame:standard-menus<%> edit-menu:select-all-callback], - @method[frame:standard-menus<%> edit-menu:create-select-all?], - @method[frame:standard-menus<%> edit-menu:select-all-string], - @method[frame:standard-menus<%> edit-menu:select-all-help-string], - @method[frame:standard-menus<%> edit-menu:select-all-on-demand], - @method[frame:standard-menus<%> edit-menu:get-select-all-item] - - }@item{ - @method[frame:standard-menus<%> edit-menu:between-select-all-and-find] - - }@item{ - @method[frame:standard-menus<%> edit-menu:find-callback], - @method[frame:standard-menus<%> edit-menu:create-find?], - @method[frame:standard-menus<%> edit-menu:find-string], - @method[frame:standard-menus<%> edit-menu:find-help-string], - @method[frame:standard-menus<%> edit-menu:find-on-demand], - @method[frame:standard-menus<%> edit-menu:get-find-item] - - }@item{ - @method[frame:standard-menus<%> edit-menu:find-again-callback], - @method[frame:standard-menus<%> edit-menu:create-find-again?], - @method[frame:standard-menus<%> edit-menu:find-again-string], - @method[frame:standard-menus<%> edit-menu:find-again-help-string], - @method[frame:standard-menus<%> edit-menu:find-again-on-demand], - @method[frame:standard-menus<%> edit-menu:get-find-again-item] - - }@item{ - @method[frame:standard-menus<%> edit-menu:replace-and-find-again-callback], - @method[frame:standard-menus<%> edit-menu:create-replace-and-find-again?], - @method[frame:standard-menus<%> edit-menu:replace-and-find-again-string], - @method[frame:standard-menus<%> edit-menu:replace-and-find-again-help-string], - @method[frame:standard-menus<%> edit-menu:replace-and-find-again-on-demand], - @method[frame:standard-menus<%> edit-menu:get-replace-and-find-again-item] - - }@item{ - @method[frame:standard-menus<%> edit-menu:between-find-and-preferences] - - }@item{ - @method[frame:standard-menus<%> edit-menu:preferences-callback], - @method[frame:standard-menus<%> edit-menu:create-preferences?], - @method[frame:standard-menus<%> edit-menu:preferences-string], - @method[frame:standard-menus<%> edit-menu:preferences-help-string], - @method[frame:standard-menus<%> edit-menu:preferences-on-demand], - @method[frame:standard-menus<%> edit-menu:get-preferences-item] - - }@item{ - @method[frame:standard-menus<%> edit-menu:after-preferences] - - }@item{ - @method[frame:standard-menus<%> help-menu:before-about] - - }@item{ - @method[frame:standard-menus<%> help-menu:about-callback], - @method[frame:standard-menus<%> help-menu:create-about?], - @method[frame:standard-menus<%> help-menu:about-string], - @method[frame:standard-menus<%> help-menu:about-help-string], - @method[frame:standard-menus<%> help-menu:about-on-demand], - @method[frame:standard-menus<%> help-menu:get-about-item] - - }@item{ - @method[frame:standard-menus<%> help-menu:after-about]}} - - @defmethod*[(((get-menu%) (subclass?/c menu:can-restore-underscore-menu%)))]{ - The result of this method is used as the class - for creating the result of these methods: - @method[frame:standard-menus<%> get-file-menu], - @method[frame:standard-menus<%> get-edit-menu], - @method[frame:standard-menus<%> get-help-menu]. - - - defaultly returns - @scheme[menu%] - } - @defmethod*[(((get-menu-item%) (subclass?/c menu-item%)))]{ - The result of this method is used as the class for creating - the menu items in this frame (see - @scheme[frame:standard-menus%] - for a list). - - - defaultly returns - @scheme[menu:can-restore-menu-item%]. - } - @defmethod*[(((get-checkable-menu-item%) (subclass?/c checkable-menu-item%)))]{ - The result of this method is used as the class for creating - checkable menu items in this class (see - @scheme[frame:standard-menus%] - for a list). - - - defaultly returns - @scheme[menu:can-restore-checkable-menu-item%]. - } - @defmethod*[(((get-file-menu) (instance (subclass?/c menu%))))]{ - Returns the file menu - See also - @method[frame:standard-menus<%> get-menu%] - - } - @defmethod*[(((get-edit-menu) (instance (subclass?/c menu%))))]{ - Returns the edit menu - See also - @method[frame:standard-menus<%> get-menu%] - - } - @defmethod*[(((get-help-menu) (instance (subclass?/c menu%))))]{ - Returns the help menu - See also - @method[frame:standard-menus<%> get-menu%] - - } - @defmethod*[(((file-menu:new-callback (item (instance (subclass?/c menu-item%))) (evt (instance control-event%))) void))]{ - This method is called when the new menu-item of the file-menu menu is selected. - - - Defaultly bound to: - @schemeblock[ - (λ (item control) (handler:edit-file #f) #t)] - } - @defmethod*[(((file-menu:get-new-item) (instance menu-item%)))]{ - This method returns the @scheme[menu-item%] that corresponds - to this menu item. - - } - @defmethod*[(((file-menu:new-string) string))]{ - The result of this method is the name of this menu. - - defaultly returns "(string-constant new-menu-item)" - } - @defmethod*[(((file-menu:new-help-string) string))]{ - This result of this method is used as the help string when the - @scheme[menu-item%] - object is created. - - - Defaultly returns @scheme[(string-constant new-info)]. - } - @defmethod*[(((file-menu:new-on-demand (item menu-item%)) void))]{ - The menu item's on-demand method calls this method - - - Defaultly is this: - @scheme[(λ (menu-item) (void))] - } - @defmethod*[(((file-menu:create-new?) boolean))]{ - The result of this method determines if the - corresponding menu-item is created. Override this - to control the creation of the menu-item. - - - defaultly returns #t - } - @defmethod*[(((file-menu:between-new-and-open (menu (instance (subclass?/c menu%)))) void))]{ - This method is called between the addition of the new menu-item - and before the addition of the open menu-item to the file-menu menu. - Override it to add additional menus at that point. - - - Does nothing. - } - @defmethod*[(((file-menu:open-callback (item (instance (subclass?/c menu-item%))) (evt (instance control-event%))) void))]{ - This method is called when the open menu-item of the file-menu menu is selected. - - - Defaultly bound to: - @schemeblock[ - (λ (item control) (handler:open-file) #t)] - } - @defmethod*[(((file-menu:get-open-item) (instance menu-item%)))]{ - This method returns the @scheme[menu-item%] that corresponds - to this menu item. - - } - @defmethod*[(((file-menu:open-string) string))]{ - The result of this method is the name of this menu. - - defaultly returns "(string-constant open-menu-item)" - } - @defmethod*[(((file-menu:open-help-string) string))]{ - This result of this method is used as the help string when the - @scheme[menu-item%] - object is created. - - - Defaultly returns @scheme[(string-constant open-info)] - } - @defmethod*[(((file-menu:open-on-demand (item menu-item%)) void))]{ - The menu item's on-demand method calls this method - - - Defaultly is this: - @scheme[(λ (menu-item) (void))] - } - @defmethod*[(((file-menu:create-open?) boolean))]{ - The result of this method determines if the - corresponding menu-item is created. Override this - to control the creation of the menu-item. - - - defaultly returns #t - } - @defmethod*[(((file-menu:open-recent-callback (item (instance (subclass?/c menu-item%))) (evt (instance control-event%))) void))]{ - This method is called when the open-recent menu-item of the file-menu menu is selected. - - - Defaultly bound to: - @schemeblock[ - (λ (x y) (void))] - - } - @defmethod*[(((file-menu:get-open-recent-item) (instance menu-item%)))]{ - This method returns the @scheme[menu-item%] that corresponds - to this menu item. - - } - @defmethod*[(((file-menu:open-recent-string) string))]{ - The result of this method is the name of this menu. - - defaultly returns "(string-constant open-recent-menu-item)" - } - @defmethod*[(((file-menu:open-recent-help-string) string))]{ - This result of this method is used as the help string when the - @scheme[menu-item%] - object is created. - - - Defaultly returns @scheme[(string-constant open-recent-info)] - } - @defmethod*[(((file-menu:open-recent-on-demand (item menu-item%)) void))]{ - The menu item's on-demand method calls this method - - - Defaultly is this: - @scheme[(λ (menu) (handler:install-recent-items menu))] - } - @defmethod*[(((file-menu:create-open-recent?) boolean))]{ - The result of this method determines if the - corresponding menu-item is created. Override this - to control the creation of the menu-item. - - - defaultly returns #t - } - @defmethod*[(((file-menu:between-open-and-revert (menu (instance (subclass?/c menu%)))) void))]{ - This method is called between the addition of the open menu-item - and before the addition of the revert menu-item to the file-menu menu. - Override it to add additional menus at that point. - - - Does nothing. - } - @defmethod*[(((file-menu:revert-callback (item (instance (subclass?/c menu-item%))) (evt (instance control-event%))) void))]{ - This method is called when the revert menu-item of the file-menu menu is selected. - - - Defaultly bound to: - @schemeblock[ - (λ (item control) (void))] - } - @defmethod*[(((file-menu:get-revert-item) (instance menu-item%)))]{ - This method returns the @scheme[menu-item%] that corresponds - to this menu item. - - } - @defmethod*[(((file-menu:revert-string) string))]{ - The result of this method is the name of this menu. - - defaultly returns "(string-constant revert-menu-item)" - } - @defmethod*[(((file-menu:revert-help-string) string))]{ - This result of this method is used as the help string when the - @scheme[menu-item%] - object is created. - - - Defaultly returns @scheme[(string-constant revert-info)] - } - @defmethod*[(((file-menu:revert-on-demand (item menu-item%)) void))]{ - The menu item's on-demand method calls this method - - - Defaultly is this: - @scheme[(λ (menu-item) (void))] - } - @defmethod*[(((file-menu:create-revert?) boolean))]{ - The result of this method determines if the - corresponding menu-item is created. Override this - to control the creation of the menu-item. - - - defaultly returns @scheme[#f] - } - @defmethod*[(((file-menu:between-revert-and-save (menu (instance (subclass?/c menu%)))) void))]{ - This method is called between the addition of the revert menu-item - and before the addition of the save menu-item to the file-menu menu. - Override it to add additional menus at that point. - - - Does nothing. - } - @defmethod*[(((file-menu:save-callback (item (instance (subclass?/c menu-item%))) (evt (instance control-event%))) void))]{ - This method is called when the save menu-item of the file-menu menu is selected. - - - Defaultly bound to: - @schemeblock[ - (λ (item control) (void))] - } - @defmethod*[(((file-menu:get-save-item) (instance menu-item%)))]{ - This method returns the @scheme[menu-item%] that corresponds - to this menu item. - - } - @defmethod*[(((file-menu:save-string) string))]{ - The result of this method is the name of this menu. - - defaultly returns "(string-constant save-menu-item)" - } - @defmethod*[(((file-menu:save-help-string) string))]{ - This result of this method is used as the help string when the - @scheme[menu-item%] - object is created. - - - Defaultly returns @scheme[(string-constant save-info)] - } - @defmethod*[(((file-menu:save-on-demand (item menu-item%)) void))]{ - The menu item's on-demand method calls this method - - - Defaultly is this: - @scheme[(λ (menu-item) (void))] - } - @defmethod*[(((file-menu:create-save?) boolean))]{ - The result of this method determines if the - corresponding menu-item is created. Override this - to control the creation of the menu-item. - - - defaultly returns @scheme[#f] - } - @defmethod*[(((file-menu:save-as-callback (item (instance (subclass?/c menu-item%))) (evt (instance control-event%))) void))]{ - This method is called when the save-as menu-item of the file-menu menu is selected. - - - Defaultly bound to: - @schemeblock[ - (λ (item control) (void))] - - } - @defmethod*[(((file-menu:get-save-as-item) (instance menu-item%)))]{ - This method returns the @scheme[menu-item%] that corresponds - to this menu item. - - } - @defmethod*[(((file-menu:save-as-string) string))]{ - The result of this method is the name of this menu. - - defaultly returns "(string-constant save-as-menu-item)" - } - @defmethod*[(((file-menu:save-as-help-string) string))]{ - This result of this method is used as the help string when the - @scheme[menu-item%] - object is created. - - - Defaultly returns @scheme[(string-constant save-as-info)] - } - @defmethod*[(((file-menu:save-as-on-demand (item menu-item%)) void))]{ - The menu item's on-demand method calls this method - - - Defaultly is this: - @scheme[(λ (menu-item) (void))] - } - @defmethod*[(((file-menu:create-save-as?) boolean))]{ - The result of this method determines if the - corresponding menu-item is created. Override this - to control the creation of the menu-item. - - - defaultly returns @scheme[#f] - } - @defmethod*[(((file-menu:between-save-as-and-print (menu (instance (subclass?/c menu%)))) void))]{ - This method is called between the addition of the save-as menu-item - and before the addition of the print menu-item to the file-menu menu. - Override it to add additional menus at that point. - - - Does nothing. - } - @defmethod*[(((file-menu:print-callback (item (instance (subclass?/c menu-item%))) (evt (instance control-event%))) void))]{ - This method is called when the print menu-item of the file-menu menu is selected. - - - Defaultly bound to: - @schemeblock[ - (λ (item control) (void))] - - } - @defmethod*[(((file-menu:get-print-item) (instance menu-item%)))]{ - This method returns the @scheme[menu-item%] that corresponds - to this menu item. - - } - @defmethod*[(((file-menu:print-string) string))]{ - The result of this method is the name of this menu. - - defaultly returns "(string-constant print-menu-item)" - } - @defmethod*[(((file-menu:print-help-string) string))]{ - This result of this method is used as the help string when the - @scheme[menu-item%] - object is created. - - - Defaultly returns @scheme[(string-constant print-info)] - } - @defmethod*[(((file-menu:print-on-demand (item menu-item%)) void))]{ - The menu item's on-demand method calls this method - - - Defaultly is this: - @scheme[(λ (menu-item) (void))] - } - @defmethod*[(((file-menu:create-print?) boolean))]{ - The result of this method determines if the - corresponding menu-item is created. Override this - to control the creation of the menu-item. - - - defaultly returns @scheme[#f] - } - @defmethod*[(((file-menu:between-print-and-close (menu (instance (subclass?/c menu%)))) void))]{ - This method is called between the addition of the print menu-item - and before the addition of the close menu-item to the file-menu menu. - Override it to add additional menus at that point. - - - Adds a separator menu item. - } - @defmethod*[(((file-menu:close-callback (item (instance (subclass?/c menu-item%))) (evt (instance control-event%))) void))]{ - This method is called when the close menu-item of the file-menu menu is selected. - - - Defaultly bound to: - @schemeblock[ - (λ (item control) (when (can-close?) (on-close) (show #f)) #t)] - - } - @defmethod*[(((file-menu:get-close-item) (instance menu-item%)))]{ - This method returns the @scheme[menu-item%] that corresponds - to this menu item. - - } - @defmethod*[(((file-menu:close-string) string))]{ - The result of this method is the name of this menu. - - defaultly returns "(string-constant close-menu-item)" - } - @defmethod*[(((file-menu:close-help-string) string))]{ - This result of this method is used as the help string when the - @scheme[menu-item%] - object is created. - - - Defaultly returns @scheme[(string-constant close-info)] - } - @defmethod*[(((file-menu:close-on-demand (item menu-item%)) void))]{ - The menu item's on-demand method calls this method - - - Defaultly is this: - @scheme[(λ (menu-item) (void))] - } - @defmethod*[(((file-menu:create-close?) boolean))]{ - The result of this method determines if the - corresponding menu-item is created. Override this - to control the creation of the menu-item. - - - defaultly returns #t - } - @defmethod*[(((file-menu:between-close-and-quit (menu (instance (subclass?/c menu%)))) void))]{ - This method is called between the addition of the close menu-item - and before the addition of the quit menu-item to the file-menu menu. - Override it to add additional menus at that point. - - - Does nothing. - } - @defmethod*[(((file-menu:quit-callback (item (instance (subclass?/c menu-item%))) (evt (instance control-event%))) void))]{ - This method is called when the quit menu-item of the file-menu menu is selected. - - - Defaultly bound to: - @schemeblock[ - (λ (item control) (when (exit:user-oks-exit) (exit:exit)))] - - } - @defmethod*[(((file-menu:get-quit-item) (instance menu-item%)))]{ - This method returns the @scheme[menu-item%] that corresponds - to this menu item. - - } - @defmethod*[(((file-menu:quit-string) string))]{ - The result of this method is the name of this menu. - - defaultly returns "(if (eq? (system-type) (quote windows)) (string-constant quit-menu-item-windows) (string-constant quit-menu-item-others))" - } - @defmethod*[(((file-menu:quit-help-string) string))]{ - This result of this method is used as the help string when the - @scheme[menu-item%] - object is created. - - - Defaultly returns @scheme[(string-constant quit-info)] - } - @defmethod*[(((file-menu:quit-on-demand (item menu-item%)) void))]{ - The menu item's on-demand method calls this method - - - Defaultly is this: - @scheme[(λ (menu-item) (void))] - } - @defmethod*[(((file-menu:create-quit?) boolean))]{ - The result of this method determines if the - corresponding menu-item is created. Override this - to control the creation of the menu-item. - - - defaultly returns (not (current-eventspace-has-standard-menus?)) - } - @defmethod*[(((file-menu:after-quit (menu (instance (subclass?/c menu%)))) void))]{ - This method is called after the addition of the quit menu-item - to the file-menu menu. - Override it to add additional menus at that point. - - - Does nothing. - } - @defmethod*[(((edit-menu:undo-callback (item (instance (subclass?/c menu-item%))) (evt (instance control-event%))) void))]{ - This method is called when the undo menu-item of the edit-menu menu is selected. - - - Defaultly bound to: - @schemeblock[ - (λ (menu evt) - (let ((edit (get-edit-target-object))) - (when (and edit (is-a? edit editor<%>)) - (send edit do-edit-operation 'undo))) - #t)] - - } - @defmethod*[(((edit-menu:get-undo-item) (instance menu-item%)))]{ - This method returns the @scheme[menu-item%] that corresponds - to this menu item. - - } - @defmethod*[(((edit-menu:undo-string) string))]{ - The result of this method is the name of this menu. - - defaultly returns "(string-constant undo-menu-item)" - } - @defmethod*[(((edit-menu:undo-help-string) string))]{ - This result of this method is used as the help string when the - @scheme[menu-item%] - object is created. - - - Defaultly returns @scheme[(string-constant undo-info)] - } - @defmethod*[(((edit-menu:undo-on-demand (item menu-item%)) void))]{ - The menu item's on-demand method calls this method - - - Defaultly is this: - @scheme[(λ (item) (let* ((editor (get-edit-target-object)) (enable? (and editor (is-a? editor editor<%>) (send editor can-do-edit-operation? (quote undo))))) (send item enable enable?)))] - } - @defmethod*[(((edit-menu:create-undo?) boolean))]{ - The result of this method determines if the - corresponding menu-item is created. Override this - to control the creation of the menu-item. - - - defaultly returns #t - } - @defmethod*[(((edit-menu:redo-callback (item (instance (subclass?/c menu-item%))) (evt (instance control-event%))) void))]{ - This method is called when the redo menu-item of the edit-menu menu is selected. - - - Defaultly bound to: - @schemeblock[ - (λ (menu evt) - (let ((edit (get-edit-target-object))) - (when (and edit (is-a? edit editor<%>)) - (send edit do-edit-operation 'redo))) - #t)] - - } - @defmethod*[(((edit-menu:get-redo-item) (instance menu-item%)))]{ - This method returns the @scheme[menu-item%] that corresponds - to this menu item. - - } - @defmethod*[(((edit-menu:redo-string) string))]{ - The result of this method is the name of this menu. - - defaultly returns "(string-constant redo-menu-item)" - } - @defmethod*[(((edit-menu:redo-help-string) string))]{ - This result of this method is used as the help string when the - @scheme[menu-item%] - object is created. - - - Defaultly returns @scheme[(string-constant redo-info)] - } - @defmethod*[(((edit-menu:redo-on-demand (item menu-item%)) void))]{ - The menu item's on-demand method calls this method - - - Defaultly is this: - @scheme[(λ (item) (let* ((editor (get-edit-target-object)) (enable? (and editor (is-a? editor editor<%>) (send editor can-do-edit-operation? (quote redo))))) (send item enable enable?)))] - } - @defmethod*[(((edit-menu:create-redo?) boolean))]{ - The result of this method determines if the - corresponding menu-item is created. Override this - to control the creation of the menu-item. - - - defaultly returns #t - } - @defmethod*[(((edit-menu:between-redo-and-cut (menu (instance (subclass?/c menu%)))) void))]{ - This method is called between the addition of the redo menu-item - and before the addition of the cut menu-item to the edit-menu menu. - Override it to add additional menus at that point. - - - Adds a separator menu item. - } - @defmethod*[(((edit-menu:cut-callback (item (instance (subclass?/c menu-item%))) (evt (instance control-event%))) void))]{ - This method is called when the cut menu-item of the edit-menu menu is selected. - - - Defaultly bound to: - @schemeblock[ - (λ (menu evt) - (let ((edit (get-edit-target-object))) - (when (and edit (is-a? edit editor<%>)) - (send edit do-edit-operation 'cut))) - #t)] - - } - @defmethod*[(((edit-menu:get-cut-item) (instance menu-item%)))]{ - This method returns the @scheme[menu-item%] that corresponds - to this menu item. - - } - @defmethod*[(((edit-menu:cut-string) string))]{ - The result of this method is the name of this menu. - - defaultly returns "(string-constant cut-menu-item)" - } - @defmethod*[(((edit-menu:cut-help-string) string))]{ - This result of this method is used as the help string when the - @scheme[menu-item%] - object is created. - - - Defaultly returns @scheme[(string-constant cut-info)] - } - @defmethod*[(((edit-menu:cut-on-demand (item menu-item%)) void))]{ - The menu item's on-demand method calls this method - - - Defaultly is this: - @scheme[(λ (item) (let* ((editor (get-edit-target-object)) (enable? (and editor (is-a? editor editor<%>) (send editor can-do-edit-operation? (quote cut))))) (send item enable enable?)))] - } - @defmethod*[(((edit-menu:create-cut?) boolean))]{ - The result of this method determines if the - corresponding menu-item is created. Override this - to control the creation of the menu-item. - - - defaultly returns #t - } - @defmethod*[(((edit-menu:between-cut-and-copy (menu (instance (subclass?/c menu%)))) void))]{ - This method is called between the addition of the cut menu-item - and before the addition of the copy menu-item to the edit-menu menu. - Override it to add additional menus at that point. - - - Does nothing. - } - @defmethod*[(((edit-menu:copy-callback (item (instance (subclass?/c menu-item%))) (evt (instance control-event%))) void))]{ - This method is called when the copy menu-item of the edit-menu menu is selected. - - - Defaultly bound to: - @schemeblock[ - (λ (menu evt) - (let ((edit (get-edit-target-object))) - (when (and edit (is-a? edit editor<%>)) - (send edit do-edit-operation 'copy))) - #t)] - - } - @defmethod*[(((edit-menu:get-copy-item) (instance menu-item%)))]{ - This method returns the @scheme[menu-item%] that corresponds - to this menu item. - - } - @defmethod*[(((edit-menu:copy-string) string))]{ - The result of this method is the name of this menu. - - defaultly returns "(string-constant copy-menu-item)" - } - @defmethod*[(((edit-menu:copy-help-string) string))]{ - This result of this method is used as the help string when the - @scheme[menu-item%] - object is created. - - - Defaultly returns @scheme[(string-constant copy-info)] - } - @defmethod*[(((edit-menu:copy-on-demand (item menu-item%)) void))]{ - The menu item's on-demand method calls this method - - - Defaultly is this: - @scheme[(λ (item) (let* ((editor (get-edit-target-object)) (enable? (and editor (is-a? editor editor<%>) (send editor can-do-edit-operation? (quote copy))))) (send item enable enable?)))] - } - @defmethod*[(((edit-menu:create-copy?) boolean))]{ - The result of this method determines if the - corresponding menu-item is created. Override this - to control the creation of the menu-item. - - - defaultly returns #t - } - @defmethod*[(((edit-menu:between-copy-and-paste (menu (instance (subclass?/c menu%)))) void))]{ - This method is called between the addition of the copy menu-item - and before the addition of the paste menu-item to the edit-menu menu. - Override it to add additional menus at that point. - - - Does nothing. - } - @defmethod*[(((edit-menu:paste-callback (item (instance (subclass?/c menu-item%))) (evt (instance control-event%))) void))]{ - This method is called when the paste menu-item of the edit-menu menu is selected. - - - Defaultly bound to: - @schemeblock[ - (λ (menu evt) - (let ((edit (get-edit-target-object))) - (when (and edit (is-a? edit editor<%>)) - (send edit do-edit-operation 'paste))) - #t)] - - } - @defmethod*[(((edit-menu:get-paste-item) (instance menu-item%)))]{ - This method returns the @scheme[menu-item%] that corresponds - to this menu item. - - } - @defmethod*[(((edit-menu:paste-string) string))]{ - The result of this method is the name of this menu. - - defaultly returns "(string-constant paste-menu-item)" - } - @defmethod*[(((edit-menu:paste-help-string) string))]{ - This result of this method is used as the help string when the - @scheme[menu-item%] - object is created. - - - Defaultly returns @scheme[(string-constant paste-info)] - } - @defmethod*[(((edit-menu:paste-on-demand (item menu-item%)) void))]{ - The menu item's on-demand method calls this method - - - Defaultly is this: - @scheme[(λ (item) (let* ((editor (get-edit-target-object)) (enable? (and editor (is-a? editor editor<%>) (send editor can-do-edit-operation? (quote paste))))) (send item enable enable?)))] - } - @defmethod*[(((edit-menu:create-paste?) boolean))]{ - The result of this method determines if the - corresponding menu-item is created. Override this - to control the creation of the menu-item. - - - defaultly returns #t - } - @defmethod*[(((edit-menu:between-paste-and-clear (menu (instance (subclass?/c menu%)))) void))]{ - This method is called between the addition of the paste menu-item - and before the addition of the clear menu-item to the edit-menu menu. - Override it to add additional menus at that point. - - - Does nothing. - } - @defmethod*[(((edit-menu:clear-callback (item (instance (subclass?/c menu-item%))) (evt (instance control-event%))) void))]{ - This method is called when the clear menu-item of the edit-menu menu is selected. - - - Defaultly bound to: - @schemeblock[ - (λ (menu evt) - (let ((edit (get-edit-target-object))) - (when (and edit (is-a? edit editor<%>)) - (send edit do-edit-operation 'clear))) - #t)] - - } - @defmethod*[(((edit-menu:get-clear-item) (instance menu-item%)))]{ - This method returns the @scheme[menu-item%] that corresponds - to this menu item. - - } - @defmethod*[(((edit-menu:clear-string) string))]{ - The result of this method is the name of this menu. - - defaultly returns "(if (eq? (system-type) (quote windows)) (string-constant clear-menu-item-windows) (string-constant clear-menu-item-windows))" - } - @defmethod*[(((edit-menu:clear-help-string) string))]{ - This result of this method is used as the help string when the - @scheme[menu-item%] - object is created. - - - Defaultly returns @scheme[(string-constant clear-info)] - } - @defmethod*[(((edit-menu:clear-on-demand (item menu-item%)) void))]{ - The menu item's on-demand method calls this method - - - Defaultly is this: - @scheme[(λ (item) (let* ((editor (get-edit-target-object)) (enable? (and editor (is-a? editor editor<%>) (send editor can-do-edit-operation? (quote clear))))) (send item enable enable?)))] - } - @defmethod*[(((edit-menu:create-clear?) boolean))]{ - The result of this method determines if the - corresponding menu-item is created. Override this - to control the creation of the menu-item. - - - defaultly returns #t - } - @defmethod*[(((edit-menu:between-clear-and-select-all (menu (instance (subclass?/c menu%)))) void))]{ - This method is called between the addition of the clear menu-item - and before the addition of the select-all menu-item to the edit-menu menu. - Override it to add additional menus at that point. - - - Does nothing. - } - @defmethod*[(((edit-menu:select-all-callback (item (instance (subclass?/c menu-item%))) (evt (instance control-event%))) void))]{ - This method is called when the select-all menu-item of the edit-menu menu is selected. - - - Defaultly bound to: - @schemeblock[ - (λ (menu evt) - (let ((edit (get-edit-target-object))) - (when (and edit (is-a? edit editor<%>)) - (send edit do-edit-operation 'select-all))) - #t)] - - } - @defmethod*[(((edit-menu:get-select-all-item) (instance menu-item%)))]{ - This method returns the @scheme[menu-item%] that corresponds - to this menu item. - - } - @defmethod*[(((edit-menu:select-all-string) string))]{ - The result of this method is the name of this menu. - - defaultly returns "(string-constant select-all-menu-item)" - } - @defmethod*[(((edit-menu:select-all-help-string) string))]{ - This result of this method is used as the help string when the - @scheme[menu-item%] - object is created. - - - Defaultly returns @scheme[(string-constant select-all-info)] - } - @defmethod*[(((edit-menu:select-all-on-demand (item menu-item%)) void))]{ - The menu item's on-demand method calls this method - - - Defaultly is this: - @scheme[(λ (item) (let* ((editor (get-edit-target-object)) (enable? (and editor (is-a? editor editor<%>) (send editor can-do-edit-operation? (quote select-all))))) (send item enable enable?)))] - } - @defmethod*[(((edit-menu:create-select-all?) boolean))]{ - The result of this method determines if the - corresponding menu-item is created. Override this - to control the creation of the menu-item. - - - defaultly returns #t - } - @defmethod*[(((edit-menu:between-select-all-and-find (menu (instance (subclass?/c menu%)))) void))]{ - This method is called between the addition of the select-all menu-item - and before the addition of the find menu-item to the edit-menu menu. - Override it to add additional menus at that point. - - - Adds a separator menu item. - } - @defmethod*[(((edit-menu:find-callback (item (instance (subclass?/c menu-item%))) (evt (instance control-event%))) void))]{ - This method is called when the find menu-item of the edit-menu menu is selected. - - - Defaultly bound to: - @schemeblock[ - (λ (item control) (void))] - - } - @defmethod*[(((edit-menu:get-find-item) (instance menu-item%)))]{ - This method returns the @scheme[menu-item%] that corresponds - to this menu item. - - } - @defmethod*[(((edit-menu:find-string) string))]{ - The result of this method is the name of this menu. - - defaultly returns "(string-constant find-menu-item)" - } - @defmethod*[(((edit-menu:find-help-string) string))]{ - This result of this method is used as the help string when the - @scheme[menu-item%] - object is created. - - - Defaultly returns @scheme[(string-constant find-info)] - } - @defmethod*[(((edit-menu:find-on-demand (item menu-item%)) void))]{ - The menu item's on-demand method calls this method - - - Defaultly is this: - @scheme[(λ (item) (send item enable (let ((target (get-edit-target-object))) (and target (is-a? target editor<%>)))))] - } - @defmethod*[(((edit-menu:create-find?) boolean))]{ - The result of this method determines if the - corresponding menu-item is created. Override this - to control the creation of the menu-item. - - - defaultly returns @scheme[#f] - } - @defmethod*[(((edit-menu:find-again-callback (item (instance (subclass?/c menu-item%))) (evt (instance control-event%))) void))]{ - This method is called when the find-again menu-item of the edit-menu menu is selected. - - - Defaultly bound to: - @schemeblock[ - (λ (item control) (void))] - - } - @defmethod*[(((edit-menu:get-find-again-item) (instance menu-item%)))]{ - This method returns the @scheme[menu-item%] that corresponds - to this menu item. - - } - @defmethod*[(((edit-menu:find-again-string) string))]{ - The result of this method is the name of this menu. - - defaultly returns "(string-constant find-again-menu-item)" - } - @defmethod*[(((edit-menu:find-again-help-string) string))]{ - This result of this method is used as the help string when the - @scheme[menu-item%] - object is created. - - - Defaultly returns @scheme[(string-constant find-again-info)] - } - @defmethod*[(((edit-menu:find-again-on-demand (item menu-item%)) void))]{ - The menu item's on-demand method calls this method - - - Defaultly is this: - @scheme[(λ (item) (send item enable (let ((target (get-edit-target-object))) (and target (is-a? target editor<%>)))))] - } - @defmethod*[(((edit-menu:create-find-again?) boolean))]{ - The result of this method determines if the - corresponding menu-item is created. Override this - to control the creation of the menu-item. - - - defaultly returns @scheme[#f] - } - @defmethod*[(((edit-menu:replace-and-find-again-callback (item (instance (subclass?/c menu-item%))) (evt (instance control-event%))) void))]{ - This method is called when the replace-and-find-again menu-item of the edit-menu menu is selected. - - - Defaultly bound to: - @schemeblock[ - (λ (item control) (void))] - - } - @defmethod*[(((edit-menu:get-replace-and-find-again-item) (instance menu-item%)))]{ - This method returns the @scheme[menu-item%] that corresponds - to this menu item. - - } - @defmethod*[(((edit-menu:replace-and-find-again-string) string))]{ - The result of this method is the name of this menu. - - defaultly returns "(string-constant replace-and-find-again-menu-item)" - } - @defmethod*[(((edit-menu:replace-and-find-again-help-string) string))]{ - This result of this method is used as the help string when the - @scheme[menu-item%] - object is created. - - - Defaultly returns @scheme[(string-constant replace-and-find-again-info)] - } - @defmethod*[(((edit-menu:replace-and-find-again-on-demand (item menu-item%)) void))]{ - The menu item's on-demand method calls this method - - - Defaultly is this: - @scheme[(λ (item) (send item enable (let ((target (get-edit-target-object))) (and target (is-a? target editor<%>)))))] - } - @defmethod*[(((edit-menu:create-replace-and-find-again?) boolean))]{ - The result of this method determines if the - corresponding menu-item is created. Override this - to control the creation of the menu-item. - - - defaultly returns @scheme[#f] - } - @defmethod*[(((edit-menu:between-find-and-preferences (menu (instance (subclass?/c menu%)))) void))]{ - This method is called between the addition of the find menu-item - and before the addition of the preferences menu-item to the edit-menu menu. - Override it to add additional menus at that point. - - - Adds a separator except when @scheme[current-eventspace-has-standard-menus?] returns @scheme[#t]. - } - @defmethod*[(((edit-menu:preferences-callback (item (instance (subclass?/c menu-item%))) (evt (instance control-event%))) void))]{ - This method is called when the preferences menu-item of the edit-menu menu is selected. - - - Defaultly bound to: - @schemeblock[ - (λ (item control) (preferences:show-dialog) #t)] - - } - @defmethod*[(((edit-menu:get-preferences-item) (instance menu-item%)))]{ - This method returns the @scheme[menu-item%] that corresponds - to this menu item. - - } - @defmethod*[(((edit-menu:preferences-string) string))]{ - The result of this method is the name of this menu. - - defaultly returns "(string-constant preferences-menu-item)" - } - @defmethod*[(((edit-menu:preferences-help-string) string))]{ - This result of this method is used as the help string when the - @scheme[menu-item%] - object is created. - - - Defaultly returns @scheme[(string-constant preferences-info)] - } - @defmethod*[(((edit-menu:preferences-on-demand (item menu-item%)) void))]{ - The menu item's on-demand method calls this method - - - Defaultly is this: - @scheme[(λ (menu-item) (void))] - } - @defmethod*[(((edit-menu:create-preferences?) boolean))]{ - The result of this method determines if the - corresponding menu-item is created. Override this - to control the creation of the menu-item. - - - defaultly returns (not (current-eventspace-has-standard-menus?)) - } - @defmethod*[(((edit-menu:after-preferences (menu (instance (subclass?/c menu%)))) void))]{ - This method is called after the addition of the preferences menu-item - to the edit-menu menu. - Override it to add additional menus at that point. - - - Does nothing. - } - @defmethod*[(((help-menu:before-about (menu (instance (subclass?/c menu%)))) void))]{ - This method is called before the addition of the about menu-item - to the help-menu menu. - Override it to add additional menus at that point. - - - Does nothing. - } - @defmethod*[(((help-menu:about-callback (item (instance (subclass?/c menu-item%))) (evt (instance control-event%))) void))]{ - This method is called when the about menu-item of the help-menu menu is selected. - - - Defaultly bound to: - @schemeblock[ - (λ (item control) (void))] - - } - @defmethod*[(((help-menu:get-about-item) (instance menu-item%)))]{ - This method returns the @scheme[menu-item%] that corresponds - to this menu item. - - } - @defmethod*[(((help-menu:about-string) string))]{ - The result of this method is the name of this menu. - - defaultly returns "(string-constant about-menu-item)" - } - @defmethod*[(((help-menu:about-help-string) string))]{ - This result of this method is used as the help string when the - @scheme[menu-item%] - object is created. - - - Defaultly returns @scheme[(string-constant about-info)] - } - @defmethod*[(((help-menu:about-on-demand (item menu-item%)) void))]{ - The menu item's on-demand method calls this method - - - Defaultly is this: - @scheme[(λ (menu-item) (void))] - } - @defmethod*[(((help-menu:create-about?) boolean))]{ - The result of this method determines if the - corresponding menu-item is created. Override this - to control the creation of the menu-item. - - - defaultly returns @scheme[#f] - } - @defmethod*[(((help-menu:after-about (menu (instance (subclass?/c menu%)))) void))]{ - This method is called after the addition of the about menu-item - to the help-menu menu. - Override it to add additional menus at that point. - - - Does nothing. - } -} @defmixin[frame:standard-menus-mixin (frame:basic<%>) (frame:standard-menus<%>)]{ The result of this mixin implements @scheme[frame:standard-menus<%>]. diff --git a/collects/scribblings/framework/standard-menus.scrbl b/collects/scribblings/framework/standard-menus.scrbl new file mode 100644 index 0000000000..54d3b1ca2b --- /dev/null +++ b/collects/scribblings/framework/standard-menus.scrbl @@ -0,0 +1,304 @@ +;; THIS FILE IS GENERATED. DO NOT EDIT. + +@definterface[frame:standard-menus<%> (frame:basic<%>)]{ + @(defmethod (on-close) void? "Removes the preferences callbacks for the menu items") + +@(defmethod (get-menu%) (is-a?/c menu:can-restore-underscore-menu%) "The result of this method is used as the class" "\n" " " "for creating the result of these methods:" "\n" " " (method frame:standard-menus get-file-menu) "," "\n" " " (method frame:standard-menus get-edit-menu) ", and" "\n" " " (method frame:standard-menus get-help-menu) ".") + +@(defmethod (get-menu-item%) (is-a?/c menu:can-restore-menu-item%) "The result of this method is used as the class for creating" "\n" "the menu items in this frame." "\n" "\n" "Defaultly returns " (scheme menu:can-restore-menu-item) ".") + +@(defmethod (get-checkable-menu-item%) (is-a?/c menu:can-restore-checkable-menu-item%) "The result of this method is used as the class for creating" "\n" "checkable menu items in this class." "\n" "\n" "Defaultly returns " (scheme menu:can-restore-checkable-menu-item) ".") + +@(defmethod (get-file-menu) (is-a?/c menu%) "Returns the file menu." "\n" "See also " (method frame:standard-menus<%> get-menu%) ".") + +@(defmethod (get-edit-menu) (is-a?/c menu%) "Returns the edit menu." "\n" "See also " (method frame:standard-menus<%> get-menu%) ".") + +@(defmethod (get-help-menu) (is-a?/c menu%) "Returns the help menu." "\n" "See also " (method frame:standard-menus<%> get-menu%) ".") + +@(defmethod (file-menu:get-new-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<%> file-menu:create-new?) ").") + +@(defmethod (file-menu:create-new?) 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 #t) ".") + +@(defmethod (file-menu:new-callback (item (is-a?/c menu-item%)) (control (is-a?/c control-event%))) void? "Defaults to " (schemeblock (begin (handler:edit-file #f) #t)) " ") + +@(defmethod (file-menu:new-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 (file-menu:new-string) string? "The result of this method is used as the name of the " (scheme menu-item%) "." "\n" "\n" "Defaults to " (scheme (string-constant new-menu-item)) ".") + +@(defmethod (file-menu:new-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 new-info)) ".") + +@(defmethod (file-menu:between-new-and-open (menu (is-a?/c menu-item%))) void? "This method is called between the addition of the" "\n" (tt "new") " and the " (tt "open") " menu-item." "\n" "Override it to add additional menu items at that point. ") + +@(defmethod (file-menu:get-open-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<%> file-menu:create-open?) ").") + +@(defmethod (file-menu:create-open?) 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 #t) ".") + +@(defmethod (file-menu:open-callback (item (is-a?/c menu-item%)) (control (is-a?/c control-event%))) void? "Defaults to " (schemeblock (begin (handler:open-file) #t)) " ") + +@(defmethod (file-menu:open-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 (file-menu:open-string) string? "The result of this method is used as the name of the " (scheme menu-item%) "." "\n" "\n" "Defaults to " (scheme (string-constant open-menu-item)) ".") + +@(defmethod (file-menu:open-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 open-info)) ".") + +@(defmethod (file-menu:get-open-recent-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<%> file-menu:create-open-recent?) ").") + +@(defmethod (file-menu:create-open-recent?) 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 #t) ".") + +@(defmethod (file-menu:open-recent-callback (x (is-a?/c menu-item%)) (y (is-a?/c control-event%))) void? "Defaults to " (schemeblock (void)) " ") + +@(defmethod (file-menu:open-recent-on-demand (menu (is-a?/c menu-item%))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (schemeblock (handler:install-recent-items menu))) + +@(defmethod (file-menu:open-recent-string) string? "The result of this method is used as the name of the " (scheme menu-item%) "." "\n" "\n" "Defaults to " (scheme (string-constant open-recent-menu-item)) ".") + +@(defmethod (file-menu:open-recent-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 open-recent-info)) ".") + +@(defmethod (file-menu:between-open-and-revert (menu (is-a?/c menu-item%))) void? "This method is called between the addition of the" "\n" (tt "open") " and the " (tt "revert") " menu-item." "\n" "Override it to add additional menu items at that point. ") + +@(defmethod (file-menu:get-revert-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<%> file-menu:create-revert?) ").") + +@(defmethod (file-menu:create-revert?) 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 (file-menu:revert-callback (item (is-a?/c menu-item%)) (control (is-a?/c control-event%))) void? "Defaults to " (schemeblock (void)) " ") + +@(defmethod (file-menu:revert-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 (file-menu:revert-string) string? "The result of this method is used as the name of the " (scheme menu-item%) "." "\n" "\n" "Defaults to " (scheme (string-constant revert-menu-item)) ".") + +@(defmethod (file-menu:revert-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 revert-info)) ".") + +@(defmethod (file-menu:between-revert-and-save (menu (is-a?/c menu-item%))) void? "This method is called between the addition of the" "\n" (tt "revert") " and the " (tt "save") " menu-item." "\n" "Override it to add additional menu items at that point. ") + +@(defmethod (file-menu:get-save-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<%> file-menu:create-save?) ").") + +@(defmethod (file-menu:create-save?) 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 (file-menu:save-callback (item (is-a?/c menu-item%)) (control (is-a?/c control-event%))) void? "Defaults to " (schemeblock (void)) " ") + +@(defmethod (file-menu:save-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 (file-menu:save-string) string? "The result of this method is used as the name of the " (scheme menu-item%) "." "\n" "\n" "Defaults to " (scheme (string-constant save-menu-item)) ".") + +@(defmethod (file-menu:save-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 save-info)) ".") + +@(defmethod (file-menu:get-save-as-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<%> file-menu:create-save-as?) ").") + +@(defmethod (file-menu:create-save-as?) 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 (file-menu:save-as-callback (item (is-a?/c menu-item%)) (control (is-a?/c control-event%))) void? "Defaults to " (schemeblock (void)) " ") + +@(defmethod (file-menu:save-as-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 (file-menu:save-as-string) string? "The result of this method is used as the name of the " (scheme menu-item%) "." "\n" "\n" "Defaults to " (scheme (string-constant save-as-menu-item)) ".") + +@(defmethod (file-menu:save-as-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 save-as-info)) ".") + +@(defmethod (file-menu:between-save-as-and-print (menu (is-a?/c menu-item%))) void? "This method is called between the addition of the" "\n" (tt "save-as") " and the " (tt "print") " menu-item." "\n" "Override it to add additional menu items at that point. ") + +@(defmethod (file-menu:get-print-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<%> file-menu:create-print?) ").") + +@(defmethod (file-menu:create-print?) 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 (file-menu:print-callback (item (is-a?/c menu-item%)) (control (is-a?/c control-event%))) void? "Defaults to " (schemeblock (void)) " ") + +@(defmethod (file-menu:print-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 (file-menu:print-string) string? "The result of this method is used as the name of the " (scheme menu-item%) "." "\n" "\n" "Defaults to " (scheme (string-constant print-menu-item)) ".") + +@(defmethod (file-menu:print-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 print-info)) ".") + +@(defmethod (file-menu:between-print-and-close (menu (is-a?/c menu-item%))) void? "This method is called between the addition of the" "\n" (tt "print") " and the " (tt "close") " menu-item." "\n" "Override it to add additional menu items at that point. ") + +@(defmethod (file-menu:get-close-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<%> file-menu:create-close?) ").") + +@(defmethod (file-menu:create-close?) 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 #t) ".") + +@(defmethod (file-menu:close-callback (item (is-a?/c menu-item%)) (control (is-a?/c control-event%))) void? "Defaults to " (schemeblock (begin (when (can-close?) (on-close) (show #f)) #t)) " ") + +@(defmethod (file-menu:close-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 (file-menu:close-string) string? "The result of this method is used as the name of the " (scheme menu-item%) "." "\n" "\n" "Defaults to " (scheme (string-constant close-menu-item)) ".") + +@(defmethod (file-menu:close-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 close-info)) ".") + +@(defmethod (file-menu:between-close-and-quit (menu (is-a?/c menu-item%))) void? "This method is called between the addition of the" "\n" (tt "close") " and the " (tt "quit") " menu-item." "\n" "Override it to add additional menu items at that point. ") + +@(defmethod (file-menu:get-quit-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<%> file-menu:create-quit?) ").") + +@(defmethod (file-menu:create-quit?) 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 (not (current-eventspace-has-standard-menus?))) ".") + +@(defmethod (file-menu:quit-callback (item (is-a?/c menu-item%)) (control (is-a?/c control-event%))) void? "Defaults to " (schemeblock (when (exit:user-oks-exit) (exit:exit))) " ") + +@(defmethod (file-menu:quit-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 (file-menu:quit-string) string? "The result of this method is used as the name of the " (scheme menu-item%) "." "\n" "\n" "Defaults to " (scheme (if (eq? (system-type) (quote windows)) (string-constant quit-menu-item-windows) (string-constant quit-menu-item-others))) ".") + +@(defmethod (file-menu:quit-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 quit-info)) ".") + +@(defmethod (file-menu:after-quit (menu (is-a?/c menu-item%))) void? "This method is called " "after" " the addition of the" "\n" (tt "quit") " menu-item. Override it to add additional" "\n" "menu items at that point. ") + +@(defmethod (edit-menu:get-undo-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-undo?) ").") + +@(defmethod (edit-menu:create-undo?) 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 #t) ".") + +@(defmethod (edit-menu:undo-callback (menu (is-a?/c menu-item%)) (evt (is-a?/c control-event%))) void? "Defaults to " (schemeblock (begin (let ((edit (get-edit-target-object))) (when (and edit (is-a? edit editor<%>)) (send edit do-edit-operation (quote undo)))) #t)) " ") + +@(defmethod (edit-menu:undo-on-demand (item (is-a?/c menu-item%))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (schemeblock (let* ((editor (get-edit-target-object)) (enable? (and editor (is-a? editor editor<%>) (send editor can-do-edit-operation? (quote undo))))) (send item enable enable?)))) + +@(defmethod (edit-menu:undo-string) string? "The result of this method is used as the name of the " (scheme menu-item%) "." "\n" "\n" "Defaults to " (scheme (string-constant undo-menu-item)) ".") + +@(defmethod (edit-menu:undo-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 undo-info)) ".") + +@(defmethod (edit-menu:get-redo-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-redo?) ").") + +@(defmethod (edit-menu:create-redo?) 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 #t) ".") + +@(defmethod (edit-menu:redo-callback (menu (is-a?/c menu-item%)) (evt (is-a?/c control-event%))) void? "Defaults to " (schemeblock (begin (let ((edit (get-edit-target-object))) (when (and edit (is-a? edit editor<%>)) (send edit do-edit-operation (quote redo)))) #t)) " ") + +@(defmethod (edit-menu:redo-on-demand (item (is-a?/c menu-item%))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (schemeblock (let* ((editor (get-edit-target-object)) (enable? (and editor (is-a? editor editor<%>) (send editor can-do-edit-operation? (quote redo))))) (send item enable enable?)))) + +@(defmethod (edit-menu:redo-string) string? "The result of this method is used as the name of the " (scheme menu-item%) "." "\n" "\n" "Defaults to " (scheme (string-constant redo-menu-item)) ".") + +@(defmethod (edit-menu:redo-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 redo-info)) ".") + +@(defmethod (edit-menu:between-redo-and-cut (menu (is-a?/c menu-item%))) void? "This method is called between the addition of the" "\n" (tt "redo") " and the " (tt "cut") " menu-item." "\n" "Override it to add additional menu items at that point. ") + +@(defmethod (edit-menu:get-cut-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-cut?) ").") + +@(defmethod (edit-menu:create-cut?) 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 #t) ".") + +@(defmethod (edit-menu:cut-callback (menu (is-a?/c menu-item%)) (evt (is-a?/c control-event%))) void? "Defaults to " (schemeblock (begin (let ((edit (get-edit-target-object))) (when (and edit (is-a? edit editor<%>)) (send edit do-edit-operation (quote cut)))) #t)) " ") + +@(defmethod (edit-menu:cut-on-demand (item (is-a?/c menu-item%))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (schemeblock (let* ((editor (get-edit-target-object)) (enable? (and editor (is-a? editor editor<%>) (send editor can-do-edit-operation? (quote cut))))) (send item enable enable?)))) + +@(defmethod (edit-menu:cut-string) string? "The result of this method is used as the name of the " (scheme menu-item%) "." "\n" "\n" "Defaults to " (scheme (string-constant cut-menu-item)) ".") + +@(defmethod (edit-menu:cut-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 cut-info)) ".") + +@(defmethod (edit-menu:between-cut-and-copy (menu (is-a?/c menu-item%))) void? "This method is called between the addition of the" "\n" (tt "cut") " and the " (tt "copy") " menu-item." "\n" "Override it to add additional menu items at that point. ") + +@(defmethod (edit-menu:get-copy-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-copy?) ").") + +@(defmethod (edit-menu:create-copy?) 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 #t) ".") + +@(defmethod (edit-menu:copy-callback (menu (is-a?/c menu-item%)) (evt (is-a?/c control-event%))) void? "Defaults to " (schemeblock (begin (let ((edit (get-edit-target-object))) (when (and edit (is-a? edit editor<%>)) (send edit do-edit-operation (quote copy)))) #t)) " ") + +@(defmethod (edit-menu:copy-on-demand (item (is-a?/c menu-item%))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (schemeblock (let* ((editor (get-edit-target-object)) (enable? (and editor (is-a? editor editor<%>) (send editor can-do-edit-operation? (quote copy))))) (send item enable enable?)))) + +@(defmethod (edit-menu:copy-string) string? "The result of this method is used as the name of the " (scheme menu-item%) "." "\n" "\n" "Defaults to " (scheme (string-constant copy-menu-item)) ".") + +@(defmethod (edit-menu:copy-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 copy-info)) ".") + +@(defmethod (edit-menu:between-copy-and-paste (menu (is-a?/c menu-item%))) void? "This method is called between the addition of the" "\n" (tt "copy") " and the " (tt "paste") " menu-item." "\n" "Override it to add additional menu items at that point. ") + +@(defmethod (edit-menu:get-paste-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-paste?) ").") + +@(defmethod (edit-menu:create-paste?) 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 #t) ".") + +@(defmethod (edit-menu:paste-callback (menu (is-a?/c menu-item%)) (evt (is-a?/c control-event%))) void? "Defaults to " (schemeblock (begin (let ((edit (get-edit-target-object))) (when (and edit (is-a? edit editor<%>)) (send edit do-edit-operation (quote paste)))) #t)) " ") + +@(defmethod (edit-menu:paste-on-demand (item (is-a?/c menu-item%))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (schemeblock (let* ((editor (get-edit-target-object)) (enable? (and editor (is-a? editor editor<%>) (send editor can-do-edit-operation? (quote paste))))) (send item enable enable?)))) + +@(defmethod (edit-menu:paste-string) string? "The result of this method is used as the name of the " (scheme menu-item%) "." "\n" "\n" "Defaults to " (scheme (string-constant paste-menu-item)) ".") + +@(defmethod (edit-menu:paste-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 paste-info)) ".") + +@(defmethod (edit-menu:between-paste-and-clear (menu (is-a?/c menu-item%))) void? "This method is called between the addition of the" "\n" (tt "paste") " and the " (tt "clear") " menu-item." "\n" "Override it to add additional menu items at that point. ") + +@(defmethod (edit-menu:get-clear-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-clear?) ").") + +@(defmethod (edit-menu:create-clear?) 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 #t) ".") + +@(defmethod (edit-menu:clear-callback (menu (is-a?/c menu-item%)) (evt (is-a?/c control-event%))) void? "Defaults to " (schemeblock (begin (let ((edit (get-edit-target-object))) (when (and edit (is-a? edit editor<%>)) (send edit do-edit-operation (quote clear)))) #t)) " ") + +@(defmethod (edit-menu:clear-on-demand (item (is-a?/c menu-item%))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (schemeblock (let* ((editor (get-edit-target-object)) (enable? (and editor (is-a? editor editor<%>) (send editor can-do-edit-operation? (quote clear))))) (send item enable enable?)))) + +@(defmethod (edit-menu:clear-string) string? "The result of this method is used as the name of the " (scheme menu-item%) "." "\n" "\n" "Defaults to " (scheme (if (eq? (system-type) (quote windows)) (string-constant clear-menu-item-windows) (string-constant clear-menu-item-windows))) ".") + +@(defmethod (edit-menu:clear-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 clear-info)) ".") + +@(defmethod (edit-menu:between-clear-and-select-all (menu (is-a?/c menu-item%))) void? "This method is called between the addition of the" "\n" (tt "clear") " and the " (tt "select-all") " menu-item." "\n" "Override it to add additional menu items at that point. ") + +@(defmethod (edit-menu:get-select-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-select-all?) ").") + +@(defmethod (edit-menu:create-select-all?) 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 #t) ".") + +@(defmethod (edit-menu:select-all-callback (menu (is-a?/c menu-item%)) (evt (is-a?/c control-event%))) void? "Defaults to " (schemeblock (begin (let ((edit (get-edit-target-object))) (when (and edit (is-a? edit editor<%>)) (send edit do-edit-operation (quote select-all)))) #t)) " ") + +@(defmethod (edit-menu:select-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 (let* ((editor (get-edit-target-object)) (enable? (and editor (is-a? editor editor<%>) (send editor can-do-edit-operation? (quote select-all))))) (send item enable enable?)))) + +@(defmethod (edit-menu:select-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 select-all-menu-item)) ".") + +@(defmethod (edit-menu:select-all-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 select-all-info)) ".") + +@(defmethod (edit-menu:between-select-all-and-find (menu (is-a?/c menu-item%))) void? "This method is called between the addition of the" "\n" (tt "select-all") " and the " (tt "find") " menu-item." "\n" "Override it to add additional menu items at that point. ") + +@(defmethod (edit-menu:get-find-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?) ").") + +@(defmethod (edit-menu:create-find?) 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-callback (item (is-a?/c menu-item%)) (control (is-a?/c control-event%))) void? "Defaults to " (schemeblock (void)) " ") + +@(defmethod (edit-menu:find-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-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-menu-item)) ".") + +@(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: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:find-again-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-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-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: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: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: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: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: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: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:between-find-and-preferences (menu (is-a?/c menu-item%))) void? "This method is called between the addition of the" "\n" (tt "find") " and the " (tt "preferences") " menu-item." "\n" "Override it to add additional menu items at that point. ") + +@(defmethod (edit-menu:get-preferences-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-preferences?) ").") + +@(defmethod (edit-menu:create-preferences?) 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 (not (current-eventspace-has-standard-menus?))) ".") + +@(defmethod (edit-menu:preferences-callback (item (is-a?/c menu-item%)) (control (is-a?/c control-event%))) void? "Defaults to " (schemeblock (begin (preferences:show-dialog) #t)) " ") + +@(defmethod (edit-menu:preferences-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:preferences-string) string? "The result of this method is used as the name of the " (scheme menu-item%) "." "\n" "\n" "Defaults to " (scheme (string-constant preferences-menu-item)) ".") + +@(defmethod (edit-menu:preferences-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 preferences-info)) ".") + +@(defmethod (edit-menu:after-preferences (menu (is-a?/c menu-item%))) void? "This method is called " "after" " the addition of the" "\n" (tt "preferences") " menu-item. Override it to add additional" "\n" "menu items at that point. ") + +@(defmethod (help-menu:before-about (menu (is-a?/c menu-item%))) void? "This method is called " "before" " the addition of the" "\n" (tt "about") " menu-item. Override it to add additional" "\n" "menu items at that point. ") + +@(defmethod (help-menu:get-about-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<%> help-menu:create-about?) ").") + +@(defmethod (help-menu:create-about?) 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 (help-menu:about-callback (item (is-a?/c menu-item%)) (control (is-a?/c control-event%))) void? "Defaults to " (schemeblock (void)) " ") + +@(defmethod (help-menu:about-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 (help-menu:about-string) string? "The result of this method is used as the name of the " (scheme menu-item%) "." "\n" "\n" "Defaults to " (scheme (string-constant about-menu-item)) ".") + +@(defmethod (help-menu:about-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 about-info)) ".") + +@(defmethod (help-menu:after-about (menu (is-a?/c menu-item%))) void? "This method is called " "after" " the addition of the" "\n" (tt "about") " menu-item. Override it to add additional" "\n" "menu items at that point. ") + +} \ No newline at end of file