Improve code generation in the framework collection.
Instead of generating a file for code and one for documentation, do both via a macro instead. Most of the code is the same (modulo reformatting in a more modern style), and instead of printing the result to a file, it just returns it as the result of a macro. (Since this is done in a naive way, the macro is bad -- it is unhygienic since this is basically what it did before only through a generated file; it should eventually be improved to avoid these hacks.)
This commit is contained in:
parent
656de69636
commit
093236fea4
|
@ -3,16 +3,16 @@
|
|||
(require string-constants
|
||||
racket/class
|
||||
racket/contract/base
|
||||
mzlib/include
|
||||
racket/path
|
||||
"search.rkt"
|
||||
"sig.rkt"
|
||||
"../preferences.rkt"
|
||||
"../gui-utils.rkt"
|
||||
"bday.rkt"
|
||||
"gen-standard-menus.rkt"
|
||||
framework/private/focus-table
|
||||
mrlib/close-icon
|
||||
mred/mred-sig
|
||||
racket/path)
|
||||
mred/mred-sig)
|
||||
|
||||
(import mred^
|
||||
[prefix group: framework:group^]
|
||||
|
@ -1168,7 +1168,7 @@
|
|||
(mixin (basic<%>) (pasteboard-info<%>)
|
||||
(super-new)))
|
||||
|
||||
(include "standard-menus.rktl")
|
||||
(generate-standard-menus-code)
|
||||
|
||||
(define -editor<%> (interface (standard-menus<%>)
|
||||
get-entire-label
|
||||
|
|
|
@ -1,292 +1,234 @@
|
|||
#reader scribble/reader
|
||||
#lang racket/base
|
||||
(provide main)
|
||||
(require scheme/pretty
|
||||
racket/match
|
||||
racket/runtime-path)
|
||||
(require "standard-menus-items.rkt")
|
||||
#lang at-exp racket/base
|
||||
|
||||
(define-runtime-path here ".")
|
||||
;; Generates the framework code for standard menus, and the code for
|
||||
;; their documentation. This is done in a naive way (replaces older
|
||||
;; code that generated files), should really be made into proper macros
|
||||
;; instead.
|
||||
|
||||
(define standard-menus.rktl-filename
|
||||
(simplify-path (build-path here "standard-menus.rktl")))
|
||||
(define docs-menus-filename
|
||||
(simplify-path (build-path here 'up 'up
|
||||
"scribblings" "framework" "standard-menus.scrbl")))
|
||||
(require (for-syntax racket/base racket/list racket/match syntax/strip-context
|
||||
racket/pretty "standard-menus-items.rkt"))
|
||||
|
||||
;; 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)))))
|
||||
(define-for-syntax (build-before-super-item-clause item)
|
||||
`((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))]))))))
|
||||
(define-for-syntax ((build-before-super-clause ->name -procedure) obj)
|
||||
`((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))
|
||||
(define-for-syntax 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))
|
||||
(define-for-syntax 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)
|
||||
(define-for-syntax (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 ,(if (a-checkable-item? item)
|
||||
'(get-checkable-menu-item%)
|
||||
'(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))))))))))
|
||||
`((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 ,(if (a-checkable-item? item)
|
||||
'(get-checkable-menu-item%)
|
||||
'(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)))))))
|
||||
(define-for-syntax ((build-after-super-clause ->name) between/after)
|
||||
`((,(->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))
|
||||
(define-for-syntax 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))
|
||||
(define-for-syntax 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]))
|
||||
(define-for-syntax (build-after-super-generic-clause x)
|
||||
(cond [(generic-private-field? x)
|
||||
`((define ,(generic-name x) ,(generic-initializer x)))]
|
||||
[(generic-override? x) '()]
|
||||
[(generic-augment? x) '()]
|
||||
[(generic-method? x) '()]))
|
||||
|
||||
;; build-before-super-generic-clause : generic -> (listof clause)
|
||||
(define (build-before-super-generic-clause generic)
|
||||
(define-for-syntax (build-before-super-generic-clause generic)
|
||||
(cond [(generic-private-field? generic)
|
||||
'()]
|
||||
[(generic-override? generic)
|
||||
`((define/override ,(generic-name generic)
|
||||
,(generic-initializer generic)))]
|
||||
[(generic-augment? generic)
|
||||
`((define/augment ,(generic-name generic)
|
||||
,(generic-initializer generic)))]
|
||||
[(generic-method? generic)
|
||||
`((define/public ,(generic-name generic)
|
||||
,(generic-initializer generic)))]))
|
||||
|
||||
(provide generate-standard-menus-code)
|
||||
(define-syntax (generate-standard-menus-code stx)
|
||||
(datum->syntax
|
||||
stx
|
||||
`(begin
|
||||
(define standard-menus<%>
|
||||
(interface (basic<%>)
|
||||
,@(append-map
|
||||
(λ (x)
|
||||
(cond [(an-item? x)
|
||||
(list (an-item->callback-name x)
|
||||
(an-item->get-item-name x)
|
||||
(an-item->string-name x)
|
||||
(an-item->help-string-name x)
|
||||
(an-item->on-demand-name x)
|
||||
(an-item->create-menu-item-name x))]
|
||||
[(between? x)
|
||||
(list (between->name x))]
|
||||
[(or (after? x) (before? x))
|
||||
(list (before/after->name x))]
|
||||
[(generic? x)
|
||||
(if (generic-method? x) (list (generic-name x)) '())]))
|
||||
items)))
|
||||
(define standard-menus-mixin
|
||||
(mixin (basic<%>) (standard-menus<%>)
|
||||
(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)))))))
|
||||
(inherit get-menu-bar show can-close? get-edit-target-object)
|
||||
,@(append-map
|
||||
(λ (x)
|
||||
(cond [(between? x) (build-before-super-between-clause x)]
|
||||
[(or (after? x) (before? x))
|
||||
(build-before-super-before/after-clause x)]
|
||||
[(an-item? x) (build-before-super-item-clause x)]
|
||||
[(generic? x) (build-before-super-generic-clause x)]))
|
||||
items)
|
||||
(super-instantiate ())
|
||||
,@(append-map
|
||||
(λ (x)
|
||||
(cond [(between? x) (build-after-super-between-clause x)]
|
||||
[(an-item? x) (build-after-super-item-clause x)]
|
||||
[(or (after? x) (before? x))
|
||||
(build-after-super-before/after-clause x)]
|
||||
[(generic? x) (build-after-super-generic-clause x)]))
|
||||
items)
|
||||
(reorder-menus this))))))
|
||||
|
||||
(define-for-syntax (generate-item-docs x)
|
||||
(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)))]))
|
||||
[(generic/docs? x)
|
||||
(filter-not string? (generic/docs-documentation x))]
|
||||
[(before/after? x)
|
||||
`(@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)
|
||||
`(@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)
|
||||
`(@defmethod[(,(an-item->get-item-name x)) (or/c false/c (is-a?/c menu-item%))]{
|
||||
This method returns the @racket[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)]).}
|
||||
@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 @racket[,(an-item-create x)].}
|
||||
,(match (an-item-proc x)
|
||||
[`(λ (,item-name ,evt-name) ,bodies ...)
|
||||
`@defmethod[(,(an-item->callback-name x)
|
||||
[,item-name (is-a?/c menu-item%)]
|
||||
[,evt-name (is-a?/c control-event%)])
|
||||
void?]{
|
||||
Defaults to
|
||||
@racketblock[,(if (= 1 (length bodies)) (car bodies) `(begin ,@bodies))] }])
|
||||
,(match (an-item-on-demand x)
|
||||
[`(λ (,item-name) ,body)
|
||||
`@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 @racketblock[,body]}])
|
||||
@defmethod[(,(an-item->string-name x)) string?]{
|
||||
The result of this method is used as the name of the @racket[menu-item%].
|
||||
@||
|
||||
Defaults to @racket[,(an-item-menu-string x)].}
|
||||
@defmethod[(,(an-item->help-string-name x)) string?]{
|
||||
The result of this method is used as the help string
|
||||
when the @racket[menu-item%] object is created.
|
||||
@||
|
||||
Defaults to @racket[,(an-item-help-string x)].})]
|
||||
[else '()]))
|
||||
|
||||
(define (main)
|
||||
(write-standard-menus.rktl)
|
||||
(write-docs))
|
||||
|
||||
(define (write-docs)
|
||||
(printf "writing to ~a\n" docs-menus-filename)
|
||||
(call-with-output-file docs-menus-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 @racket[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 @racket[,(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 @racketblock[,(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 @racketblock[,body]})])
|
||||
|
||||
(pop-out
|
||||
`@defmethod[(,(an-item->string-name x)) string?]{
|
||||
The result of this method is used as the name of the @racket[menu-item%].
|
||||
|
||||
Defaults to @racket[,(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 @racket[menu-item%] object is created.
|
||||
|
||||
Defaults to @racket[,(an-item-help-string x)].})]))
|
||||
|
||||
items)
|
||||
(display docs-footer-text port))
|
||||
#:exists 'truncate))
|
||||
|
||||
(define (write-standard-menus.rktl)
|
||||
(printf "writing to ~a\n" standard-menus.rktl-filename)
|
||||
|
||||
(call-with-output-file standard-menus.rktl-filename
|
||||
(λ (port)
|
||||
(pretty-print
|
||||
`(define standard-menus<%>
|
||||
(interface (basic<%>)
|
||||
,@(apply append (map
|
||||
(λ (x)
|
||||
(cond
|
||||
[(an-item? x)
|
||||
(list
|
||||
(an-item->callback-name x)
|
||||
(an-item->get-item-name x)
|
||||
(an-item->string-name x)
|
||||
(an-item->help-string-name x)
|
||||
(an-item->on-demand-name x)
|
||||
(an-item->create-menu-item-name x))]
|
||||
[(between? x) (list (between->name x))]
|
||||
[(or (after? x) (before? x))
|
||||
(list (before/after->name x))]
|
||||
[(generic? x)
|
||||
(if (generic-method? x)
|
||||
(list (generic-name x))
|
||||
null)]))
|
||||
items))))
|
||||
port)
|
||||
|
||||
(newline port)
|
||||
|
||||
(pretty-print
|
||||
`(define standard-menus-mixin
|
||||
(mixin (basic<%>) (standard-menus<%>)
|
||||
(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)))))))
|
||||
|
||||
(inherit get-menu-bar show can-close? get-edit-target-object)
|
||||
,@(apply append (map (λ (x)
|
||||
(cond
|
||||
[(between? x) (build-before-super-between-clause x)]
|
||||
[(or (after? x) (before? x)) (build-before-super-before/after-clause x)]
|
||||
[(an-item? x) (build-before-super-item-clause x)]
|
||||
[(generic? x) (build-before-super-generic-clause x)]))
|
||||
items))
|
||||
(super-instantiate ())
|
||||
,@(apply append (map (λ (x)
|
||||
(cond
|
||||
[(between? x) (build-after-super-between-clause x)]
|
||||
[(an-item? x) (build-after-super-item-clause x)]
|
||||
[(or (after? x) (before? x)) (build-after-super-before/after-clause x)]
|
||||
[(generic? x) (build-after-super-generic-clause x)]))
|
||||
items))
|
||||
(reorder-menus this)))
|
||||
port))
|
||||
#: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<%>)]{
|
||||
|
||||
|
||||
--
|
||||
)
|
||||
(provide generate-standard-menus-docs)
|
||||
(define-syntax (generate-standard-menus-docs stx)
|
||||
(define docs
|
||||
`(definterface frame:standard-menus<%> (frame:basic<%>)
|
||||
,@(append-map generate-item-docs items)))
|
||||
;; HACK: the rendering includes location information from the source, so
|
||||
;; generating a location-less syntax doesn't work. Instead, use the pretty
|
||||
;; printer to display the whole thing, then read the output as a syntax with
|
||||
;; location. Note that the 80 width is a guess that works, since indentation
|
||||
;; includes the documentation forms too (starting from the toplevel
|
||||
;; `definterface' and on.)
|
||||
(define o (open-output-string))
|
||||
(parameterize ([pretty-print-columns 80] [current-output-port o])
|
||||
(pretty-write docs))
|
||||
(parameterize ([port-count-lines-enabled #t])
|
||||
(replace-context
|
||||
stx
|
||||
(read-syntax 'gen-standard-menus
|
||||
(open-input-string (get-output-string o))))))
|
||||
|
|
|
@ -1,29 +1,28 @@
|
|||
#reader scribble/reader
|
||||
#lang scheme/base
|
||||
#lang at-exp racket/base
|
||||
|
||||
(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-checkable-item)
|
||||
(struct-out a-submenu-item)
|
||||
|
||||
(struct-out a-submenu-item)
|
||||
|
||||
;; an-item -> symbol
|
||||
;; calcualates the names of various identifiers associated with the item.
|
||||
an-item->callback-name
|
||||
|
@ -33,10 +32,10 @@
|
|||
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))
|
||||
|
@ -138,17 +137,17 @@
|
|||
'@defmethod[(on-close) void?]{
|
||||
Removes the preferences callbacks for the menu items
|
||||
}))
|
||||
(make-generic-method
|
||||
(make-generic-method
|
||||
'get-menu% '(λ () menu:can-restore-underscore-menu%)
|
||||
(list
|
||||
'@defmethod[(get-menu%)
|
||||
'@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
|
||||
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%)]{
|
||||
|
@ -164,16 +163,16 @@
|
|||
checkable menu items in this class.
|
||||
|
||||
returns @racket[menu:can-restore-checkable-menu-item] by default.}))
|
||||
|
||||
(make-generic-method
|
||||
|
||||
(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
|
||||
|
||||
(make-generic-private-field
|
||||
'file-menu
|
||||
'(make-object (get-menu%)
|
||||
(string-constant file-menu-label)
|
||||
|
@ -185,7 +184,7 @@
|
|||
'@defmethod[(get-edit-menu) (is-a?/c menu%)]{
|
||||
Returns the edit menu.
|
||||
See also @method[frame:standard-menus<%> get-menu%].}))
|
||||
(make-generic-private-field
|
||||
(make-generic-private-field
|
||||
'edit-menu
|
||||
'(make-object (get-menu%) (string-constant edit-menu-label) (get-menu-bar)))
|
||||
(make-generic-method
|
||||
|
@ -198,8 +197,8 @@
|
|||
(make-generic-private-field
|
||||
'help-menu
|
||||
'(make-object (get-menu%) (string-constant help-menu-label) (get-menu-bar)))
|
||||
|
||||
(make-an-item 'file-menu 'new
|
||||
|
||||
(make-an-item 'file-menu 'new
|
||||
'(string-constant new-info)
|
||||
'(λ (item control) (handler:edit-file #f) #t)
|
||||
#\n
|
||||
|
@ -215,7 +214,7 @@
|
|||
'(string-constant open-menu-item)
|
||||
on-demand-do-nothing
|
||||
#t)
|
||||
(make-a-submenu-item 'file-menu 'open-recent
|
||||
(make-a-submenu-item 'file-menu 'open-recent
|
||||
'(string-constant open-recent-info)
|
||||
'(λ (x y) (void))
|
||||
#f
|
||||
|
@ -225,7 +224,7 @@
|
|||
(handler:install-recent-items menu))
|
||||
#t)
|
||||
(make-between 'file-menu 'open 'revert 'nothing)
|
||||
(make-an-item 'file-menu 'revert
|
||||
(make-an-item 'file-menu 'revert
|
||||
'(string-constant revert-info)
|
||||
'(λ (item control) (void))
|
||||
#f
|
||||
|
@ -273,19 +272,19 @@
|
|||
(make-between 'file-menu 'close 'quit 'nothing)
|
||||
(make-an-item 'file-menu 'quit
|
||||
'(string-constant quit-info)
|
||||
'(λ (item control)
|
||||
'(λ (item control)
|
||||
(when (exit:user-oks-exit)
|
||||
(exit:exit)))
|
||||
#\q
|
||||
'(get-default-shortcut-prefix)
|
||||
'(if (eq? (system-type) 'windows)
|
||||
'(if (eq? (system-type) 'windows)
|
||||
(string-constant quit-menu-item-windows)
|
||||
(string-constant quit-menu-item-others))
|
||||
on-demand-do-nothing
|
||||
'(not (eq? (system-type) 'macosx)))
|
||||
(make-after 'file-menu 'quit 'nothing)
|
||||
|
||||
(make-an-item 'edit-menu 'undo
|
||||
|
||||
(make-an-item 'edit-menu 'undo
|
||||
'(string-constant undo-info)
|
||||
(edit-menu:do 'undo)
|
||||
#\z
|
||||
|
@ -293,7 +292,7 @@
|
|||
'(string-constant undo-menu-item)
|
||||
(edit-menu:can-do-on-demand 'undo)
|
||||
#t)
|
||||
(make-an-item 'edit-menu 'redo
|
||||
(make-an-item 'edit-menu 'redo
|
||||
'(string-constant redo-info)
|
||||
(edit-menu:do 'redo)
|
||||
'(if (eq? (system-type) 'windows)
|
||||
|
@ -314,7 +313,7 @@
|
|||
(edit-menu:can-do-on-demand 'cut)
|
||||
#t)
|
||||
(make-between 'edit-menu 'cut 'copy 'nothing)
|
||||
(make-an-item 'edit-menu 'copy
|
||||
(make-an-item 'edit-menu 'copy
|
||||
'(string-constant copy-info)
|
||||
(edit-menu:do 'copy)
|
||||
#\c
|
||||
|
@ -323,7 +322,7 @@
|
|||
(edit-menu:can-do-on-demand 'copy)
|
||||
#t)
|
||||
(make-between 'edit-menu 'copy 'paste 'nothing)
|
||||
(make-an-item 'edit-menu 'paste
|
||||
(make-an-item 'edit-menu 'paste
|
||||
'(string-constant paste-info)
|
||||
(edit-menu:do 'paste)
|
||||
#\v
|
||||
|
@ -332,7 +331,7 @@
|
|||
(edit-menu:can-do-on-demand 'paste)
|
||||
#t)
|
||||
(make-between 'edit-menu 'paste 'clear 'nothing)
|
||||
(make-an-item 'edit-menu 'clear
|
||||
(make-an-item 'edit-menu 'clear
|
||||
'(string-constant clear-info)
|
||||
(edit-menu:do 'clear)
|
||||
#f
|
||||
|
@ -352,8 +351,8 @@
|
|||
(edit-menu:can-do-on-demand 'select-all)
|
||||
#t)
|
||||
(make-between 'edit-menu 'select-all 'find 'separator)
|
||||
|
||||
(make-an-item 'edit-menu 'find
|
||||
|
||||
(make-an-item 'edit-menu 'find
|
||||
'(string-constant find-info)
|
||||
'(λ (item control) (void))
|
||||
#\f
|
||||
|
@ -361,7 +360,7 @@
|
|||
'(string-constant find-menu-item)
|
||||
edit-menu:edit-target-on-demand
|
||||
#f)
|
||||
|
||||
|
||||
(make-an-item 'edit-menu 'find-next
|
||||
'(string-constant find-next-info)
|
||||
'(λ (item control) (void))
|
||||
|
@ -394,7 +393,7 @@
|
|||
'(string-constant replace-menu-item)
|
||||
on-demand-do-nothing
|
||||
#f)
|
||||
(make-an-item 'edit-menu 'replace-all
|
||||
(make-an-item 'edit-menu 'replace-all
|
||||
'(string-constant replace-all-info)
|
||||
'(λ (item control) (void))
|
||||
#f
|
||||
|
@ -411,9 +410,9 @@
|
|||
'(string-constant find-case-sensitive-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
|
||||
(make-an-item 'edit-menu 'preferences
|
||||
'(string-constant preferences-info)
|
||||
'(λ (item control) (preferences:show-dialog) #t)
|
||||
'(case (system-type)
|
||||
|
@ -424,9 +423,9 @@
|
|||
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
|
||||
(make-an-item 'help-menu 'about
|
||||
'(string-constant about-info)
|
||||
'(λ (item control) (void))
|
||||
#f
|
||||
|
|
|
@ -1,989 +0,0 @@
|
|||
(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-next-callback
|
||||
edit-menu:get-find-next-item
|
||||
edit-menu:find-next-string
|
||||
edit-menu:find-next-help-string
|
||||
edit-menu:find-next-on-demand
|
||||
edit-menu:create-find-next?
|
||||
edit-menu:find-previous-callback
|
||||
edit-menu:get-find-previous-item
|
||||
edit-menu:find-previous-string
|
||||
edit-menu:find-previous-help-string
|
||||
edit-menu:find-previous-on-demand
|
||||
edit-menu:create-find-previous?
|
||||
edit-menu:show/hide-replace-callback
|
||||
edit-menu:get-show/hide-replace-item
|
||||
edit-menu:show/hide-replace-string
|
||||
edit-menu:show/hide-replace-help-string
|
||||
edit-menu:show/hide-replace-on-demand
|
||||
edit-menu:create-show/hide-replace?
|
||||
edit-menu:replace-callback
|
||||
edit-menu:get-replace-item
|
||||
edit-menu:replace-string
|
||||
edit-menu:replace-help-string
|
||||
edit-menu:replace-on-demand
|
||||
edit-menu:create-replace?
|
||||
edit-menu:replace-all-callback
|
||||
edit-menu:get-replace-all-item
|
||||
edit-menu:replace-all-string
|
||||
edit-menu:replace-all-help-string
|
||||
edit-menu:replace-all-on-demand
|
||||
edit-menu:create-replace-all?
|
||||
edit-menu:find-case-sensitive-callback
|
||||
edit-menu:get-find-case-sensitive-item
|
||||
edit-menu:find-case-sensitive-string
|
||||
edit-menu:find-case-sensitive-help-string
|
||||
edit-menu:find-case-sensitive-on-demand
|
||||
edit-menu:create-find-case-sensitive?
|
||||
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
|
||||
(basic<%>)
|
||||
(standard-menus<%>)
|
||||
(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)))))))
|
||||
(inherit get-menu-bar show can-close? get-edit-target-object)
|
||||
(define/augment
|
||||
on-close
|
||||
(λ () (remove-prefs-callback) (inner (void) on-close)))
|
||||
(define/public get-menu% (λ () menu:can-restore-underscore-menu%))
|
||||
(define/public get-menu-item% (λ () menu:can-restore-menu-item%))
|
||||
(define/public
|
||||
get-checkable-menu-item%
|
||||
(λ () menu:can-restore-checkable-menu-item%))
|
||||
(define/public get-file-menu (λ () file-menu))
|
||||
(define/public get-edit-menu (λ () edit-menu))
|
||||
(define/public get-help-menu (λ () help-menu))
|
||||
(define/public
|
||||
file-menu:new-callback
|
||||
(λ (item control) (handler:edit-file #f) #t))
|
||||
(define/public (file-menu:get-new-item) file-menu:new-item)
|
||||
(define/public (file-menu:new-string) (string-constant new-menu-item))
|
||||
(define/public (file-menu:new-help-string) (string-constant new-info))
|
||||
(define/public file-menu:new-on-demand (λ (menu-item) (void)))
|
||||
(define/public (file-menu:create-new?) #t)
|
||||
(define/public file-menu:between-new-and-open (λ (menu) (void)))
|
||||
(define/public
|
||||
file-menu:open-callback
|
||||
(λ (item control) (handler:open-file) #t))
|
||||
(define/public (file-menu: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))
|
||||
(define/public file-menu:open-on-demand (λ (menu-item) (void)))
|
||||
(define/public (file-menu:create-open?) #t)
|
||||
(define/public file-menu:open-recent-callback (λ (x y) (void)))
|
||||
(define/public (file-menu:get-open-recent-item) file-menu:open-recent-item)
|
||||
(define/public
|
||||
(file-menu:open-recent-string)
|
||||
(string-constant open-recent-menu-item))
|
||||
(define/public
|
||||
(file-menu:open-recent-help-string)
|
||||
(string-constant open-recent-info))
|
||||
(define/public
|
||||
file-menu:open-recent-on-demand
|
||||
(λ (menu) (handler:install-recent-items menu)))
|
||||
(define/public (file-menu:create-open-recent?) #t)
|
||||
(define/public file-menu:between-open-and-revert (λ (menu) (void)))
|
||||
(define/public file-menu:revert-callback (λ (item control) (void)))
|
||||
(define/public (file-menu:get-revert-item) file-menu:revert-item)
|
||||
(define/public (file-menu:revert-string) (string-constant revert-menu-item))
|
||||
(define/public (file-menu:revert-help-string) (string-constant revert-info))
|
||||
(define/public file-menu:revert-on-demand (λ (menu-item) (void)))
|
||||
(define/public (file-menu:create-revert?) #f)
|
||||
(define/public file-menu:between-revert-and-save (λ (menu) (void)))
|
||||
(define/public file-menu:save-callback (λ (item control) (void)))
|
||||
(define/public (file-menu:get-save-item) file-menu:save-item)
|
||||
(define/public (file-menu:save-string) (string-constant save-menu-item))
|
||||
(define/public (file-menu:save-help-string) (string-constant save-info))
|
||||
(define/public file-menu:save-on-demand (λ (menu-item) (void)))
|
||||
(define/public (file-menu:create-save?) #f)
|
||||
(define/public file-menu:save-as-callback (λ (item control) (void)))
|
||||
(define/public (file-menu:get-save-as-item) file-menu:save-as-item)
|
||||
(define/public
|
||||
(file-menu:save-as-string)
|
||||
(string-constant save-as-menu-item))
|
||||
(define/public
|
||||
(file-menu:save-as-help-string)
|
||||
(string-constant save-as-info))
|
||||
(define/public file-menu:save-as-on-demand (λ (menu-item) (void)))
|
||||
(define/public (file-menu:create-save-as?) #f)
|
||||
(define/public file-menu:between-save-as-and-print (λ (menu) (void)))
|
||||
(define/public file-menu:print-callback (λ (item control) (void)))
|
||||
(define/public (file-menu:get-print-item) file-menu:print-item)
|
||||
(define/public (file-menu:print-string) (string-constant print-menu-item))
|
||||
(define/public (file-menu:print-help-string) (string-constant print-info))
|
||||
(define/public file-menu:print-on-demand (λ (menu-item) (void)))
|
||||
(define/public (file-menu:create-print?) #f)
|
||||
(define/public
|
||||
file-menu:between-print-and-close
|
||||
(λ (menu) (make-object separator-menu-item% menu)))
|
||||
(define/public
|
||||
file-menu:close-callback
|
||||
(λ (item control) (when (can-close?) (on-close) (show #f)) #t))
|
||||
(define/public (file-menu:get-close-item) file-menu:close-item)
|
||||
(define/public
|
||||
(file-menu:close-string)
|
||||
(if (eq? (system-type) 'unix)
|
||||
(string-constant close-menu-item)
|
||||
(string-constant close-window-menu-item)))
|
||||
(define/public (file-menu:close-help-string) (string-constant close-info))
|
||||
(define/public file-menu:close-on-demand (λ (menu-item) (void)))
|
||||
(define/public (file-menu:create-close?) #t)
|
||||
(define/public file-menu:between-close-and-quit (λ (menu) (void)))
|
||||
(define/public
|
||||
file-menu:quit-callback
|
||||
(λ (item control) (when (exit:user-oks-exit) (exit:exit))))
|
||||
(define/public (file-menu: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)))
|
||||
(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 (eq? (system-type) 'macosx)))
|
||||
(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))
|
||||
(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?))))
|
||||
(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))
|
||||
(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?))))
|
||||
(define/public (edit-menu:create-redo?) #t)
|
||||
(define/public
|
||||
edit-menu:between-redo-and-cut
|
||||
(λ (menu) (make-object separator-menu-item% menu)))
|
||||
(define/public
|
||||
edit-menu: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?))))
|
||||
(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))
|
||||
(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?))))
|
||||
(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))
|
||||
(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?))))
|
||||
(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))
|
||||
(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)))
|
||||
(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?))))
|
||||
(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))
|
||||
(define/public (edit-menu:get-select-all-item) edit-menu:select-all-item)
|
||||
(define/public
|
||||
(edit-menu:select-all-string)
|
||||
(string-constant select-all-menu-item))
|
||||
(define/public
|
||||
(edit-menu:select-all-help-string)
|
||||
(string-constant select-all-info))
|
||||
(define/public
|
||||
edit-menu:select-all-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)))
|
||||
(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<%>))))))
|
||||
(define/public (edit-menu:create-find?) #f)
|
||||
(define/public edit-menu:find-next-callback (λ (item control) (void)))
|
||||
(define/public (edit-menu:get-find-next-item) edit-menu:find-next-item)
|
||||
(define/public
|
||||
(edit-menu:find-next-string)
|
||||
(string-constant find-next-menu-item))
|
||||
(define/public
|
||||
(edit-menu:find-next-help-string)
|
||||
(string-constant find-next-info))
|
||||
(define/public
|
||||
edit-menu:find-next-on-demand
|
||||
(λ (item)
|
||||
(send item enable
|
||||
(let
|
||||
((target (get-edit-target-object)))
|
||||
(and target (is-a? target editor<%>))))))
|
||||
(define/public (edit-menu:create-find-next?) #f)
|
||||
(define/public edit-menu:find-previous-callback (λ (item control) (void)))
|
||||
(define/public
|
||||
(edit-menu:get-find-previous-item)
|
||||
edit-menu:find-previous-item)
|
||||
(define/public
|
||||
(edit-menu:find-previous-string)
|
||||
(string-constant find-previous-menu-item))
|
||||
(define/public
|
||||
(edit-menu:find-previous-help-string)
|
||||
(string-constant find-previous-info))
|
||||
(define/public
|
||||
edit-menu:find-previous-on-demand
|
||||
(λ (item)
|
||||
(send item enable
|
||||
(let
|
||||
((target (get-edit-target-object)))
|
||||
(and target (is-a? target editor<%>))))))
|
||||
(define/public (edit-menu:create-find-previous?) #f)
|
||||
(define/public
|
||||
edit-menu:show/hide-replace-callback
|
||||
(λ (item control) (void)))
|
||||
(define/public
|
||||
(edit-menu:get-show/hide-replace-item)
|
||||
edit-menu:show/hide-replace-item)
|
||||
(define/public
|
||||
(edit-menu:show/hide-replace-string)
|
||||
(string-constant show-replace-menu-item))
|
||||
(define/public
|
||||
(edit-menu:show/hide-replace-help-string)
|
||||
(string-constant show/hide-replace-info))
|
||||
(define/public edit-menu:show/hide-replace-on-demand (λ (menu-item) (void)))
|
||||
(define/public (edit-menu:create-show/hide-replace?) #f)
|
||||
(define/public edit-menu:replace-callback (λ (item control) (void)))
|
||||
(define/public (edit-menu:get-replace-item) edit-menu:replace-item)
|
||||
(define/public
|
||||
(edit-menu:replace-string)
|
||||
(string-constant replace-menu-item))
|
||||
(define/public
|
||||
(edit-menu:replace-help-string)
|
||||
(string-constant replace-info))
|
||||
(define/public edit-menu:replace-on-demand (λ (menu-item) (void)))
|
||||
(define/public (edit-menu:create-replace?) #f)
|
||||
(define/public edit-menu:replace-all-callback (λ (item control) (void)))
|
||||
(define/public (edit-menu:get-replace-all-item) edit-menu:replace-all-item)
|
||||
(define/public
|
||||
(edit-menu:replace-all-string)
|
||||
(string-constant replace-all-menu-item))
|
||||
(define/public
|
||||
(edit-menu:replace-all-help-string)
|
||||
(string-constant replace-all-info))
|
||||
(define/public edit-menu:replace-all-on-demand (λ (menu-item) (void)))
|
||||
(define/public (edit-menu:create-replace-all?) #f)
|
||||
(define/public
|
||||
edit-menu:find-case-sensitive-callback
|
||||
(λ (item control) (void)))
|
||||
(define/public
|
||||
(edit-menu:get-find-case-sensitive-item)
|
||||
edit-menu:find-case-sensitive-item)
|
||||
(define/public
|
||||
(edit-menu:find-case-sensitive-string)
|
||||
(string-constant find-case-sensitive-menu-item))
|
||||
(define/public
|
||||
(edit-menu:find-case-sensitive-help-string)
|
||||
(string-constant find-case-sensitive-info))
|
||||
(define/public
|
||||
edit-menu:find-case-sensitive-on-demand
|
||||
(λ (item)
|
||||
(send item enable
|
||||
(let
|
||||
((target (get-edit-target-object)))
|
||||
(and target (is-a? target editor<%>))))))
|
||||
(define/public (edit-menu:create-find-case-sensitive?) #f)
|
||||
(define/public
|
||||
edit-menu:between-find-and-preferences
|
||||
(λ (menu)
|
||||
(unless (current-eventspace-has-standard-menus?)
|
||||
(make-object separator-menu-item% menu))))
|
||||
(define/public
|
||||
edit-menu:preferences-callback
|
||||
(λ (item control) (preferences:show-dialog) #t))
|
||||
(define/public (edit-menu:get-preferences-item) edit-menu:preferences-item)
|
||||
(define/public
|
||||
(edit-menu:preferences-string)
|
||||
(string-constant preferences-menu-item))
|
||||
(define/public
|
||||
(edit-menu:preferences-help-string)
|
||||
(string-constant preferences-info))
|
||||
(define/public edit-menu:preferences-on-demand (λ (menu-item) (void)))
|
||||
(define/public
|
||||
(edit-menu:create-preferences?)
|
||||
(not (current-eventspace-has-standard-menus?)))
|
||||
(define/public edit-menu:after-preferences (λ (menu) (void)))
|
||||
(define/public help-menu:before-about (λ (menu) (void)))
|
||||
(define/public help-menu:about-callback (λ (item control) (void)))
|
||||
(define/public (help-menu:get-about-item) help-menu:about-item)
|
||||
(define/public (help-menu:about-string) (string-constant about-menu-item))
|
||||
(define/public (help-menu:about-help-string) (string-constant about-info))
|
||||
(define/public help-menu:about-on-demand (λ (menu-item) (void)))
|
||||
(define/public (help-menu:create-about?) #f)
|
||||
(define/public help-menu:after-about (λ (menu) (void)))
|
||||
(super-instantiate ())
|
||||
(define file-menu
|
||||
(make-object (get-menu%)
|
||||
(string-constant file-menu-label)
|
||||
(get-menu-bar)))
|
||||
(define edit-menu
|
||||
(make-object (get-menu%)
|
||||
(string-constant edit-menu-label)
|
||||
(get-menu-bar)))
|
||||
(define help-menu
|
||||
(make-object (get-menu%)
|
||||
(string-constant help-menu-label)
|
||||
(get-menu-bar)))
|
||||
(define file-menu:new-item
|
||||
(and (file-menu:create-new?)
|
||||
(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?)
|
||||
(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?)
|
||||
(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?)
|
||||
(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?)
|
||||
(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?)
|
||||
(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 #\s)
|
||||
(shortcut-prefix (cons 'shift (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?)
|
||||
(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?)
|
||||
(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?)
|
||||
(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?)
|
||||
(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?)
|
||||
(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) 'windows) #\y #\z))
|
||||
(shortcut-prefix
|
||||
(if (eq? (system-type) 'windows)
|
||||
(get-default-shortcut-prefix)
|
||||
(cons 'shift (get-default-shortcut-prefix))))
|
||||
(help-string (edit-menu:redo-help-string))
|
||||
(demand-callback
|
||||
(λ (menu-item) (edit-menu:redo-on-demand menu-item))))))
|
||||
(edit-menu:between-redo-and-cut (get-edit-menu))
|
||||
(define edit-menu:cut-item
|
||||
(and (edit-menu:create-cut?)
|
||||
(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?)
|
||||
(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?)
|
||||
(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?)
|
||||
(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?)
|
||||
(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?)
|
||||
(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-next-item
|
||||
(and (edit-menu:create-find-next?)
|
||||
(new
|
||||
(get-menu-item%)
|
||||
(label (edit-menu:find-next-string))
|
||||
(parent edit-menu)
|
||||
(callback
|
||||
(let ((edit-menu:find-next-callback
|
||||
(λ (item evt) (edit-menu:find-next-callback item evt))))
|
||||
edit-menu:find-next-callback))
|
||||
(shortcut #\g)
|
||||
(shortcut-prefix (get-default-shortcut-prefix))
|
||||
(help-string (edit-menu:find-next-help-string))
|
||||
(demand-callback
|
||||
(λ (menu-item) (edit-menu:find-next-on-demand menu-item))))))
|
||||
(define edit-menu:find-previous-item
|
||||
(and (edit-menu:create-find-previous?)
|
||||
(new
|
||||
(get-menu-item%)
|
||||
(label (edit-menu:find-previous-string))
|
||||
(parent edit-menu)
|
||||
(callback
|
||||
(let ((edit-menu:find-previous-callback
|
||||
(λ (item evt) (edit-menu:find-previous-callback item evt))))
|
||||
edit-menu:find-previous-callback))
|
||||
(shortcut #\g)
|
||||
(shortcut-prefix (cons 'shift (get-default-shortcut-prefix)))
|
||||
(help-string (edit-menu:find-previous-help-string))
|
||||
(demand-callback
|
||||
(λ (menu-item) (edit-menu:find-previous-on-demand menu-item))))))
|
||||
(define edit-menu:show/hide-replace-item
|
||||
(and (edit-menu:create-show/hide-replace?)
|
||||
(new
|
||||
(get-menu-item%)
|
||||
(label (edit-menu:show/hide-replace-string))
|
||||
(parent edit-menu)
|
||||
(callback
|
||||
(let ((edit-menu:show/hide-replace-callback
|
||||
(λ (item evt)
|
||||
(edit-menu:show/hide-replace-callback item evt))))
|
||||
edit-menu:show/hide-replace-callback))
|
||||
(shortcut #\r)
|
||||
(shortcut-prefix (cons 'shift (get-default-shortcut-prefix)))
|
||||
(help-string (edit-menu:show/hide-replace-help-string))
|
||||
(demand-callback
|
||||
(λ (menu-item)
|
||||
(edit-menu:show/hide-replace-on-demand menu-item))))))
|
||||
(define edit-menu:replace-item
|
||||
(and (edit-menu:create-replace?)
|
||||
(new
|
||||
(get-menu-item%)
|
||||
(label (edit-menu:replace-string))
|
||||
(parent edit-menu)
|
||||
(callback
|
||||
(let ((edit-menu:replace-callback
|
||||
(λ (item evt) (edit-menu:replace-callback item evt))))
|
||||
edit-menu:replace-callback))
|
||||
(shortcut #\f)
|
||||
(shortcut-prefix (cons 'shift (get-default-shortcut-prefix)))
|
||||
(help-string (edit-menu:replace-help-string))
|
||||
(demand-callback
|
||||
(λ (menu-item) (edit-menu:replace-on-demand menu-item))))))
|
||||
(define edit-menu:replace-all-item
|
||||
(and (edit-menu:create-replace-all?)
|
||||
(new
|
||||
(get-menu-item%)
|
||||
(label (edit-menu:replace-all-string))
|
||||
(parent edit-menu)
|
||||
(callback
|
||||
(let ((edit-menu:replace-all-callback
|
||||
(λ (item evt) (edit-menu:replace-all-callback item evt))))
|
||||
edit-menu:replace-all-callback))
|
||||
(shortcut #f)
|
||||
(shortcut-prefix (get-default-shortcut-prefix))
|
||||
(help-string (edit-menu:replace-all-help-string))
|
||||
(demand-callback
|
||||
(λ (menu-item) (edit-menu:replace-all-on-demand menu-item))))))
|
||||
(define edit-menu:find-case-sensitive-item
|
||||
(and (edit-menu:create-find-case-sensitive?)
|
||||
(new
|
||||
(get-checkable-menu-item%)
|
||||
(label (edit-menu:find-case-sensitive-string))
|
||||
(parent edit-menu)
|
||||
(callback
|
||||
(let ((edit-menu:find-case-sensitive-callback
|
||||
(λ (item evt)
|
||||
(edit-menu:find-case-sensitive-callback item evt))))
|
||||
edit-menu:find-case-sensitive-callback))
|
||||
(shortcut #f)
|
||||
(shortcut-prefix (get-default-shortcut-prefix))
|
||||
(help-string (edit-menu:find-case-sensitive-help-string))
|
||||
(demand-callback
|
||||
(λ (menu-item)
|
||||
(edit-menu:find-case-sensitive-on-demand menu-item))))))
|
||||
(edit-menu:between-find-and-preferences (get-edit-menu))
|
||||
(define edit-menu:preferences-item
|
||||
(and (edit-menu:create-preferences?)
|
||||
(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?)
|
||||
(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)))
|
|
@ -1,8 +1,7 @@
|
|||
#lang scribble/doc
|
||||
@(require scribble/manual scribble/extract scheme/include)
|
||||
@(require (for-label framework))
|
||||
@(require (for-label scheme/gui))
|
||||
@(require (for-syntax (prefix-in s: scribble/reader)))
|
||||
@(require scribble/manual scribble/extract
|
||||
(for-label framework scheme/gui)
|
||||
framework/private/gen-standard-menus)
|
||||
|
||||
@title{Frame}
|
||||
|
||||
|
@ -445,7 +444,7 @@
|
|||
|
||||
}
|
||||
|
||||
@(include/reader "standard-menus.scrbl" s:read-syntax)
|
||||
@(generate-standard-menus-docs)
|
||||
|
||||
@defmixin[frame:standard-menus-mixin (frame:basic<%>) (frame:standard-menus<%>)]{
|
||||
The result of this mixin implements @racket[frame:standard-menus<%>].
|
||||
|
|
|
@ -1,353 +0,0 @@
|
|||
;; 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" "Returns " (racket menu:can-restore-menu-item) " by default.")
|
||||
|
||||
@(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" "returns " (racket menu:can-restore-checkable-menu-item) " by default.")
|
||||
|
||||
@(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 " (racket 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 " (racket #t) ".")
|
||||
|
||||
@(defmethod (file-menu:new-callback (item (is-a?/c menu-item%)) (control (is-a?/c control-event%))) void? "Defaults to " (racketblock (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 " (racketblock (void)))
|
||||
|
||||
@(defmethod (file-menu:new-string) string? "The result of this method is used as the name of the " (racket menu-item%) "." "\n" "\n" "Defaults to " (racket (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 " (racket menu-item%) " object is created." "\n" "\n" "Defaults to " (racket (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 " (racket 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 " (racket #t) ".")
|
||||
|
||||
@(defmethod (file-menu:open-callback (item (is-a?/c menu-item%)) (control (is-a?/c control-event%))) void? "Defaults to " (racketblock (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 " (racketblock (void)))
|
||||
|
||||
@(defmethod (file-menu:open-string) string? "The result of this method is used as the name of the " (racket menu-item%) "." "\n" "\n" "Defaults to " (racket (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 " (racket menu-item%) " object is created." "\n" "\n" "Defaults to " (racket (string-constant open-info)) ".")
|
||||
|
||||
@(defmethod (file-menu:get-open-recent-item) (or/c false/c (is-a?/c menu-item%)) "This method returns the " (racket 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 " (racket #t) ".")
|
||||
|
||||
@(defmethod (file-menu:open-recent-callback (x (is-a?/c menu-item%)) (y (is-a?/c control-event%))) void? "Defaults to " (racketblock (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 " (racketblock (handler:install-recent-items menu)))
|
||||
|
||||
@(defmethod (file-menu:open-recent-string) string? "The result of this method is used as the name of the " (racket menu-item%) "." "\n" "\n" "Defaults to " (racket (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 " (racket menu-item%) " object is created." "\n" "\n" "Defaults to " (racket (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 " (racket 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 " (racket #f) ".")
|
||||
|
||||
@(defmethod (file-menu:revert-callback (item (is-a?/c menu-item%)) (control (is-a?/c control-event%))) void? "Defaults to " (racketblock (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 " (racketblock (void)))
|
||||
|
||||
@(defmethod (file-menu:revert-string) string? "The result of this method is used as the name of the " (racket menu-item%) "." "\n" "\n" "Defaults to " (racket (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 " (racket menu-item%) " object is created." "\n" "\n" "Defaults to " (racket (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 " (racket 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 " (racket #f) ".")
|
||||
|
||||
@(defmethod (file-menu:save-callback (item (is-a?/c menu-item%)) (control (is-a?/c control-event%))) void? "Defaults to " (racketblock (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 " (racketblock (void)))
|
||||
|
||||
@(defmethod (file-menu:save-string) string? "The result of this method is used as the name of the " (racket menu-item%) "." "\n" "\n" "Defaults to " (racket (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 " (racket menu-item%) " object is created." "\n" "\n" "Defaults to " (racket (string-constant save-info)) ".")
|
||||
|
||||
@(defmethod (file-menu:get-save-as-item) (or/c false/c (is-a?/c menu-item%)) "This method returns the " (racket 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 " (racket #f) ".")
|
||||
|
||||
@(defmethod (file-menu:save-as-callback (item (is-a?/c menu-item%)) (control (is-a?/c control-event%))) void? "Defaults to " (racketblock (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 " (racketblock (void)))
|
||||
|
||||
@(defmethod (file-menu:save-as-string) string? "The result of this method is used as the name of the " (racket menu-item%) "." "\n" "\n" "Defaults to " (racket (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 " (racket menu-item%) " object is created." "\n" "\n" "Defaults to " (racket (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 " (racket 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 " (racket #f) ".")
|
||||
|
||||
@(defmethod (file-menu:print-callback (item (is-a?/c menu-item%)) (control (is-a?/c control-event%))) void? "Defaults to " (racketblock (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 " (racketblock (void)))
|
||||
|
||||
@(defmethod (file-menu:print-string) string? "The result of this method is used as the name of the " (racket menu-item%) "." "\n" "\n" "Defaults to " (racket (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 " (racket menu-item%) " object is created." "\n" "\n" "Defaults to " (racket (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 " (racket 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 " (racket #t) ".")
|
||||
|
||||
@(defmethod (file-menu:close-callback (item (is-a?/c menu-item%)) (control (is-a?/c control-event%))) void? "Defaults to " (racketblock (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 " (racketblock (void)))
|
||||
|
||||
@(defmethod (file-menu:close-string) string? "The result of this method is used as the name of the " (racket menu-item%) "." "\n" "\n" "Defaults to " (racket (if (eq? (system-type) (quote unix)) (string-constant close-menu-item) (string-constant close-window-menu-item))) ".")
|
||||
|
||||
@(defmethod (file-menu:close-help-string) string? "The result of this method is used as the help string" "\n" "when the " (racket menu-item%) " object is created." "\n" "\n" "Defaults to " (racket (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 " (racket 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 " (racket (not (eq? (system-type) (quote macosx)))) ".")
|
||||
|
||||
@(defmethod (file-menu:quit-callback (item (is-a?/c menu-item%)) (control (is-a?/c control-event%))) void? "Defaults to " (racketblock (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 " (racketblock (void)))
|
||||
|
||||
@(defmethod (file-menu:quit-string) string? "The result of this method is used as the name of the " (racket menu-item%) "." "\n" "\n" "Defaults to " (racket (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 " (racket menu-item%) " object is created." "\n" "\n" "Defaults to " (racket (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 " (racket 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 " (racket #t) ".")
|
||||
|
||||
@(defmethod (edit-menu:undo-callback (menu (is-a?/c menu-item%)) (evt (is-a?/c control-event%))) void? "Defaults to " (racketblock (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 " (racketblock (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 " (racket menu-item%) "." "\n" "\n" "Defaults to " (racket (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 " (racket menu-item%) " object is created." "\n" "\n" "Defaults to " (racket (string-constant undo-info)) ".")
|
||||
|
||||
@(defmethod (edit-menu:get-redo-item) (or/c false/c (is-a?/c menu-item%)) "This method returns the " (racket 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 " (racket #t) ".")
|
||||
|
||||
@(defmethod (edit-menu:redo-callback (menu (is-a?/c menu-item%)) (evt (is-a?/c control-event%))) void? "Defaults to " (racketblock (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 " (racketblock (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 " (racket menu-item%) "." "\n" "\n" "Defaults to " (racket (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 " (racket menu-item%) " object is created." "\n" "\n" "Defaults to " (racket (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 " (racket 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 " (racket #t) ".")
|
||||
|
||||
@(defmethod (edit-menu:cut-callback (menu (is-a?/c menu-item%)) (evt (is-a?/c control-event%))) void? "Defaults to " (racketblock (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 " (racketblock (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 " (racket menu-item%) "." "\n" "\n" "Defaults to " (racket (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 " (racket menu-item%) " object is created." "\n" "\n" "Defaults to " (racket (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 " (racket 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 " (racket #t) ".")
|
||||
|
||||
@(defmethod (edit-menu:copy-callback (menu (is-a?/c menu-item%)) (evt (is-a?/c control-event%))) void? "Defaults to " (racketblock (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 " (racketblock (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 " (racket menu-item%) "." "\n" "\n" "Defaults to " (racket (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 " (racket menu-item%) " object is created." "\n" "\n" "Defaults to " (racket (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 " (racket 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 " (racket #t) ".")
|
||||
|
||||
@(defmethod (edit-menu:paste-callback (menu (is-a?/c menu-item%)) (evt (is-a?/c control-event%))) void? "Defaults to " (racketblock (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 " (racketblock (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 " (racket menu-item%) "." "\n" "\n" "Defaults to " (racket (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 " (racket menu-item%) " object is created." "\n" "\n" "Defaults to " (racket (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 " (racket 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 " (racket #t) ".")
|
||||
|
||||
@(defmethod (edit-menu:clear-callback (menu (is-a?/c menu-item%)) (evt (is-a?/c control-event%))) void? "Defaults to " (racketblock (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 " (racketblock (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 " (racket menu-item%) "." "\n" "\n" "Defaults to " (racket (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 " (racket menu-item%) " object is created." "\n" "\n" "Defaults to " (racket (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 " (racket 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 " (racket #t) ".")
|
||||
|
||||
@(defmethod (edit-menu:select-all-callback (menu (is-a?/c menu-item%)) (evt (is-a?/c control-event%))) void? "Defaults to " (racketblock (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 " (racketblock (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 " (racket menu-item%) "." "\n" "\n" "Defaults to " (racket (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 " (racket menu-item%) " object is created." "\n" "\n" "Defaults to " (racket (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 " (racket 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 " (racket #f) ".")
|
||||
|
||||
@(defmethod (edit-menu:find-callback (item (is-a?/c menu-item%)) (control (is-a?/c control-event%))) void? "Defaults to " (racketblock (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 " (racketblock (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 " (racket menu-item%) "." "\n" "\n" "Defaults to " (racket (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 " (racket menu-item%) " object is created." "\n" "\n" "Defaults to " (racket (string-constant find-info)) ".")
|
||||
|
||||
@(defmethod (edit-menu:get-find-next-item) (or/c false/c (is-a?/c menu-item%)) "This method returns the " (racket menu-item%) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-find-next?) ").")
|
||||
|
||||
@(defmethod (edit-menu:create-find-next?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (racket #f) ".")
|
||||
|
||||
@(defmethod (edit-menu:find-next-callback (item (is-a?/c menu-item%)) (control (is-a?/c control-event%))) void? "Defaults to " (racketblock (void)) " ")
|
||||
|
||||
@(defmethod (edit-menu:find-next-on-demand (item (is-a?/c menu-item%))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (racketblock (send item enable (let ((target (get-edit-target-object))) (and target (is-a? target editor<%>))))))
|
||||
|
||||
@(defmethod (edit-menu:find-next-string) string? "The result of this method is used as the name of the " (racket menu-item%) "." "\n" "\n" "Defaults to " (racket (string-constant find-next-menu-item)) ".")
|
||||
|
||||
@(defmethod (edit-menu:find-next-help-string) string? "The result of this method is used as the help string" "\n" "when the " (racket menu-item%) " object is created." "\n" "\n" "Defaults to " (racket (string-constant find-next-info)) ".")
|
||||
|
||||
@(defmethod (edit-menu:get-find-previous-item) (or/c false/c (is-a?/c menu-item%)) "This method returns the " (racket menu-item%) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-find-previous?) ").")
|
||||
|
||||
@(defmethod (edit-menu:create-find-previous?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (racket #f) ".")
|
||||
|
||||
@(defmethod (edit-menu:find-previous-callback (item (is-a?/c menu-item%)) (control (is-a?/c control-event%))) void? "Defaults to " (racketblock (void)) " ")
|
||||
|
||||
@(defmethod (edit-menu:find-previous-on-demand (item (is-a?/c menu-item%))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (racketblock (send item enable (let ((target (get-edit-target-object))) (and target (is-a? target editor<%>))))))
|
||||
|
||||
@(defmethod (edit-menu:find-previous-string) string? "The result of this method is used as the name of the " (racket menu-item%) "." "\n" "\n" "Defaults to " (racket (string-constant find-previous-menu-item)) ".")
|
||||
|
||||
@(defmethod (edit-menu:find-previous-help-string) string? "The result of this method is used as the help string" "\n" "when the " (racket menu-item%) " object is created." "\n" "\n" "Defaults to " (racket (string-constant find-previous-info)) ".")
|
||||
|
||||
@(defmethod (edit-menu:get-show/hide-replace-item) (or/c false/c (is-a?/c menu-item%)) "This method returns the " (racket menu-item%) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-show/hide-replace?) ").")
|
||||
|
||||
@(defmethod (edit-menu:create-show/hide-replace?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (racket #f) ".")
|
||||
|
||||
@(defmethod (edit-menu:show/hide-replace-callback (item (is-a?/c menu-item%)) (control (is-a?/c control-event%))) void? "Defaults to " (racketblock (void)) " ")
|
||||
|
||||
@(defmethod (edit-menu:show/hide-replace-on-demand (menu-item (is-a?/c menu-item%))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (racketblock (void)))
|
||||
|
||||
@(defmethod (edit-menu:show/hide-replace-string) string? "The result of this method is used as the name of the " (racket menu-item%) "." "\n" "\n" "Defaults to " (racket (string-constant show-replace-menu-item)) ".")
|
||||
|
||||
@(defmethod (edit-menu:show/hide-replace-help-string) string? "The result of this method is used as the help string" "\n" "when the " (racket menu-item%) " object is created." "\n" "\n" "Defaults to " (racket (string-constant show/hide-replace-info)) ".")
|
||||
|
||||
@(defmethod (edit-menu:get-replace-item) (or/c false/c (is-a?/c menu-item%)) "This method returns the " (racket menu-item%) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-replace?) ").")
|
||||
|
||||
@(defmethod (edit-menu:create-replace?) 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 " (racket #f) ".")
|
||||
|
||||
@(defmethod (edit-menu:replace-callback (item (is-a?/c menu-item%)) (control (is-a?/c control-event%))) void? "Defaults to " (racketblock (void)) " ")
|
||||
|
||||
@(defmethod (edit-menu:replace-on-demand (menu-item (is-a?/c menu-item%))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (racketblock (void)))
|
||||
|
||||
@(defmethod (edit-menu:replace-string) string? "The result of this method is used as the name of the " (racket menu-item%) "." "\n" "\n" "Defaults to " (racket (string-constant replace-menu-item)) ".")
|
||||
|
||||
@(defmethod (edit-menu:replace-help-string) string? "The result of this method is used as the help string" "\n" "when the " (racket menu-item%) " object is created." "\n" "\n" "Defaults to " (racket (string-constant replace-info)) ".")
|
||||
|
||||
@(defmethod (edit-menu:get-replace-all-item) (or/c false/c (is-a?/c menu-item%)) "This method returns the " (racket menu-item%) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-replace-all?) ").")
|
||||
|
||||
@(defmethod (edit-menu:create-replace-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 " (racket #f) ".")
|
||||
|
||||
@(defmethod (edit-menu:replace-all-callback (item (is-a?/c menu-item%)) (control (is-a?/c control-event%))) void? "Defaults to " (racketblock (void)) " ")
|
||||
|
||||
@(defmethod (edit-menu:replace-all-on-demand (menu-item (is-a?/c menu-item%))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (racketblock (void)))
|
||||
|
||||
@(defmethod (edit-menu:replace-all-string) string? "The result of this method is used as the name of the " (racket menu-item%) "." "\n" "\n" "Defaults to " (racket (string-constant replace-all-menu-item)) ".")
|
||||
|
||||
@(defmethod (edit-menu:replace-all-help-string) string? "The result of this method is used as the help string" "\n" "when the " (racket menu-item%) " object is created." "\n" "\n" "Defaults to " (racket (string-constant replace-all-info)) ".")
|
||||
|
||||
@(defmethod (edit-menu:get-find-case-sensitive-item) (or/c false/c (is-a?/c menu-item%)) "This method returns the " (racket 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-case-sensitive?) ").")
|
||||
|
||||
@(defmethod (edit-menu:create-find-case-sensitive?) 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 " (racket #f) ".")
|
||||
|
||||
@(defmethod (edit-menu:find-case-sensitive-callback (item (is-a?/c menu-item%)) (control (is-a?/c control-event%))) void? "Defaults to " (racketblock (void)) " ")
|
||||
|
||||
@(defmethod (edit-menu:find-case-sensitive-on-demand (item (is-a?/c menu-item%))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (racketblock (send item enable (let ((target (get-edit-target-object))) (and target (is-a? target editor<%>))))))
|
||||
|
||||
@(defmethod (edit-menu:find-case-sensitive-string) string? "The result of this method is used as the name of the " (racket menu-item%) "." "\n" "\n" "Defaults to " (racket (string-constant find-case-sensitive-menu-item)) ".")
|
||||
|
||||
@(defmethod (edit-menu:find-case-sensitive-help-string) string? "The result of this method is used as the help string" "\n" "when the " (racket menu-item%) " object is created." "\n" "\n" "Defaults to " (racket (string-constant find-case-sensitive-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 " (racket 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 " (racket (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 " (racketblock (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 " (racketblock (void)))
|
||||
|
||||
@(defmethod (edit-menu:preferences-string) string? "The result of this method is used as the name of the " (racket menu-item%) "." "\n" "\n" "Defaults to " (racket (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 " (racket menu-item%) " object is created." "\n" "\n" "Defaults to " (racket (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 " (racket 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 " (racket #f) ".")
|
||||
|
||||
@(defmethod (help-menu:about-callback (item (is-a?/c menu-item%)) (control (is-a?/c control-event%))) void? "Defaults to " (racketblock (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 " (racketblock (void)))
|
||||
|
||||
@(defmethod (help-menu:about-string) string? "The result of this method is used as the name of the " (racket menu-item%) "." "\n" "\n" "Defaults to " (racket (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 " (racket menu-item%) " object is created." "\n" "\n" "Defaults to " (racket (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. ")
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user