turn on GUI doc generation in scribblings setup
svn: r7118
This commit is contained in:
parent
c9f1aec9eb
commit
190b8f6e21
|
@ -720,7 +720,7 @@
|
|||
(not result-next-line?))
|
||||
end
|
||||
not-end))
|
||||
(loop ((if dots-next? cddr cdr) args) (sub1 req))))))))))))))
|
||||
(loop ((if dots-next? cddr cdr) args) (sub1 req))))))))))))))
|
||||
(if result-next-line?
|
||||
(list (list (make-flow (make-table-if-necessary
|
||||
"prototype"
|
||||
|
@ -1241,35 +1241,63 @@
|
|||
|
||||
(define-syntax-parameter current-class #f)
|
||||
|
||||
(define class-decls (make-hash-table 'equal))
|
||||
|
||||
(define-struct decl (name super intfs mk-body))
|
||||
(define-struct decl (name super intfs mk-head body methods))
|
||||
(define-struct constructor (def))
|
||||
(define-struct meth (mode desc def))
|
||||
(define-struct meth (name mode desc def))
|
||||
(define-struct spec (def))
|
||||
(define-struct impl (def))
|
||||
|
||||
(define (register-class name super intfs body)
|
||||
(let ([key (register-scheme-definition name)])
|
||||
(hash-table-put! class-decls
|
||||
key
|
||||
(make-decl name super intfs body))))
|
||||
(define-for-syntax (class-id->class-doc-info-id id)
|
||||
(datum->syntax-object id
|
||||
(string->symbol (format "class-doc-info:~a" (syntax-e id)))
|
||||
id))
|
||||
|
||||
(define (*include-class name)
|
||||
(let ([decl (hash-table-get class-decls (register-scheme-definition name))])
|
||||
(make-splice
|
||||
(cons (section #:style 'hidden (to-element (decl-name decl)))
|
||||
(map (lambda (i)
|
||||
(cond
|
||||
[(constructor? i) ((constructor-def i))]
|
||||
[(meth? i)
|
||||
((meth-def i) (meth-desc i))]
|
||||
[else i]))
|
||||
((decl-mk-body decl) #t))))))
|
||||
(define-syntax (define-class-doc-info stx)
|
||||
(syntax-case stx ()
|
||||
[(_ id val)
|
||||
(with-syntax ([id (class-id->class-doc-info-id #'id)])
|
||||
#'(begin
|
||||
(provide id)
|
||||
(define id val)))]))
|
||||
|
||||
(define-syntax (class-doc-info stx)
|
||||
(syntax-case stx (object%)
|
||||
[(_ object%) #'#f]
|
||||
[(_ id) (class-id->class-doc-info-id #'id)]))
|
||||
|
||||
(define (register-class name super intfs mk-head body)
|
||||
(let ([ht (make-hash-table)])
|
||||
(when super
|
||||
(hash-table-for-each (decl-methods super)
|
||||
(lambda (k v)
|
||||
(hash-table-put! ht k v))))
|
||||
(for-each (lambda (intf)
|
||||
(hash-table-for-each (decl-methods intf)
|
||||
(lambda (k v)
|
||||
(hash-table-put! ht k v))))
|
||||
intfs)
|
||||
(for-each (lambda (i)
|
||||
(when (meth? i)
|
||||
(hash-table-put! ht (meth-name i) (cons name i))))
|
||||
body)
|
||||
(make-decl name super intfs mk-head body ht)))
|
||||
|
||||
(define (*include-class decl)
|
||||
(make-splice
|
||||
(cons (section #:style 'hidden (to-element (decl-name decl)))
|
||||
(map (lambda (i)
|
||||
(cond
|
||||
[(constructor? i) ((constructor-def i))]
|
||||
[(meth? i)
|
||||
((meth-def i) (meth-desc i))]
|
||||
[else i]))
|
||||
(append
|
||||
((decl-mk-head decl) #t)
|
||||
(decl-body decl))))))
|
||||
|
||||
(define-syntax include-class
|
||||
(syntax-rules ()
|
||||
[(_ id) (*include-class (quote-syntax id))]))
|
||||
[(_ id) (*include-class (class-doc-info id))]))
|
||||
|
||||
(define (*defclass stx-id super intfs whole-page?)
|
||||
(let ([spacer (hspace 1)])
|
||||
|
@ -1324,34 +1352,34 @@
|
|||
(define-syntax defclass
|
||||
(syntax-rules ()
|
||||
[(_ name super (intf ...) body ...)
|
||||
(syntax-parameterize ([current-class (quote-syntax name)])
|
||||
(register-class (quote-syntax name)
|
||||
(quote-syntax super)
|
||||
(list (quote-syntax intf) ...)
|
||||
(lambda (whole-page?)
|
||||
(append
|
||||
(list
|
||||
(*defclass (quote-syntax name)
|
||||
(quote-syntax super)
|
||||
(list (quote-syntax intf) ...)
|
||||
whole-page?))
|
||||
(list body ...)))))]))
|
||||
(define-class-doc-info name
|
||||
(syntax-parameterize ([current-class (quote-syntax name)])
|
||||
(register-class (quote-syntax name)
|
||||
(class-doc-info super)
|
||||
(list (class-doc-info intf) ...)
|
||||
(lambda (whole-page?)
|
||||
(list
|
||||
(*defclass (quote-syntax name)
|
||||
(quote-syntax super)
|
||||
(list (quote-syntax intf) ...)
|
||||
whole-page?)))
|
||||
(list body ...))))]))
|
||||
|
||||
(define-syntax definterface
|
||||
(syntax-rules ()
|
||||
[(_ name (intf ...) body ...)
|
||||
(syntax-parameterize ([current-class (quote-syntax name)])
|
||||
(register-class (quote-syntax name)
|
||||
#f
|
||||
(list (quote-syntax intf) ...)
|
||||
(lambda (whole-page?)
|
||||
(append
|
||||
(list
|
||||
(*defclass (quote-syntax name)
|
||||
#f
|
||||
(list (quote-syntax intf) ...)
|
||||
whole-page?))
|
||||
(list body ...)))))]))
|
||||
(define-class-doc-info name
|
||||
(syntax-parameterize ([current-class (quote-syntax name)])
|
||||
(register-class (quote-syntax name)
|
||||
#f
|
||||
(list (class-doc-info intf) ...)
|
||||
(lambda (whole-page?)
|
||||
(list
|
||||
(*defclass (quote-syntax name)
|
||||
#f
|
||||
(list (quote-syntax intf) ...)
|
||||
whole-page?)))
|
||||
(list body ...))))]))
|
||||
|
||||
(define-syntax (defconstructor*/* stx)
|
||||
(syntax-case stx ()
|
||||
|
@ -1404,19 +1432,32 @@
|
|||
(define-syntax (defmethod* stx)
|
||||
(syntax-case stx ()
|
||||
[(_ #:mode mode ([(name arg ...) result-type] ...) desc ...)
|
||||
(with-syntax ([cname (syntax-parameter-value #'current-class)])
|
||||
#'(make-meth 'mode
|
||||
(lambda () (make-splice (apply
|
||||
append
|
||||
(map (lambda (f)
|
||||
(cond
|
||||
[(impl? f) ((impl-def f))]
|
||||
[(spec? f) ((spec-def f))]
|
||||
[else (list f)]))
|
||||
(list desc ...)))))
|
||||
(lambda (desc-splice)
|
||||
(defproc* #:mode send #:within cname ([(name arg ...) result-type] ...)
|
||||
(desc-splice)))))]
|
||||
(with-syntax ([cname (syntax-parameter-value #'current-class)]
|
||||
[name1 (car (syntax->list #'(name ...)))])
|
||||
(with-syntax ([(extra ...) (case (syntax-e #'mode)
|
||||
[(pubment)
|
||||
#'((t "Refine this method with " (scheme augment) "."))]
|
||||
[(override extend augment)
|
||||
#'((t (case (syntax-e #'mode)
|
||||
[(override) "Overrides "]
|
||||
[(extend) "Extends "]
|
||||
[(augment) "Augments "])
|
||||
(*xmethod/super (class-doc-info cname) 'name1) "."))]
|
||||
[else
|
||||
null])])
|
||||
#'(make-meth 'name1
|
||||
'mode
|
||||
(lambda () (make-splice (apply
|
||||
append
|
||||
(map (lambda (f)
|
||||
(cond
|
||||
[(impl? f) ((impl-def f))]
|
||||
[(spec? f) ((spec-def f))]
|
||||
[else (list f)]))
|
||||
(list extra ... desc ...)))))
|
||||
(lambda (desc-splice)
|
||||
(defproc* #:mode send #:within cname ([(name arg ...) result-type] ...)
|
||||
(desc-splice))))))]
|
||||
[(_ ([(name arg ...) result-type] ...) desc ...)
|
||||
#'(defmethod* #:mode public ([(name arg ...) result-type] ...) desc ...)]))
|
||||
|
||||
|
@ -1444,5 +1485,17 @@
|
|||
(with-syntax ([cname (syntax-parameter-value #'current-class)])
|
||||
#'(*this-obj 'cname))]))
|
||||
|
||||
(define (*xmethod/super decl name)
|
||||
(let ([super (ormap (lambda (decl)
|
||||
(and decl
|
||||
(let ([m (hash-table-get (decl-methods decl) name #f)])
|
||||
(and m (car m)))))
|
||||
(cons (decl-super decl)
|
||||
(decl-intfs decl)))])
|
||||
(make-element #f
|
||||
(list (*method name super)
|
||||
" in "
|
||||
(to-element super)))))
|
||||
|
||||
;; ----------------------------------------
|
||||
)
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
(require (lib "dirs.ss" "setup")
|
||||
(prefix core: "core.ss")
|
||||
(prefix quick: "quick.ss")
|
||||
(prefix scribble: "scribble.ss"))
|
||||
(prefix scribble: "scribble.ss")
|
||||
(prefix gui: "gui.ss"))
|
||||
|
||||
(provide post-installer)
|
||||
|
||||
|
@ -12,4 +13,5 @@
|
|||
(when doc
|
||||
(core:build)
|
||||
(quick:build)
|
||||
(scribble:build))))))
|
||||
(scribble:build)
|
||||
(gui:build))))))
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["area-intf.scrbl"]
|
||||
|
||||
@definterface[area-container<%> (area<%>)]{
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["area-container-intf.scrbl"]
|
||||
@require["window-intf.scrbl"]
|
||||
|
||||
@definterface[area-container-window<%> (area-container<%> window<%>)]{
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["dc-intf.scrbl"]
|
||||
|
||||
@defclass[bitmap-dc% object% (dc<%>)]{
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
|
||||
@require["control-intf.scrbl"]
|
||||
|
||||
@defclass[button% object% (control<%>)]{
|
||||
|
||||
|
@ -56,11 +56,14 @@ on-traverse-char]). @DeletedStyleNote{button}
|
|||
@FontKWs[] @WindowKWs[] @SubareaKWs[] @AreaKWs[]}
|
||||
|
||||
|
||||
@defmethod[#:mode 'add
|
||||
(set-label [label (is-a?/c bitmap%)])
|
||||
@defmethod[#:mode override
|
||||
(set-label [label (or/c label-string? (is-a?/c bitmap%))])
|
||||
void?]{
|
||||
|
||||
Sets the bitmap label for a bitmap button. @bitmaplabeluseisbm[label]
|
||||
The same as @xmethod[window<%> set-label] when @scheme[label] is a
|
||||
string.
|
||||
|
||||
Otherwise, sets the bitmap label for a bitmap button. @bitmaplabeluseisbm[label]
|
||||
@|bitmapiforiglabel|
|
||||
|
||||
}}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["canvas-intf.scrbl"]
|
||||
|
||||
@defclass[canvas% object% (canvas<%>)]{
|
||||
|
||||
|
@ -269,7 +270,7 @@ See also
|
|||
}
|
||||
|
||||
|
||||
@defmethod[#:mode 'override
|
||||
@defmethod[#:mode override
|
||||
(on-paint)
|
||||
void?]{
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["subwindow-intf.scrbl"]
|
||||
|
||||
@definterface[canvas<%> (subwindow<%>)]{
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["control-intf.scrbl"]
|
||||
|
||||
@defclass[check-box% object% (control<%>)]{
|
||||
|
||||
|
@ -53,16 +54,16 @@ Gets the state of the check box: @scheme[#t] if it is checked, @scheme[#f]
|
|||
|
||||
}
|
||||
|
||||
@defmethod[#:mode 'add
|
||||
(set-label [label (is-a?/c bitmap%)])
|
||||
@defmethod[#:mode override
|
||||
(set-label [label (or/c label-string? (is-a?/c bitmap%))])
|
||||
void?]{
|
||||
|
||||
Sets the bitmap label for a bitmap check box.
|
||||
The same as @xmethod[window<%> set-label] when @scheme[label] is a
|
||||
string.
|
||||
|
||||
Otherwise, sets the bitmap label for a bitmap check box.
|
||||
@bitmaplabeluseisbm[label] @|bitmapiforiglabel|
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@defmethod[(set-value [state any/c])
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["selectable-menu-item-intf.scrbl"]
|
||||
|
||||
@defclass[checkable-menu-item% object% (selectable-menu-item<%>)]{
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["list-control-intf.scrbl"]
|
||||
|
||||
@defclass[choice% object% (list-control<%>)]{
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["text-field-class.scrbl"]
|
||||
|
||||
@defclass[combo-field% text-field% ()]{
|
||||
|
||||
|
|
9
collects/scribblings/gui/config.scrbl
Normal file
9
collects/scribblings/gui/config.scrbl
Normal file
|
@ -0,0 +1,9 @@
|
|||
#reader(lib "docreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
|
||||
@title[#:style 'toc]{Configuration}
|
||||
|
||||
@local-table-of-contents[]
|
||||
|
||||
@include-section["prefs.scrbl"]
|
||||
@include-section["font-config.scrbl"]
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["event-class.scrbl"]
|
||||
|
||||
@defclass[control-event% event% ()]{
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["subwindow-intf.scrbl"]
|
||||
|
||||
@definterface[control<%> (subwindow<%>)]{
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["top-level-window-intf.scrbl"]
|
||||
|
||||
@defclass[dialog% object% (top-level-window<%>)]{
|
||||
|
||||
|
@ -78,7 +79,7 @@ Even if the dialog is not shown, a few notification events may be
|
|||
@WindowKWs[] @AreaContKWs[] @AreaKWs[]
|
||||
}
|
||||
|
||||
@defmethod[#:mode 'override
|
||||
@defmethod[#:mode override
|
||||
(on-subwindow-char [receiver (is-a?/c window<%>)]
|
||||
[event (is-a?/c key-event%)])
|
||||
boolean?]{
|
||||
|
@ -92,7 +93,7 @@ Returns the result of
|
|||
|
||||
}
|
||||
|
||||
@defmethod[#:mode 'auto-super
|
||||
@defmethod[#:mode override
|
||||
(show [show? any/c])
|
||||
void?]{
|
||||
|
||||
|
@ -108,7 +109,5 @@ If @scheme[show?] is true, the method does not immediately return. Instead,
|
|||
@scheme[yield] to avoid a busy-wait, and to ensure that the @scheme[show]
|
||||
method returns as soon as possible after the dialog is hidden.
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,32 +1,12 @@
|
|||
#reader(lib "docreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["diagrams.ss"]
|
||||
@require["mred-classes.ss"]
|
||||
|
||||
@title[#:style '(toc quiet)]{Drawing Classes}
|
||||
|
||||
@local-table-of-contents[]
|
||||
|
||||
@require["bitmap-class.scrbl"]
|
||||
@require["bitmap-dc-class.scrbl"]
|
||||
@require["brush-class.scrbl"]
|
||||
@require["brush-list-class.scrbl"]
|
||||
@require["color-class.scrbl"]
|
||||
@require["color-database-intf.scrbl"]
|
||||
@require["dc-intf.scrbl"]
|
||||
@require["dc-path-class.scrbl"]
|
||||
@require["font-class.scrbl"]
|
||||
@require["font-list-class.scrbl"]
|
||||
@require["font-name-directory-intf.scrbl"]
|
||||
@require["gl-config-class.scrbl"]
|
||||
@require["gl-context-intf.scrbl"]
|
||||
@require["pen-class.scrbl"]
|
||||
@require["pen-list-class.scrbl"]
|
||||
@require["point-class.scrbl"]
|
||||
@require["post-script-dc-class.scrbl"]
|
||||
@require["printer-dc-class.scrbl"]
|
||||
@require["ps-setup-class.scrbl"]
|
||||
@require["region-class.scrbl"]
|
||||
|
||||
@include-class[bitmap%]
|
||||
@include-class[bitmap-dc%]
|
||||
@include-class[brush%]
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["canvas-intf.scrbl"]
|
||||
|
||||
@defclass[editor-canvas% object% (canvas<%>)]{
|
||||
|
||||
|
@ -198,7 +199,7 @@ Enables or disables lazy-refresh mode, or gets the current enable
|
|||
}
|
||||
|
||||
|
||||
@defmethod[#:mode 'override
|
||||
@defmethod[#:mode override
|
||||
(on-char [event (is-a?/c key-event%)])
|
||||
void?]{
|
||||
|
||||
|
@ -211,7 +212,7 @@ See also @method[editor-canvas% get-editor].
|
|||
}
|
||||
|
||||
|
||||
@defmethod[#:mode 'override
|
||||
@defmethod[#:mode override
|
||||
(on-event [event (is-a?/c mouse-event%)])
|
||||
void?]{
|
||||
|
||||
|
@ -222,7 +223,7 @@ See also @method[editor-canvas% get-editor].
|
|||
|
||||
}
|
||||
|
||||
@defmethod[#:mode 'override
|
||||
@defmethod[#:mode override
|
||||
(on-focus [on? any/c])
|
||||
void?]{
|
||||
|
||||
|
@ -231,7 +232,7 @@ Enables or disables the caret in the @techlink{display}'s editor, if
|
|||
|
||||
}
|
||||
|
||||
@defmethod[#:mode 'override
|
||||
@defmethod[#:mode override
|
||||
(on-paint)
|
||||
void?]{
|
||||
|
||||
|
@ -239,7 +240,7 @@ Repaints the editor.
|
|||
|
||||
}
|
||||
|
||||
@defmethod[#:mode 'override
|
||||
@defmethod[#:mode override
|
||||
(on-size [width (integer-in 0 10000)]
|
||||
[height (integer-in 0 10000)])
|
||||
void?]{
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#reader(lib "docreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["diagrams.ss"]
|
||||
@require["mred-classes.ss"]
|
||||
|
||||
@title[#:style '(toc quiet)]{Editor Classes}
|
||||
|
||||
|
@ -28,38 +29,6 @@ Alphabetical:
|
|||
|
||||
@local-table-of-contents[]
|
||||
|
||||
@require["add-color-intf.scrbl"]
|
||||
@require["editor-intf.scrbl"]
|
||||
@require["editor-admin-class.scrbl"]
|
||||
@require["editor-canvas-class.scrbl"]
|
||||
@require["editor-data-class.scrbl"]
|
||||
@require["editor-data-class-class.scrbl"]
|
||||
@require["editor-data-class-list-intf.scrbl"]
|
||||
@require["editor-snip-editor-admin-intf.scrbl"]
|
||||
@require["editor-snip-class.scrbl"]
|
||||
@require["editor-stream-in-class.scrbl"]
|
||||
@require["editor-stream-in-base-class.scrbl"]
|
||||
@require["editor-stream-in-bytes-base-class.scrbl"]
|
||||
@require["editor-stream-out-class.scrbl"]
|
||||
@require["editor-stream-out-base-class.scrbl"]
|
||||
@require["editor-stream-out-bytes-base-class.scrbl"]
|
||||
@require["editor-wordbreak-map-class.scrbl"]
|
||||
@require["image-snip-class.scrbl"]
|
||||
@require["keymap-class.scrbl"]
|
||||
@require["mult-color-intf.scrbl"]
|
||||
@require["pasteboard-class.scrbl"]
|
||||
@require["readable-snip-intf.scrbl"]
|
||||
@require["snip-class.scrbl"]
|
||||
@require["snip-admin-class.scrbl"]
|
||||
@require["snip-class-class.scrbl"]
|
||||
@require["snip-class-list-intf.scrbl"]
|
||||
@require["string-snip-class.scrbl"]
|
||||
@require["style-intf.scrbl"]
|
||||
@require["style-delta-class.scrbl"]
|
||||
@require["style-list-class.scrbl"]
|
||||
@require["tab-snip-class.scrbl"]
|
||||
@require["text-class.scrbl"]
|
||||
|
||||
@include-class[add-color<%>]
|
||||
@include-class[editor<%>]
|
||||
@include-class[editor-admin%]
|
||||
|
|
|
@ -93,7 +93,7 @@ pasteboard editor, the default cursor is an arrow.
|
|||
|
||||
}}
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(after-edit-sequence)
|
||||
void?]{
|
||||
|
||||
|
@ -115,7 +115,7 @@ Does nothing.
|
|||
|
||||
}
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(after-load-file [success? any/c])
|
||||
void?]{
|
||||
|
||||
|
@ -140,7 +140,7 @@ Does nothing.
|
|||
}
|
||||
}
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(after-save-file [success? any/c])
|
||||
void?]{
|
||||
|
||||
|
@ -280,7 +280,7 @@ locked, etc.
|
|||
|
||||
}}
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(can-load-file? [filename path?]
|
||||
[format (one-of/c 'guess 'standard 'text 'text-force-cr 'same 'copy)])
|
||||
boolean?]{
|
||||
|
@ -305,7 +305,7 @@ Returns @scheme[#t].
|
|||
|
||||
}}
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(can-save-file? [filename path?]
|
||||
[format (one-of/c 'guess 'standard 'text 'text-force-cr 'same 'copy)])
|
||||
boolean?]{
|
||||
|
@ -336,7 +336,7 @@ Returns @scheme[#t].
|
|||
void?])]{
|
||||
|
||||
Changes the style for @techlink{items} in the editor, either by
|
||||
applying a style delta or using a specific style.
|
||||
applying a style delta or using a specific style.
|
||||
|
||||
To change a large collection of snips from one style to another style,
|
||||
consider providing a @scheme[style<%>] instance rather than a
|
||||
|
@ -1215,7 +1215,7 @@ For @scheme[text%] objects: @|FCA| @|EVD|
|
|||
}
|
||||
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(on-change)
|
||||
void?]{
|
||||
|
||||
|
@ -1289,7 +1289,7 @@ Does nothing. See also @xmethod[text% on-default-event] and
|
|||
}}
|
||||
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(on-display-size)
|
||||
void?]{
|
||||
|
||||
|
@ -1328,7 +1328,7 @@ Calls @method[editor<%> on-display-size] unless the editor is
|
|||
}
|
||||
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(on-edit-sequence)
|
||||
void?]{
|
||||
|
||||
|
@ -1407,7 +1407,7 @@ Either passes this event on to a caret-owning snip, selects a new
|
|||
}
|
||||
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(on-load-file [filename path?]
|
||||
[format (one-of/c 'guess 'standard 'text 'text-force-cr 'same 'copy)])
|
||||
void?]{
|
||||
|
@ -1566,7 +1566,7 @@ Does nothing.
|
|||
|
||||
}}
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(on-save-file [filename path?]
|
||||
[format (one-of/c 'guess 'standard 'text 'text-force-cr 'same 'copy)])
|
||||
void?]{
|
||||
|
@ -1592,7 +1592,7 @@ Does nothing.
|
|||
}}
|
||||
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(on-snip-modified [snip (is-a?/c snip%)]
|
||||
[modified? any/c])
|
||||
void?]{
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["snip-class.scrbl"]
|
||||
|
||||
@defclass[editor-snip% snip% ()]{
|
||||
|
||||
|
@ -39,7 +40,7 @@ get-margin] for information about the inset and margin arguments.
|
|||
}
|
||||
|
||||
|
||||
@defmethod[#:mode 'override
|
||||
@defmethod[#:mode override
|
||||
(adjust-cursor [dc (is-a?/c dc<%>)]
|
||||
[x real?]
|
||||
[y real?]
|
||||
|
@ -84,7 +85,7 @@ Returns the editor contained by the snip, or @scheme[#f] is there is
|
|||
|
||||
}
|
||||
|
||||
@defmethod[#:mode 'override
|
||||
@defmethod[#:mode override
|
||||
(get-extent [dc (is-a?/c dc<%>)]
|
||||
[x real?]
|
||||
[y real?]
|
||||
|
@ -198,7 +199,7 @@ See also @method[editor-snip% set-tight-text-fit].
|
|||
|
||||
}
|
||||
|
||||
@defmethod[#:mode 'override
|
||||
@defmethod[#:mode override
|
||||
(resize [w (and/c real? (not/c negative?))]
|
||||
[h (and/c real? (not/c negative?))])
|
||||
boolean?]{
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["editor-stream-in-base-class.scrbl"]
|
||||
|
||||
@defclass[editor-stream-in-bytes-base% editor-stream-in-base% ()]{
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["editor-stream-out-base-class.scrbl"]
|
||||
|
||||
@defclass[editor-stream-out-bytes-base% editor-stream-out-base% ()]{
|
||||
|
||||
|
|
386
collects/scribblings/gui/font-config.scrbl
Normal file
386
collects/scribblings/gui/font-config.scrbl
Normal file
|
@ -0,0 +1,386 @@
|
|||
#reader(lib "docreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require[(lib "bnf.ss" "scribble")]
|
||||
|
||||
@title[#:tag "mr:fontresources"]{Font Configuration}
|
||||
|
||||
This chapter describes how to set up face mappings for screen and
|
||||
PostScript fonts via preferences (see @|mrprefsdiscuss|). The
|
||||
font-configuration system is overkill; it was designed to handle
|
||||
especially complex X font mappings before fontconfig/Xft solved the
|
||||
problem.
|
||||
|
||||
An implementor for a MrEd-based program may find it easier to use the
|
||||
@method[font-name-directory<%> set-screen-name] and
|
||||
@method[font-name-directory<%> set-post-script-name] methods
|
||||
provided by @scheme[the-font-name-directory]. As a user of a
|
||||
MrEd-based program, preferences provide a mechanism for setting
|
||||
default mappings.
|
||||
|
||||
Whether a programmer or a user, see @scheme[font-name-directory<%>] for
|
||||
an overview of the font mapping system.
|
||||
|
||||
To find a font name for a family, MrEd looks for a preference name by
|
||||
concatenating @litchar["MrEd:"], a @nonterm{dest}, a @nonterm{type},
|
||||
a @nonterm{weight}, and a @nonterm{style}, where
|
||||
|
||||
@itemize{
|
||||
|
||||
@item{@nonterm{dest} is either @litchar["Screen"] or @litchar["PostScript"].}
|
||||
|
||||
@item{@nonterm{type} is either @litchar["Default"], @litchar["Decorative"], @litchar["Roman"], @litchar["Script"],
|
||||
@litchar["Swiss"], @litchar["Modern"], @litchar["System"], or @litchar["Symbol"] for a mapping
|
||||
defining the default font for a family. Otherwise, it is a
|
||||
face name prefixed with @litchar["@"].}
|
||||
|
||||
@item{@nonterm{weight} is either @litchar["Medium"], @litchar["Bold"], or @litchar["Light"].}
|
||||
|
||||
@item{@nonterm{style} is either @litchar["Straight"], @litchar["Italic"], or @litchar["Slant"].}
|
||||
|
||||
}
|
||||
|
||||
Furthermore, any of the latter three parts can be wildcarded with
|
||||
@litchar["_"], as described below. The concatenated string is converted
|
||||
to a symbol (preserving case), and the associated preference value
|
||||
must be a string.
|
||||
|
||||
The value of the preference is parsed as described in
|
||||
@scheme[font-name-directory<%>] for parsing face names, except that
|
||||
the string can contain references and other tricks described below.
|
||||
|
||||
@; ------------------------------------------------------------------------
|
||||
|
||||
@section[#:tag "mr:exampleresources"]{Wildcards}
|
||||
|
||||
Building items names by concatenating @nonterm{dest}, @nonterm{type},
|
||||
@nonterm{weight}, and @nonterm{style} can create a large number of preference
|
||||
entries, and the @nonterm{weight} and @nonterm{style} parts are useful only
|
||||
for X screen fonts. To avoid an explosion of preferences, MrEd finds
|
||||
preferences via a wildcarding search.
|
||||
|
||||
The @nonterm{type}, @nonterm{weight}, and @nonterm{style} parts of a preference name
|
||||
can be wildcarded by using @litchar["_"]. Thus, to set the default font
|
||||
in X for all types, weights, and styles, use the following preference
|
||||
entry:
|
||||
|
||||
@schemeblock[
|
||||
(MrEd:Screen___ "+-*-*-medium-r-normal-*-*-%d-*-*-*-*-*-*")
|
||||
]
|
||||
|
||||
Wildcarded preference entries are used only when un-wildcarded values
|
||||
cannot be found. If two preference names both match for some search,
|
||||
then the one with the ``earliest'' (i.e., closest to the beginning of
|
||||
the preference name) non-wildcarded part will prevail.
|
||||
|
||||
The default MrEd preferences for Windows uses wildcarding to specify
|
||||
the basic font mapping, as if written as:
|
||||
|
||||
@schemeblock[
|
||||
(MrEd:ScreenSystem__ "MS Sans Serif")
|
||||
(MrEd:ScreenRoman__ "Times New Roman")
|
||||
(MrEd:ScreenDecorative__ "Modern")
|
||||
....
|
||||
]
|
||||
|
||||
Wildcarding in the preference name naturally leads to references,
|
||||
variables, and wildcarding references in the preference
|
||||
value. These features are described in the following few sections.
|
||||
|
||||
@; ------------------------------------------------------------------------
|
||||
|
||||
@section{References}
|
||||
|
||||
Suppose we define the mapping for variants of @scheme["Default"], and
|
||||
then we want @scheme["Roman"] to use this setting, too. We could copy
|
||||
the preference entry, as in the following example:
|
||||
|
||||
@schemeblock[
|
||||
(|MrEd:ScreenDefault__| "+-*-*-medium-r-normal-*-*-%d-*-*-*-*-*-*")
|
||||
(|MrEd:ScreenRoman__| "+-*-*-medium-r-normal-*-*-%d-*-*-*-*-*-*")
|
||||
]
|
||||
|
||||
but the MrEd font-reading system provides a better syntax for
|
||||
referencing another preference entry. When a preference value contains
|
||||
@litchar["${x}"], then the @litchar["${x}"] fragment is replaced by the
|
||||
preference value of @litchar["x"]. Thus, the above can be re-written:
|
||||
|
||||
@schemeblock[
|
||||
(|MrEd:ScreenDefault__| "+-*-*-medium-r-normal-*-*-%d-*-*-*-*-*-*")
|
||||
(|MrEd:ScreenRoman__| "${ScreenDefault__}")
|
||||
]
|
||||
|
||||
A mini-language of @litchar["${x}"] is used within the string (instead
|
||||
of an S-expression format) for historical reasons.
|
||||
|
||||
@; ------------------------------------------------------------------------
|
||||
|
||||
@section{Variables}
|
||||
|
||||
Variables can be used with referencing to configure default values
|
||||
based on the weight and style that is needed. When a preference
|
||||
value contains @litchar["$[weight]"], then @litchar["$[weight]"] is
|
||||
replaced with a string for the desired font weight. Similarly,
|
||||
@litchar["$[style]"] is replaced with the desired style. Variable
|
||||
expressions can be embedded within referencing expressions, as in the
|
||||
following example:
|
||||
|
||||
@schemeblock[
|
||||
(|MrEd:ScreenDefault__|
|
||||
"+-*-*-${Def$[weight]}-r-normal-*-*-%d-*-*-*-*-*-*")
|
||||
(|MrEd:DefMedium| "medium")
|
||||
(|MrEd:DefBold| "bold")
|
||||
(|MrEd:DefLight| "medium")
|
||||
]
|
||||
|
||||
Now, when the @Resource{ScreenDefault__} value is used for different
|
||||
weights, it will return different values; the
|
||||
@litchar["${Def$[weight]}"] expression will turn into
|
||||
@litchar["${DefMedium}"] for a medium-weight lookup, or
|
||||
@litchar["${DefBold}"] for a bold-weight lookup. These references
|
||||
will in turn give either @litchar["medium"] or @litchar["bold"].
|
||||
|
||||
@; ------------------------------------------------------------------------
|
||||
|
||||
@section{Wildcarding References}
|
||||
|
||||
Consider the following preference configuration:
|
||||
|
||||
@schemeblock[
|
||||
(|MrEd:ScreenDefault__| "+-*-*-medium-r-normal-*-*-%d-*-*-*-*-*-*")
|
||||
(|MrEd:ScreenDefaultBold_| "+-*-*-bold-r-normal-*-*-%d-*-*-*-*-*-*")
|
||||
(|MrEd:ScreenRoman__| "${ScreenDefault__}")
|
||||
]
|
||||
|
||||
The effect of this statement is probably not what was intended; when a
|
||||
bold version of the @litchar{Roman} font is needed, the
|
||||
@Resource{ScreenRoman__} value references the
|
||||
@Resource{ScreenDefault__} value, which does not specify a bold font. We
|
||||
could try to remedy the situation as follows:
|
||||
|
||||
@schemeblock[
|
||||
(|MrEd:ScreenDefault__| "+-*-*-medium-r-normal-*-*-%d-*-*-*-*-*-*")
|
||||
(|MrEd:ScreenDefaultBold_| "+-*-*-bold-r-normal-*-*-%d-*-*-*-*-*-*")
|
||||
(|MrEd:ScreenRoman__| "${ScreenDefault$[weight]_}")
|
||||
]
|
||||
|
||||
but this does not work either. It works fine for bold @litchar["Roman"],
|
||||
now, but medium @litchar["Roman"] will cause a reference to the
|
||||
@Resource{ScreenDefaultMedium_}, which doesn't exist. The problem is
|
||||
that our reference does not use wildcarding like the original medium
|
||||
@litchar["Roman"] lookup did.
|
||||
|
||||
Wildcarding can be specified in a reference by separating each
|
||||
wildcardable field with a comma. The following preference specification
|
||||
does what we want:
|
||||
|
||||
@schemeblock[
|
||||
(|MrEd:ScreenDefault__| "+-*-*-medium-r-normal-*-*-%d-*-*-*-*-*-*")
|
||||
(|MrEd:ScreenDefaultBold_| "+-*-*-bold-r-normal-*-*-%d-*-*-*-*-*-*")
|
||||
(|MrEd:ScreenRoman__| "${ScreenDefault,$[weight],_}")
|
||||
]
|
||||
|
||||
Since @litchar["$[weight]"] is between commas, it can be wildcarded if
|
||||
no name exactly matching @litchar["SchemeDefault$[weight]_"] is
|
||||
found. In this case @litchar["SchemeDefault"] and @litchar["_"] can
|
||||
also be wildcarded, but this will have no effect.
|
||||
|
||||
The wildcarding used in references need not reflect the wildcarding
|
||||
MrEd initial uses for finding fonts. In other words, a number of
|
||||
comma-separated selects can appear between the curly braces.
|
||||
|
||||
@; ------------------------------------------------------------------------
|
||||
|
||||
@section{Internal Preferences}
|
||||
|
||||
The initial font setup is built into MrEd through a built-in preference
|
||||
table. The table is shown at the end of this section. When font
|
||||
information is computed, it is @italic{almost} as if this table were
|
||||
installed into your preferences file; the difference is that preference
|
||||
specifications in your file override specifications in the built-in
|
||||
table, even when the wildcarding of your preference provides a weaker
|
||||
match.
|
||||
|
||||
When no information is available for mapping a face name to a font,
|
||||
MrEd falls back to the system described in
|
||||
@scheme[font-name-directory<%>]. (Since a mapping is built into MrEd
|
||||
for every family, information is always available for the default
|
||||
font of a family.)
|
||||
|
||||
Internal preferences for all platforms:
|
||||
|
||||
@schemeblock[
|
||||
(|MrEd:PostScriptMediumStraight| "")
|
||||
(|MrEd:PostScriptMediumItalic| "-Oblique")
|
||||
(|MrEd:PostScriptMediumSlant| "-Oblique")
|
||||
(|MrEd:PostScriptLightStraight| "")
|
||||
(|MrEd:PostScriptLightItalic| "-Oblique")
|
||||
(|MrEd:PostScriptLightSlant| "-Oblique")
|
||||
(|MrEd:PostScriptBoldStraight| "-Bold")
|
||||
(|MrEd:PostScriptBoldItalic| "-BoldOblique")
|
||||
(|MrEd:PostScriptBoldSlant| "-BoldOblique")
|
||||
|
||||
(|MrEd:PostScript___| "${PostScript$[family],$[weight],$[style]}")
|
||||
|
||||
(|MrEd:PostScriptSystem__| "${PostScriptTimes,$[weight],$[style]}")
|
||||
(|MrEd:PostScriptRoman__| "${PostScriptTimes,$[weight],$[style]}")
|
||||
(|MrEd:PostScriptDecorative__| "${PostScriptTimes,$[weight],$[style]}")
|
||||
(|MrEd:PostScriptScript__| "ZapfChancery-MediumItalic")
|
||||
|
||||
(|MrEd:PostScriptTimesMedium| "")
|
||||
(|MrEd:PostScriptTimesLight| "")
|
||||
(|MrEd:PostScriptTimesBold| "Bold")
|
||||
|
||||
(|MrEd:PostScriptTimes__| "Times${PostScript$[weight]$[style]}")
|
||||
(|MrEd:PostScriptTimesMediumStraight| "Times-Roman")
|
||||
(|MrEd:PostScriptTimesLightStraight| "Times-Roman")
|
||||
(|MrEd:PostScriptTimes_Slant|
|
||||
"Times-${PostScriptTimes$[weight]}Italic")
|
||||
(|MrEd:PostScriptTimes_Italic|
|
||||
"Times-${PostScriptTimes$[weight]}Italic")
|
||||
|
||||
(|MrEd:PostScriptDefault__| "Helvetica${PostScript$[weight]$[style]}")
|
||||
(|MrEd:PostScriptSwiss__| "Helvetica${PostScript$[weight]$[style]}")
|
||||
(|MrEd:PostScriptModern__| "Courier${PostScript$[weight]$[style]}")
|
||||
(|MrEd:PostScriptSymbol__| "Symbol")
|
||||
]
|
||||
|
||||
Internal preferences for X with fontconfig/Xft/RENDER only:
|
||||
|
||||
@schemeblock[
|
||||
(|MrEd:ScreenSystem__| " Sans")
|
||||
(|MrEd:ScreenDefault__| " Sans")
|
||||
(|MrEd:ScreenRoman__| " Serif")
|
||||
(|MrEd:ScreenDecorative__| " Nimbus Sans L")
|
||||
(|MrEd:ScreenModern__| " Monospace")
|
||||
(|MrEd:ScreenSwiss__| " Nimbus Sans L")
|
||||
(|MrEd:ScreenScript__| " URW Chancery L")
|
||||
(|MrEd:ScreenSymbolBase| " Standard Symbols L,Nimbus Sans L")
|
||||
]
|
||||
|
||||
Internal preferences for X only (except those overridden for fontconfig/Xft/RENDER):
|
||||
|
||||
@schemeblock[
|
||||
(|MrEd:ScreenMedium| "medium")
|
||||
(|MrEd:ScreenBold| "bold")
|
||||
(|MrEd:ScreenLight| "light")
|
||||
(|MrEd:ScreenStraight| "r")
|
||||
(|MrEd:ScreenItalic| "i")
|
||||
(|MrEd:ScreenSlant| "o")
|
||||
|
||||
(|MrEd:ScreenSystemBase| "*-lucida")
|
||||
(|MrEd:ScreenDefaultBase| "*-lucida")
|
||||
(|MrEd:ScreenRomanBase| "*-times")
|
||||
(|MrEd:ScreenDecorativeBase| "*-helvetica")
|
||||
(|MrEd:ScreenModernBase| "*-courier")
|
||||
(|MrEd:ScreenSwissBase| "*-lucida")
|
||||
(|MrEd:ScreenScriptBase| "*-zapfchancery")
|
||||
(|MrEd:ScreenSymbolBase| "*-symbol")
|
||||
|
||||
(|MrEd:ScreenStdSuffix|
|
||||
"-${Screen$[weight]}-${Screen$[style]}-normal-*-*-%d-*-*-*-*-*-*")
|
||||
|
||||
(|MrEd:ScreenSystem__| "+-${ScreenSystemBase}${ScreenStdSuffix}")
|
||||
(|MrEd:ScreenDefault__| "+-${ScreenDefaultBase}${ScreenStdSuffix}")
|
||||
(|MrEd:ScreenRoman__| "+-${ScreenRomanBase}${ScreenStdSuffix}")
|
||||
(|MrEd:ScreenDecorative__|
|
||||
"+-${ScreenDecorativeBase}${ScreenStdSuffix}")
|
||||
(|MrEd:ScreenModern__| "+-${ScreenModernBase}${ScreenStdSuffix}")
|
||||
(|MrEd:ScreenSwiss__| "+-${ScreenSwissBase}${ScreenStdSuffix}")
|
||||
(|MrEd:ScreenScript__| "+-${ScreenScriptBase}${ScreenStdSuffix}")
|
||||
(|MrEd:ScreenSymbol__|
|
||||
"+-${ScreenSymbolBase}-medium-r-normal-*-*-%d-*-*-*-*-*-*")
|
||||
]
|
||||
|
||||
Internal preferences for Windows only:
|
||||
|
||||
@schemeblock[
|
||||
(|MrEd:ScreenSystem__| "MS Sans Serif")
|
||||
(|MrEd:ScreenDefault__| "MS Sans Serif")
|
||||
(|MrEd:ScreenRoman__| "Times New Roman")
|
||||
(|MrEd:ScreenDecorative__| "Arial")
|
||||
(|MrEd:ScreenModern__| "Courier New")
|
||||
(|MrEd:ScreenSwiss__| "Arial")
|
||||
(|MrEd:ScreenScript__| "Arial")
|
||||
(|MrEd:ScreenSymbol__| "Symbol")
|
||||
]
|
||||
|
||||
Internal preferences for Mac OS X only:
|
||||
|
||||
@schemeblock[
|
||||
(|MrEd:ScreenDefault__| "Lucida Grande")
|
||||
(|MrEd:ScreenSystem__| "Lucida Grande")
|
||||
(|MrEd:ScreenRoman__| "Times")
|
||||
(|MrEd:ScreenDecorative__| "Arial")
|
||||
(|MrEd:ScreenModern__| "Courier New")
|
||||
(|MrEd:ScreenSwiss__| "Helvetica")
|
||||
(|MrEd:ScreenScript__| "Apple Chancery")
|
||||
(|MrEd:ScreenSymbol__| "Symbol")
|
||||
]
|
||||
|
||||
@; ------------------------------------------------------------------------
|
||||
|
||||
@section[#:tag "mr:postscriptfonts"]{PostScript Fonts}
|
||||
|
||||
@section-index["fonts" "PostScript"]
|
||||
@section-index["PostScript fonts"]
|
||||
@section-index["AFM"]
|
||||
@section-index["CID"]
|
||||
@section-index["CMap"]
|
||||
|
||||
To generate PostScript output, MrEd must be able to find an @|AFM|
|
||||
(AFM) file corresponding to the PostScript font. An AFM file
|
||||
typically uses the suffix @indexed-file{.afm}, and several AFM files
|
||||
are distributed with MrEd in the @file{afm} collection.
|
||||
|
||||
MrEd finds an AFM file by adding a @file{.afm} suffix to the
|
||||
PostScript name of the font, and checking all directories specified
|
||||
by the @scheme[current-ps-afm-file-paths] parameter. The initial
|
||||
value of this parameter is determined by the
|
||||
@indexed-envvar{PLTAFMPATHS} environment variable; the environment
|
||||
variable's setting is parsed with
|
||||
@scheme[path-list-string->path-list] using @scheme[(list
|
||||
(collection-path "afm"))] as the default list.
|
||||
|
||||
Depending on whether the font is CID-based (typically for the Chinese,
|
||||
Japanese, Korean, and Vietnamese language families, and as indicated
|
||||
in the AFM file), MrEd must find additional files:
|
||||
|
||||
@itemize{
|
||||
|
||||
@item{@italic{Non-CID:} In addition to an AFM file
|
||||
@file{@nonterm{x}.afm}, MrEd looks for a
|
||||
@file{@nonterm{x}-glyphlist.txt} file (in the same directory as the
|
||||
AFM file) to map glyph names in the AFM file to Unicode character
|
||||
values. In addition to this font-specific file, MrEd looks for a
|
||||
@indexed-file{glyphlist.txt} file to supply a mapping for Adobe's
|
||||
standard glyph names, and this mapping is used when a font-specific
|
||||
mapping is not supplied, or when the mapping does not cover a name
|
||||
found in the AFM file. MrEd looks for @file{glyphlist.txt} in the
|
||||
same place as AFM files. Since @file{glyphlist.txt} is large, if a
|
||||
@indexed-file{glyphshortlist.txt} file is available, it is read first,
|
||||
and then @file{glyphlist.txt} is read only if a character name must
|
||||
be resolved that is not in @file{glyphshortlist.txt}.}
|
||||
|
||||
@item{@italic{CID:} In addition to an AFM file, MrEd must find and
|
||||
read CMap files to convert glyph IDs for the font to Unicode
|
||||
characters. The character set name is used as the name of the CMap
|
||||
file to load, and MrEd checks all directories specified by the
|
||||
@scheme[current-ps-cmap-file-paths] parameter. The initial value of
|
||||
this parameter is determined by the @indexed-envvar{PLTCMAPPATHS}
|
||||
environment variable; the environment variable's setting is parsed
|
||||
with @scheme[path-list-string->path-list] using @scheme[(list
|
||||
(collection-path "afm" "CMap"))] as the default list. In addition to
|
||||
a CMap file for the font's character set, MrEd must find a
|
||||
@indexed-file{UniCNS-UTF32-H} CMap file to complete the mapping to
|
||||
Unicode. MrEd automatically adds the font's character set to the font
|
||||
name when producing PostScript with a CID-based font.}
|
||||
|
||||
}
|
||||
|
||||
When drawing or measuring text using a particular PostScript font, if
|
||||
the font does not contain a glyph for a character (or if a relevant
|
||||
AFM file cannot be found for the font), then MrEd attempts to
|
||||
substitute another PostScript font. A substitute font is selected by
|
||||
checking all @file{.afm} files in the directories specified
|
||||
by @scheme[current-ps-afm-file-paths] (in order), and choosing the
|
||||
first discovered match.
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["top-level-window-intf.scrbl"]
|
||||
|
||||
@defclass[frame% object% (top-level-window<%>)]{
|
||||
|
||||
|
@ -241,7 +242,7 @@ If the event does not correspond to a complete shortcut combination,
|
|||
|
||||
}
|
||||
|
||||
@defmethod[#:mode 'override
|
||||
@defmethod[#:mode override
|
||||
(on-subwindow-char [receiver (is-a?/c window<%>)]
|
||||
[event (is-a?/c key-event%)])
|
||||
boolean?]{
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["control-intf.scrbl"]
|
||||
|
||||
@defclass[gauge% object% (control<%>)]{
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["vertical-panel-class.scrbl"]
|
||||
|
||||
@defclass[group-box-panel% vertical-panel% ()]{
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["pane-class.scrbl"]
|
||||
|
||||
@defclass[grow-box-spacer-pane% pane% ()]{
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#reader(lib "docreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
|
||||
@title{PLT Scheme GUI Toolbox}
|
||||
@title{PLT Scheme GUI: MrEd}
|
||||
|
||||
This manual describes MrEd.
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["pane-class.scrbl"]
|
||||
|
||||
@defclass[horizontal-pane% pane% ()]{
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["panel-class.scrbl"]
|
||||
|
||||
@defclass[horizontal-panel% panel% ()]{
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["snip-class.scrbl"]
|
||||
|
||||
@defclass[image-snip% snip% ()]{
|
||||
|
||||
|
@ -105,7 +106,7 @@ If @scheme[inline?] is not @scheme[#f], the image data will be saved
|
|||
|
||||
}
|
||||
|
||||
@defmethod[#:mode 'override
|
||||
@defmethod[#:mode override
|
||||
(resize [w (and/c real? (not/c negative?))]
|
||||
[h (and/c real? (not/c negative?))])
|
||||
void?]{
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["event-class.scrbl"]
|
||||
|
||||
@defclass[key-event% event% ()]{
|
||||
|
||||
|
|
|
@ -327,7 +327,7 @@ Examples:
|
|||
A call to @method[keymap% map-function] that would map a particular
|
||||
key sequence both as a prefix and as a complete sequence raises an
|
||||
exception, but the exception handler cannot escape (see
|
||||
@secref["mr:mr:evtcontjump"]).
|
||||
@secref["mr:evtcontjump"]).
|
||||
|
||||
A function name does not have to be mapped to a handler before input
|
||||
states are mapped to the name; the handler is dispatched by name at
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["menu-item-intf.scrbl"]
|
||||
|
||||
@definterface[labelled-menu-item<%> (menu-item<%>)]{
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["list-control-intf.scrbl"]
|
||||
|
||||
@define[lbnumnote @elem{List box items are indexed from @scheme[0].}]
|
||||
|
||||
|
@ -94,16 +95,18 @@ If @scheme[selection] is an integer, it is passed to
|
|||
}
|
||||
|
||||
|
||||
@defmethod[#:mode 'add
|
||||
@defmethod[#:mode override
|
||||
(append [item string]
|
||||
[data any/c])
|
||||
[data any/c #f])
|
||||
void?]{
|
||||
|
||||
Adds a new item to the list box with an associated ``data'' object.
|
||||
The @scheme[data] object is not displayed in the list box; it is
|
||||
provided merely as a convenience for use with
|
||||
@method[list-box% get-data], possibly allowing a programmer to avoid managing a separate
|
||||
item-to-data mapping in addition to the list box control.
|
||||
provided merely as a convenience for use with @method[list-box%
|
||||
get-data], possibly allowing a programmer to avoid managing a
|
||||
separate item-to-data mapping in addition to the list box control.
|
||||
|
||||
See also @xmethod[list-control<%> append].
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["control-intf.scrbl"]
|
||||
|
||||
@definterface[list-control<%> (control<%>)]{
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["menu-item-container-intf.scrbl"]
|
||||
|
||||
@defclass[menu-bar% object% (menu-item-container<%>)]{
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["labelled-menu-item-intf.scrbl"]
|
||||
@require["menu-item-container-intf.scrbl"]
|
||||
|
||||
@defclass[menu% object% (menu-item-container<%> labelled-menu-item<%>)]{
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["selectable-menu-item-intf.scrbl"]
|
||||
|
||||
@defclass[menu-item% object% (selectable-menu-item<%>)]{
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["control-intf.scrbl"]
|
||||
|
||||
@defclass[message% object% (control<%>)]{
|
||||
|
||||
|
@ -38,11 +39,14 @@ Creates a string or bitmap message initially showing @scheme[label].
|
|||
|
||||
}
|
||||
|
||||
@defmethod[#:mode 'add
|
||||
(set-label [label (is-a?/c bitmap%)])
|
||||
@defmethod[#:mode override
|
||||
(set-label [label (or/c label-string? (is-a?/c bitmap%))])
|
||||
void?]{
|
||||
|
||||
Sets the bitmap label for a bitmap message.
|
||||
The same as @xmethod[window<%> set-label] when @scheme[label] is a
|
||||
string.
|
||||
|
||||
Otherwise, sets the bitmap label for a bitmap message.
|
||||
@bitmaplabeluseisbm[label] @|bitmapiforiglabel|
|
||||
|
||||
}}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["event-class.scrbl"]
|
||||
|
||||
@defclass[mouse-event% event% ()]{
|
||||
|
||||
|
|
113
collects/scribblings/gui/mred-classes.ss
Normal file
113
collects/scribblings/gui/mred-classes.ss
Normal file
|
@ -0,0 +1,113 @@
|
|||
(module mred-classes mzscheme
|
||||
|
||||
(define-syntax require+provide
|
||||
(syntax-rules ()
|
||||
[(_ s) (begin (require s) (provide (all-from s)))]))
|
||||
|
||||
;; Windowing
|
||||
(require+provide "area-intf.scrbl")
|
||||
(require+provide "area-container-intf.scrbl")
|
||||
(require+provide "area-container-window-intf.scrbl")
|
||||
(require+provide "button-class.scrbl")
|
||||
(require+provide "canvas-intf.scrbl")
|
||||
(require+provide "canvas-class.scrbl")
|
||||
(require+provide "check-box-class.scrbl")
|
||||
(require+provide "checkable-menu-item-class.scrbl")
|
||||
(require+provide "choice-class.scrbl")
|
||||
(require+provide "clipboard-client-class.scrbl")
|
||||
(require+provide "clipboard-intf.scrbl")
|
||||
(require+provide "combo-field-class.scrbl")
|
||||
(require+provide "control-intf.scrbl")
|
||||
(require+provide "control-event-class.scrbl")
|
||||
(require+provide "cursor-class.scrbl")
|
||||
(require+provide "dialog-class.scrbl")
|
||||
(require+provide "event-class.scrbl")
|
||||
(require+provide "frame-class.scrbl")
|
||||
(require+provide "gauge-class.scrbl")
|
||||
(require+provide "group-box-panel-class.scrbl")
|
||||
(require+provide "grow-box-spacer-pane-class.scrbl")
|
||||
(require+provide "horizontal-pane-class.scrbl")
|
||||
(require+provide "horizontal-panel-class.scrbl")
|
||||
(require+provide "key-event-class.scrbl")
|
||||
(require+provide "labelled-menu-item-intf.scrbl")
|
||||
(require+provide "list-box-class.scrbl")
|
||||
(require+provide "list-control-intf.scrbl")
|
||||
(require+provide "menu-class.scrbl")
|
||||
(require+provide "menu-bar-class.scrbl")
|
||||
(require+provide "menu-item-intf.scrbl")
|
||||
(require+provide "menu-item-class.scrbl")
|
||||
(require+provide "menu-item-container-intf.scrbl")
|
||||
(require+provide "message-class.scrbl")
|
||||
(require+provide "mouse-event-class.scrbl")
|
||||
(require+provide "pane-class.scrbl")
|
||||
(require+provide "panel-class.scrbl")
|
||||
(require+provide "popup-menu-class.scrbl")
|
||||
(require+provide "radio-box-class.scrbl")
|
||||
(require+provide "selectable-menu-item-intf.scrbl")
|
||||
(require+provide "separator-menu-item-class.scrbl")
|
||||
(require+provide "scroll-event-class.scrbl")
|
||||
(require+provide "slider-class.scrbl")
|
||||
(require+provide "subarea-intf.scrbl")
|
||||
(require+provide "subwindow-intf.scrbl")
|
||||
(require+provide "tab-panel-class.scrbl")
|
||||
(require+provide "text-field-class.scrbl")
|
||||
(require+provide "timer-class.scrbl")
|
||||
(require+provide "top-level-window-intf.scrbl")
|
||||
(require+provide "vertical-pane-class.scrbl")
|
||||
(require+provide "vertical-panel-class.scrbl")
|
||||
(require+provide "window-intf.scrbl")
|
||||
|
||||
;; Drawing
|
||||
(require+provide "bitmap-class.scrbl")
|
||||
(require+provide "bitmap-dc-class.scrbl")
|
||||
(require+provide "brush-class.scrbl")
|
||||
(require+provide "brush-list-class.scrbl")
|
||||
(require+provide "color-class.scrbl")
|
||||
(require+provide "color-database-intf.scrbl")
|
||||
(require+provide "dc-intf.scrbl")
|
||||
(require+provide "dc-path-class.scrbl")
|
||||
(require+provide "font-class.scrbl")
|
||||
(require+provide "font-list-class.scrbl")
|
||||
(require+provide "font-name-directory-intf.scrbl")
|
||||
(require+provide "gl-config-class.scrbl")
|
||||
(require+provide "gl-context-intf.scrbl")
|
||||
(require+provide "pen-class.scrbl")
|
||||
(require+provide "pen-list-class.scrbl")
|
||||
(require+provide "point-class.scrbl")
|
||||
(require+provide "post-script-dc-class.scrbl")
|
||||
(require+provide "printer-dc-class.scrbl")
|
||||
(require+provide "ps-setup-class.scrbl")
|
||||
(require+provide "region-class.scrbl")
|
||||
|
||||
;; Editor
|
||||
(require+provide "add-color-intf.scrbl")
|
||||
(require+provide "editor-intf.scrbl")
|
||||
(require+provide "editor-admin-class.scrbl")
|
||||
(require+provide "editor-canvas-class.scrbl")
|
||||
(require+provide "editor-data-class.scrbl")
|
||||
(require+provide "editor-data-class-class.scrbl")
|
||||
(require+provide "editor-data-class-list-intf.scrbl")
|
||||
(require+provide "editor-snip-editor-admin-intf.scrbl")
|
||||
(require+provide "editor-snip-class.scrbl")
|
||||
(require+provide "editor-stream-in-class.scrbl")
|
||||
(require+provide "editor-stream-in-base-class.scrbl")
|
||||
(require+provide "editor-stream-in-bytes-base-class.scrbl")
|
||||
(require+provide "editor-stream-out-class.scrbl")
|
||||
(require+provide "editor-stream-out-base-class.scrbl")
|
||||
(require+provide "editor-stream-out-bytes-base-class.scrbl")
|
||||
(require+provide "editor-wordbreak-map-class.scrbl")
|
||||
(require+provide "image-snip-class.scrbl")
|
||||
(require+provide "keymap-class.scrbl")
|
||||
(require+provide "mult-color-intf.scrbl")
|
||||
(require+provide "pasteboard-class.scrbl")
|
||||
(require+provide "readable-snip-intf.scrbl")
|
||||
(require+provide "snip-class.scrbl")
|
||||
(require+provide "snip-admin-class.scrbl")
|
||||
(require+provide "snip-class-class.scrbl")
|
||||
(require+provide "snip-class-list-intf.scrbl")
|
||||
(require+provide "string-snip-class.scrbl")
|
||||
(require+provide "style-intf.scrbl")
|
||||
(require+provide "style-delta-class.scrbl")
|
||||
(require+provide "style-list-class.scrbl")
|
||||
(require+provide "tab-snip-class.scrbl")
|
||||
(require+provide "text-class.scrbl"))
|
|
@ -1,5 +1,7 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["area-container-intf.scrbl"]
|
||||
@require["subarea-intf.scrbl"]
|
||||
|
||||
@defclass[pane% object% (area-container<%> subarea<%>)]{
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["subwindow-intf.scrbl"]
|
||||
@require["area-container-window-intf.scrbl"]
|
||||
|
||||
@defclass[panel% object% (area-container-window<%> subwindow<%>)]{
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["editor-intf.scrbl"]
|
||||
|
||||
@defclass[pasteboard% object% (editor<%>)]{
|
||||
|
||||
|
@ -38,7 +39,7 @@ Selects snips without deselecting other snips. When coordinates are
|
|||
}
|
||||
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(after-delete [snip (is-a?/c snip%)])
|
||||
void?]{
|
||||
@methspec{
|
||||
|
@ -60,7 +61,7 @@ Does nothing.
|
|||
}
|
||||
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(after-insert [snip (is-a?/c snip%)]
|
||||
[before (or/c (is-a?/c snip%) false/c)]
|
||||
[x real?]
|
||||
|
@ -86,7 +87,7 @@ Does nothing.
|
|||
}
|
||||
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(after-interactive-move [event (is-a?/c mouse-event%)])
|
||||
void?]{
|
||||
@methspec{
|
||||
|
@ -108,7 +109,7 @@ Does nothing.
|
|||
}
|
||||
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(after-interactive-resize [snip (is-a?/c snip%)])
|
||||
void?]{
|
||||
@methspec{
|
||||
|
@ -129,7 +130,7 @@ Does nothing.
|
|||
}}
|
||||
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(after-move-to [snip (is-a?/c snip%)]
|
||||
[x real?]
|
||||
[y real?]
|
||||
|
@ -159,7 +160,7 @@ Does nothing.
|
|||
}}
|
||||
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(after-reorder [snip (is-a?/c snip%)]
|
||||
[to-snip (is-a?/c snip%)]
|
||||
[before? any/c])
|
||||
|
@ -188,7 +189,7 @@ Does nothing.
|
|||
}}
|
||||
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(after-resize [snip (is-a?/c snip%)]
|
||||
[w (and/c real? (not/c negative?))]
|
||||
[h (and/c real? (not/c negative?))]
|
||||
|
@ -218,7 +219,7 @@ Does nothing.
|
|||
}}
|
||||
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(after-select [snip (is-a?/c snip%)]
|
||||
[on? any/c])
|
||||
void?]{
|
||||
|
@ -246,7 +247,7 @@ Does nothing.
|
|||
}}
|
||||
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(can-delete? [snip (is-a?/c snip%)])
|
||||
boolean?]{
|
||||
|
||||
|
@ -270,7 +271,7 @@ Returns @scheme[#t].
|
|||
}
|
||||
}
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(can-insert? [snip (is-a?/c snip%)]
|
||||
[before (or/c (is-a?/c snip%) false/c)]
|
||||
[x real?]
|
||||
|
@ -297,7 +298,7 @@ Returns @scheme[#t].
|
|||
}
|
||||
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(can-interactive-move? [event (is-a?/c mouse-event%)])
|
||||
boolean?]{
|
||||
|
||||
|
@ -322,7 +323,7 @@ Returns @scheme[#t].
|
|||
}}
|
||||
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(can-interactive-resize? [snip (is-a?/c snip%)])
|
||||
boolean?]{
|
||||
@methspec{
|
||||
|
@ -346,7 +347,7 @@ Returns @scheme[#t].
|
|||
}}
|
||||
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(can-move-to? [snip (is-a?/c snip%)]
|
||||
[x real?]
|
||||
[y real?]
|
||||
|
@ -374,7 +375,7 @@ Returns @scheme[#t].
|
|||
}}
|
||||
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(can-reorder? [snip (is-a?/c snip%)]
|
||||
[to-snip (is-a?/c snip%)]
|
||||
[before? any/c])
|
||||
|
@ -403,7 +404,7 @@ Returns @scheme[#t].
|
|||
}}
|
||||
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(can-resize? [snip (is-a?/c snip%)]
|
||||
[w (and/c real? (not/c negative?))]
|
||||
[h (and/c real? (not/c negative?))])
|
||||
|
@ -427,7 +428,7 @@ Returns @scheme[#t].
|
|||
|
||||
}}
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(can-select? [snip (is-a?/c snip%)]
|
||||
[on? any/c])
|
||||
boolean?]{
|
||||
|
@ -456,28 +457,29 @@ Returns @scheme[#t].
|
|||
}}
|
||||
|
||||
|
||||
@defmethod*[#:mode 'add
|
||||
@defmethod*[#:mode override
|
||||
([(change-style [style (or/c (is-a?/c style<%>) false/c)]
|
||||
[snip (or/c (is-a?/c snip%) false/c) #f])
|
||||
void?]
|
||||
[(change-style [delta (or/c (is-a?/c style-delta%) false/c)]
|
||||
[snip (is-a?/c snip%)])
|
||||
[snip (is-a?/c snip%) #f])
|
||||
void?])]{
|
||||
|
||||
Changes the style of @scheme[style] to a specific style or by applying
|
||||
a style delta. If @scheme[snip] is @scheme[#f], then all currently
|
||||
selected snips are changed.
|
||||
selected snips are changed. See also @xmethod[editor<%> change-style].
|
||||
|
||||
When a @scheme[style] is provided: @InStyleListNote[]
|
||||
|
||||
}
|
||||
|
||||
|
||||
@defmethod[#:mode 'auto-super
|
||||
@defmethod[#:mode override
|
||||
(copy-self-to [dest (or/c (is-a?/c text%) (is-a?/c pasteboard%))])
|
||||
void?]{
|
||||
|
||||
The dragability, selection visibility state, and scroll step of
|
||||
In addition to the default @xmethod[editor<%> copy-self-to] work, the
|
||||
dragability, selection visibility state, and scroll step of
|
||||
@this-obj[] are installed into @scheme[dest].
|
||||
|
||||
}
|
||||
|
@ -648,8 +650,10 @@ Returns whether selection dots are drawn around the edge of selected
|
|||
}
|
||||
|
||||
|
||||
@defmethod*[#:mode 'add
|
||||
([(insert [snip (is-a?/c snip%)]
|
||||
@defmethod*[#:mode extend
|
||||
([(insert [snip (is-a?/c snip%)])
|
||||
void?]
|
||||
[(insert [snip (is-a?/c snip%)]
|
||||
[before (or/c (is-a?/c snip%) false/c)]
|
||||
[x real?]
|
||||
[y real?])
|
||||
|
@ -666,7 +670,8 @@ Inserts @scheme[snip] at @techlink{location} @math{(@scheme[x],
|
|||
@scheme[y])} just in front of
|
||||
@scheme[before]. (@|seesniporderdiscuss|) If @scheme[before] is nor
|
||||
provided or is @scheme[#f], then @scheme[snip] is inserted behind all
|
||||
other snips.
|
||||
other snips. If @scheme[x] and @scheme[y] are not provided, the snip
|
||||
is added at @math{(0, 0)}.
|
||||
|
||||
}
|
||||
|
||||
|
@ -802,7 +807,7 @@ Deselects all selected snips in the editor.
|
|||
}
|
||||
|
||||
|
||||
@defmethod[#:mode 'override
|
||||
@defmethod[#:mode override
|
||||
(on-default-event [event (is-a?/c mouse-event%)])
|
||||
void?]{
|
||||
|
||||
|
@ -831,7 +836,7 @@ object.}
|
|||
}
|
||||
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(on-delete [snip (is-a?/c snip%)])
|
||||
void?]{
|
||||
|
||||
|
@ -865,7 +870,7 @@ If @scheme[snip] accepts events, it is designated as the caret owner
|
|||
}}
|
||||
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(on-insert [snip (is-a?/c snip%)]
|
||||
[before (or/c (is-a?/c snip%) false/c)]
|
||||
[x real?]
|
||||
|
@ -885,7 +890,7 @@ The editor is internally locked for writing when this method is called
|
|||
}
|
||||
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(on-interactive-move [event (is-a?/c mouse-event%)])
|
||||
void?]{
|
||||
@methspec{
|
||||
|
@ -908,7 +913,7 @@ Does nothing.
|
|||
|
||||
}}
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(on-interactive-resize [snip (is-a?/c snip%)])
|
||||
void?]{
|
||||
@methspec{
|
||||
|
@ -930,7 +935,7 @@ Does nothing.
|
|||
}}
|
||||
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(on-move-to [snip (is-a?/c snip%)]
|
||||
[x real?]
|
||||
[y real?]
|
||||
|
@ -960,7 +965,7 @@ Does nothing.
|
|||
}}
|
||||
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(on-reorder [snip (is-a?/c snip%)]
|
||||
[to-snip (is-a?/c snip%)]
|
||||
[before? any/c])
|
||||
|
@ -987,7 +992,7 @@ Does nothing.
|
|||
|
||||
}}
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(on-resize [snip (is-a?/c snip%)]
|
||||
[w (and/c real? (not/c negative?))]
|
||||
[h (and/c real? (not/c negative?))])
|
||||
|
@ -1016,7 +1021,7 @@ Does nothing.
|
|||
}}
|
||||
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(on-select [snip (is-a?/c snip%)]
|
||||
[on? any/c])
|
||||
void?]{
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["menu-item-container-intf.scrbl"]
|
||||
|
||||
@defclass[popup-menu% object% (menu-item-container<%>)]{
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["dc-intf.scrbl"]
|
||||
|
||||
@defclass[post-script-dc% object% (dc<%>)]{
|
||||
|
||||
|
|
85
collects/scribblings/gui/prefs.scrbl
Normal file
85
collects/scribblings/gui/prefs.scrbl
Normal file
|
@ -0,0 +1,85 @@
|
|||
#reader(lib "docreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
|
||||
@title[#:tag "mr:mredprefs"]{Preferences}
|
||||
|
||||
MrEd supports a number of preferences for global configuration. The
|
||||
MrEd preferences are stored in the common file reported by
|
||||
@scheme[find-system-path] for @indexed-scheme['pref-file], and
|
||||
preference values can be retrieved and changed through
|
||||
@scheme[get-preference] and @scheme[set-preference]. However, MrEd
|
||||
reads most preferences once at startup (all except the
|
||||
@Resource{playcmd}).
|
||||
|
||||
The following are the (case-sensitive) preference names used by MrEd:
|
||||
|
||||
@itemize{
|
||||
|
||||
@item{@ResourceFirst{default-font-size} --- sets the default font size
|
||||
the basic style in a style list, and thus the default font size for
|
||||
an editor.}
|
||||
|
||||
@item{@ResourceFirst{controlFontSize} --- sets the font size for
|
||||
control and menu labels (Windows, X); the font is the @scheme['system]
|
||||
font, which can be configured as described in
|
||||
@secref["mr:fontresources"].}
|
||||
|
||||
@item{@ResourceFirst{defaultMenuPrefix} --- sets the prefix used by
|
||||
default for menu item shortcuts under X, one of @scheme['ctl],
|
||||
@scheme['meta], or @scheme['alt]. The default is
|
||||
@scheme['ctl]. When this preference is set to @scheme['meta] or
|
||||
@scheme['alt], underlined mnemonics (introduced by @litchar{&} in menu
|
||||
labels) are suppressed.}
|
||||
|
||||
@item{@ResourceFirst{altUpSelectsMenu} --- a true value makes
|
||||
pressing and releasing the Alt key select the first menu in the menu
|
||||
bar under X.}
|
||||
|
||||
@item{@ResourceFirst{emacsUndo} --- a true value makes undo in
|
||||
editors work as in Emacs (i.e., undo operations are themselves kept
|
||||
in the undo stack).}
|
||||
|
||||
@item{@ResourceFirst{hiliteColor} --- a string to sets the color for
|
||||
highlighting text, menus, and other GUI elements under X; the
|
||||
preference string should contain six hexadecimal digits, two for each
|
||||
component of the color. For example, set @Resource{hiliteColor} to
|
||||
@scheme["0000A0"] and set @Resource{hiliteMenuBorder} to @scheme[#t]
|
||||
for a Bluecurve-like look.}
|
||||
|
||||
@item{@ResourceFirst{hiliteMenuBorder} --- a true value causes a menu
|
||||
selection to be highlighted with a border (in addition to a color) under
|
||||
X.}
|
||||
|
||||
@item{@ResourceFirst{wheelStep} --- sets the default mouse-wheel step
|
||||
size of @scheme[editor-canvas%] objects.}
|
||||
|
||||
@item{@ResourceFirst{outlineInactiveSelection} --- a true value
|
||||
causes selections in text editors to be shown with an outline of the
|
||||
selected region when the editor does no have the keyboard focus.}
|
||||
|
||||
@item{@ResourceFirst{playcmd} --- used to format a sound-playing
|
||||
command; see @scheme[play-sound] for details.}
|
||||
|
||||
@item{@ResourceFirst{forceFocus} --- a true value enables extra
|
||||
effort in MrEd to move the focus to a top-level window that is shown
|
||||
or raised.}
|
||||
|
||||
@item{@ResourceFirst{doubleClickTime} --- overrides the
|
||||
platform-specific default interval (in milliseconds) for double-click
|
||||
events.}
|
||||
|
||||
@item{@ResourceFirst{gamma} --- sets the gamma value used in
|
||||
gamma-correcting PNG files.}
|
||||
|
||||
@item{@ResourceFirst{selectionAsClipboard} --- under X, a true value
|
||||
causes @scheme[the-clipboard] to be an alias to
|
||||
@scheme[the-x-selection-clipboard], which means that cut and paste
|
||||
operations use the X selection instead of the X clipboard. See also
|
||||
@scheme[clipboard<%>].}
|
||||
|
||||
|
||||
}
|
||||
|
||||
In addition, preference names built from font face names can provide
|
||||
or override default entries for the @scheme[font-name-directory<%>];
|
||||
see @secref["mr:fontresources"] for information.
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["dc-intf.scrbl"]
|
||||
|
||||
@defclass[printer-dc% object% (dc<%>)]{
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["control-intf.scrbl"]
|
||||
|
||||
@defclass[radio-box% object% (control<%>)]{
|
||||
|
||||
|
@ -72,7 +73,7 @@ By default, the first radio button is initially selected. If
|
|||
}
|
||||
|
||||
|
||||
@defmethod*[#:mode 'override
|
||||
@defmethod*[#:mode override
|
||||
([(enable [enable? any/c])
|
||||
void?]
|
||||
[(enable [n nonnegative-exact-integer?]
|
||||
|
@ -122,7 +123,7 @@ numbered from @scheme[0].
|
|||
|
||||
}
|
||||
|
||||
@defmethod*[#:mode 'override
|
||||
@defmethod*[#:mode override
|
||||
([(is-enabled?)
|
||||
boolean?]
|
||||
[(is-enabled? [n nonnegative-exact-integer?])
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["event-class.scrbl"]
|
||||
|
||||
@defclass[scroll-event% event% ()]{
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["labelled-menu-item-intf.scrbl"]
|
||||
|
||||
@definterface[selectable-menu-item<%> (labelled-menu-item<%>)]{
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["menu-item-intf.scrbl"]
|
||||
|
||||
@defclass[separator-menu-item% object% (menu-item<%>)]{
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["control-intf.scrbl"]
|
||||
|
||||
@defclass[slider% object% (control<%>)]{
|
||||
|
||||
|
|
|
@ -117,7 +117,7 @@ The drawing context and snip's @techlink{location}s in drawing context
|
|||
}
|
||||
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(can-do-edit-operation? [op (one-of/c 'undo 'redo 'clear 'cut 'copy
|
||||
'paste 'kill 'select-all
|
||||
'insert-text-box 'insert-pasteboard-box
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["snip-class.scrbl"]
|
||||
|
||||
@defclass[string-snip% snip% ()]{
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["area-intf.scrbl"]
|
||||
|
||||
@definterface[subarea<%> (area<%>)]{
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["window-intf.scrbl"]
|
||||
@require["subarea-intf.scrbl"]
|
||||
|
||||
@definterface[subwindow<%> (subarea<%> window<%>)]{
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["vertical-panel-class.scrbl"]
|
||||
|
||||
@defclass[tab-panel% vertical-panel% ()]{
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["string-snip-class.scrbl"]
|
||||
|
||||
@defclass[tab-snip% string-snip% ()]{
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
|
||||
@require["editor-intf.scrbl"]
|
||||
|
||||
@defclass[text% object% (editor<%>)]{
|
||||
|
||||
A @scheme[text%] object is a standard text editor. A text editor is
|
||||
|
@ -32,7 +34,7 @@ A new @scheme[style-list%] object is created for the new editor. See
|
|||
}
|
||||
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(after-change-style [start nonnegative-exact-integer?]
|
||||
[len nonnegative-exact-integer?])
|
||||
void?]{
|
||||
|
@ -55,7 +57,7 @@ Does nothing.
|
|||
|
||||
}}
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(after-delete [start nonnegative-exact-integer?]
|
||||
[len nonnegative-exact-integer?])
|
||||
void?]{
|
||||
|
@ -83,7 +85,7 @@ Does nothing.
|
|||
|
||||
}}
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(after-insert [start nonnegative-exact-integer?]
|
||||
[len nonnegative-exact-integer?])
|
||||
void?]{
|
||||
|
@ -110,7 +112,7 @@ Does nothing.
|
|||
|
||||
}}
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(after-merge-snips [pos nonnegative-exact-integer?])
|
||||
void?]{
|
||||
@methspec{
|
||||
|
@ -131,7 +133,7 @@ Does nothing.
|
|||
|
||||
}}
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(after-set-position)
|
||||
void?]{
|
||||
|
||||
|
@ -150,7 +152,7 @@ Does nothing.
|
|||
|
||||
}}
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(after-set-size-constraint)
|
||||
void?]{
|
||||
|
||||
|
@ -176,7 +178,7 @@ Does nothing.
|
|||
}}
|
||||
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(after-split-snip [pos nonnegative-exact-integer?])
|
||||
void?]{
|
||||
@methspec{
|
||||
|
@ -205,7 +207,7 @@ Simulates a user click that invokes a clickback, if the given range of
|
|||
|
||||
}
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(can-change-style? [start nonnegative-exact-integer?]
|
||||
[len nonnegative-exact-integer?])
|
||||
boolean?]{
|
||||
|
@ -231,7 +233,7 @@ Returns @scheme[#t].
|
|||
}
|
||||
}
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(can-delete? [start nonnegative-exact-integer?]
|
||||
[len nonnegative-exact-integer?])
|
||||
boolean?]{
|
||||
|
@ -260,7 +262,7 @@ Returns @scheme[#t].
|
|||
|
||||
}}
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(can-insert? [start nonnegative-exact-integer?]
|
||||
[len nonnegative-exact-integer?])
|
||||
boolean?]{
|
||||
|
@ -288,7 +290,7 @@ Returns @scheme[#t].
|
|||
}}
|
||||
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(can-set-size-constraint?)
|
||||
boolean?]{
|
||||
|
||||
|
@ -323,9 +325,9 @@ See also @method[text% hide-caret].
|
|||
}
|
||||
|
||||
|
||||
@defmethod*[#:mode 'add
|
||||
@defmethod*[#:mode extend
|
||||
([(change-style [delta (or/c (is-a?/c style-delta%) false/c)]
|
||||
[start (or/c nonnegative-exact-integer? (one/of 'start))]
|
||||
[start (or/c nonnegative-exact-integer? (one/of 'start)) 'start]
|
||||
[end (or/c nonnegative-exact-integer? (one/of 'end)) 'end]
|
||||
[counts-as-mod? any/c @scheme[#t]])
|
||||
void?]
|
||||
|
@ -349,10 +351,10 @@ When @scheme[style] is provided: @InStyleListNote[]
|
|||
}
|
||||
|
||||
|
||||
@defmethod[#:mode 'add
|
||||
@defmethod[#:mode extend
|
||||
(copy [extend? any/c]
|
||||
[time (and/c exact? integer?)]
|
||||
[start (or/c nonnegative-exact-integer? (one/of 'start))]
|
||||
[start (or/c nonnegative-exact-integer? (one/of 'start)) 'start]
|
||||
[end (or/c nonnegative-exact-integer? (one/of 'end)) 'end])
|
||||
void?]{
|
||||
|
||||
|
@ -365,25 +367,25 @@ See @|timediscuss| for a discussion of the @scheme[time] argument. If
|
|||
@scheme[time] is outside the platform-specific range of times,
|
||||
@|MismatchExn|.
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@defmethod[#:mode 'auto-super
|
||||
@defmethod[#:mode override
|
||||
(copy-self-to [dest (or/c (is-a?/c text%) (is-a?/c pasteboard%))])
|
||||
void?]{
|
||||
|
||||
This editor's file format, wordbreak function, wordbreak map,
|
||||
In addition to the default @xmethod[editor<%> copy-self-to] work,
|
||||
this editor's file format, wordbreak function, wordbreak map,
|
||||
click-between-threshold, caret visibility state, overwrite mode
|
||||
state, and autowrap bitmap are installed into @scheme[dest].
|
||||
|
||||
}
|
||||
|
||||
|
||||
@defmethod[#:mode 'add
|
||||
@defmethod[#:mode override
|
||||
(cut [extend? any/c]
|
||||
[time (and/c exact? integer?)]
|
||||
[start (or/c nonnegative-exact-integer? (one/of 'start))]
|
||||
[start (or/c nonnegative-exact-integer? (one/of 'start)) 'start]
|
||||
[end (or/c nonnegative-exact-integer? (one/of 'end)) 'end])
|
||||
void?]{
|
||||
|
||||
|
@ -1027,7 +1029,7 @@ See also @method[text% caret-hidden?] and @method[editor<%> lock].
|
|||
}
|
||||
|
||||
|
||||
@defmethod*[#:mode 'override
|
||||
@defmethod*[#:mode override
|
||||
([(insert [str string?]
|
||||
[start nonnegative-exact-integer?]
|
||||
[end (or/c nonnegative-exact-integer? (one/of 'same)) 'same]
|
||||
|
@ -1094,13 +1096,18 @@ See also @method[text% get-styles-sticky].
|
|||
}
|
||||
|
||||
|
||||
@defmethod[#:mode 'add
|
||||
(kill [time (and/c exact? integer?)]
|
||||
[start nonnegative-exact-integer?]
|
||||
[end nonnegative-exact-integer?])
|
||||
void?]{
|
||||
@defmethod*[#:mode override
|
||||
([(kill [time (and/c exact? integer?) 0])
|
||||
void?]
|
||||
[(kill [time (and/c exact? integer?)]
|
||||
[start nonnegative-exact-integer?]
|
||||
[end nonnegative-exact-integer?])
|
||||
void?])]{
|
||||
|
||||
Cuts the text in the given region.
|
||||
Cuts the text in the given region. If @scheme[start] and @scheme[end]
|
||||
are not supplied, then the selected region plus all whitespace to the
|
||||
end of line is cut; the newline is also cut if only whitespace exists
|
||||
between the selection and the end of line.
|
||||
|
||||
See @|timediscuss| for a discussion of the @scheme[time] argument. If
|
||||
@scheme[time] is outside the platform-specific range of times,
|
||||
|
@ -1276,7 +1283,7 @@ See also @method[text% set-position].
|
|||
}
|
||||
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(on-change-style [start nonnegative-exact-integer?]
|
||||
[len nonnegative-exact-integer?])
|
||||
void?]{
|
||||
|
@ -1303,7 +1310,7 @@ Does nothing.
|
|||
}
|
||||
|
||||
|
||||
@defmethod[#:mode 'override
|
||||
@defmethod[#:mode override
|
||||
(on-default-char [event (is-a?/c key-event%)])
|
||||
void?]{
|
||||
|
||||
|
@ -1329,7 +1336,7 @@ Note that an editor's @scheme[editor-canvas%] normally handles mouse
|
|||
}
|
||||
|
||||
|
||||
@defmethod[#:mode 'override
|
||||
@defmethod[#:mode override
|
||||
(on-default-event [event (is-a?/c mouse-event%)])
|
||||
void?]{
|
||||
|
||||
|
@ -1354,7 +1361,7 @@ Tracks clicks on a clickback (see @method[text% set-clickback]) of
|
|||
}
|
||||
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(on-delete [start nonnegative-exact-integer?]
|
||||
[len nonnegative-exact-integer?])
|
||||
void?]{
|
||||
|
@ -1385,7 +1392,7 @@ Does nothing.
|
|||
}}
|
||||
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(on-insert [start nonnegative-exact-integer?]
|
||||
[len nonnegative-exact-integer?])
|
||||
void?]{
|
||||
|
@ -1448,7 +1455,7 @@ Returns a @scheme[tab-snip%] instance.
|
|||
}}
|
||||
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(on-set-size-constraint)
|
||||
void?]{
|
||||
|
||||
|
@ -1526,9 +1533,9 @@ If the paragraph starts with invisible @techlink{item}s and @scheme[visible?] is
|
|||
}
|
||||
|
||||
|
||||
@defmethod[#:mode 'add
|
||||
@defmethod[#:mode override
|
||||
(paste [time (and/c exact? integer?)]
|
||||
[start (or/c nonnegative-exact-integer? (one/of 'end))]
|
||||
[start (or/c nonnegative-exact-integer? (one/of 'end)) 'end]
|
||||
[end (or/c nonnegative-exact-integer? (one/of 'same)) 'same])
|
||||
void?]{
|
||||
|
||||
|
@ -1564,9 +1571,9 @@ If the previous operation on the editor was not a paste, calling
|
|||
}
|
||||
|
||||
|
||||
@defmethod[#:mode 'add
|
||||
@defmethod[#:mode override
|
||||
(paste-x-selection [time (and/c exact? integer?)]
|
||||
[start (or/c nonnegative-exact-integer? (one/of 'end))]
|
||||
[start (or/c nonnegative-exact-integer? (one/of 'end)) 'end]
|
||||
[end (or/c nonnegative-exact-integer? (one/of 'same)) 'same])
|
||||
void?]{
|
||||
|
||||
|
@ -1637,7 +1644,7 @@ Returns the paragraph number of the paragraph containing a given @techlink{posit
|
|||
}
|
||||
|
||||
|
||||
@defmethod[#:mode 'add
|
||||
@defmethod[#:mode extend
|
||||
(read-from-file [stream (is-a?/c editor-stream-in%)]
|
||||
[start (or/c nonnegative-exact-integer? (one/of 'start))]
|
||||
[overwrite-styles? any/c #t])
|
||||
|
@ -2020,9 +2027,9 @@ Splitting a snip is disallowed when the editor is internally locked
|
|||
}
|
||||
|
||||
|
||||
@defmethod[#:mode 'add
|
||||
@defmethod[#:mode extend
|
||||
(write-to-file [stream (is-a?/c editor-stream-out%)]
|
||||
[start nonnegative-exact-integer?]
|
||||
[start nonnegative-exact-integer? 0]
|
||||
[end (or/c nonnegative-exact-integer? (one/of 'eof)) 'eof])
|
||||
boolean?]{
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["control-intf.scrbl"]
|
||||
|
||||
@defclass[text-field% object% (control<%>)]{
|
||||
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["area-container-window-intf.scrbl"]
|
||||
|
||||
@definterface[top-level-window<%> (area-container-window<%>)]{
|
||||
|
||||
A top-level window is either a @scheme[frame%] or @scheme[dialog%]
|
||||
object.
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(can-close?)
|
||||
boolean?]{
|
||||
|
||||
|
@ -135,7 +136,7 @@ The method's argument is @scheme[#t] when the window is activated,
|
|||
|
||||
}
|
||||
|
||||
@defmethod[#:mode 'pubment
|
||||
@defmethod[#:mode pubment
|
||||
(on-close)
|
||||
void?]{
|
||||
|
||||
|
@ -312,12 +313,13 @@ Sets the size of the window (in pixels), but only if the given size is
|
|||
|
||||
}
|
||||
|
||||
@defmethod[#:mode 'auto-super
|
||||
(show [show any/c])
|
||||
@defmethod[(show [show any/c])
|
||||
void?]{
|
||||
|
||||
If the window is already shown, it is moved front of other top-level
|
||||
windows. If the window is iconized (frames only), it is deiconized.
|
||||
|
||||
See also @xmethod[window<%> show].
|
||||
|
||||
}}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["pane-class.scrbl"]
|
||||
|
||||
@defclass[vertical-pane% pane% ()]{
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["panel-class.scrbl"]
|
||||
|
||||
@defclass[vertical-panel% panel% ()]{
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#reader(lib "docreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["diagrams.ss"]
|
||||
@require["mred-classes.ss"]
|
||||
|
||||
@title[#:style '(toc quiet)]{Windowing Classes}
|
||||
|
||||
|
@ -20,58 +21,6 @@ Alphabetical:
|
|||
|
||||
@local-table-of-contents[]
|
||||
|
||||
@require["area-intf.scrbl"]
|
||||
@require["area-container-intf.scrbl"]
|
||||
@require["area-container-window-intf.scrbl"]
|
||||
@require["button-class.scrbl"]
|
||||
@require["canvas-intf.scrbl"]
|
||||
@require["canvas-class.scrbl"]
|
||||
@require["check-box-class.scrbl"]
|
||||
@require["checkable-menu-item-class.scrbl"]
|
||||
@require["choice-class.scrbl"]
|
||||
@require["clipboard-client-class.scrbl"]
|
||||
@require["clipboard-intf.scrbl"]
|
||||
@require["combo-field-class.scrbl"]
|
||||
@require["control-intf.scrbl"]
|
||||
@require["control-event-class.scrbl"]
|
||||
@require["cursor-class.scrbl"]
|
||||
@require["dialog-class.scrbl"]
|
||||
@require["event-class.scrbl"]
|
||||
@require["frame-class.scrbl"]
|
||||
@require["gauge-class.scrbl"]
|
||||
@require["group-box-panel-class.scrbl"]
|
||||
@require["grow-box-spacer-pane-class.scrbl"]
|
||||
@require["horizontal-pane-class.scrbl"]
|
||||
@require["horizontal-panel-class.scrbl"]
|
||||
@require["key-event-class.scrbl"]
|
||||
@require["labelled-menu-item-intf.scrbl"]
|
||||
@require["list-box-class.scrbl"]
|
||||
@require["list-control-intf.scrbl"]
|
||||
@require["menu-class.scrbl"]
|
||||
@require["menu-bar-class.scrbl"]
|
||||
@require["menu-item-intf.scrbl"]
|
||||
@require["menu-item-class.scrbl"]
|
||||
@require["menu-item-container-intf.scrbl"]
|
||||
@require["message-class.scrbl"]
|
||||
@require["mouse-event-class.scrbl"]
|
||||
@require["pane-class.scrbl"]
|
||||
@require["panel-class.scrbl"]
|
||||
@require["popup-menu-class.scrbl"]
|
||||
@require["radio-box-class.scrbl"]
|
||||
@require["selectable-menu-item-intf.scrbl"]
|
||||
@require["separator-menu-item-class.scrbl"]
|
||||
@require["scroll-event-class.scrbl"]
|
||||
@require["slider-class.scrbl"]
|
||||
@require["subarea-intf.scrbl"]
|
||||
@require["subwindow-intf.scrbl"]
|
||||
@require["tab-panel-class.scrbl"]
|
||||
@require["text-field-class.scrbl"]
|
||||
@require["timer-class.scrbl"]
|
||||
@require["top-level-window-intf.scrbl"]
|
||||
@require["vertical-pane-class.scrbl"]
|
||||
@require["vertical-panel-class.scrbl"]
|
||||
@require["window-intf.scrbl"]
|
||||
|
||||
@include-class[area<%>]
|
||||
@include-class[area-container<%>]
|
||||
@include-class[area-container-window<%>]
|
||||
|
|
|
@ -180,7 +180,7 @@ The fundamental graphical element in MrEd's windowing toolbox is an
|
|||
@item{@scheme[editor-canvas%] --- an @deftech{editor canvas} is a
|
||||
subwindow for displaying a text editor or pasteboard editor. The
|
||||
@scheme[editor-canvas%] class is documented with the editor classes
|
||||
in @secref["mr:editoredit"].}
|
||||
in @secref["mr:editor-overview"].}
|
||||
|
||||
@item{@deftech{Controls} --- containees that the user can manipulate:
|
||||
|
||||
|
@ -700,7 +700,7 @@ Controls, such as buttons and list boxes, handle keyboard and mouse
|
|||
|
||||
@section[#:tag "mr:eventspaceinfo"]{Event Dispatching and Eventspaces}
|
||||
|
||||
@section-index['("events" "dispatching")]
|
||||
@section-index["events" "dispatching"]
|
||||
|
||||
A graphical user interface is an inherently multi-threaded system: one
|
||||
thread is the program managing windows on the screen, and the other
|
||||
|
@ -770,15 +770,15 @@ In MrEd, an @deftech{eventspace} is a context for processing GUI
|
|||
|
||||
@subsection{Event Types and Priorities}
|
||||
|
||||
@section-index['("events" "timer")]
|
||||
@section-index['("events" "explicitly queued")]
|
||||
@section-index["events" "timer"]
|
||||
@section-index["events" "explicitly queued"]
|
||||
|
||||
In addition to events corresponding to user and windowing actions,
|
||||
such as button clicks, key presses, and updates, the system
|
||||
dispatches two kinds of internal events: @tech{timer events} and
|
||||
@tech{explicitly queued events}.
|
||||
|
||||
@tech{Timer events} are created by instances of @scheme[timer%]. When
|
||||
@deftech{Timer events} are created by instances of @scheme[timer%]. When
|
||||
a timer is started and then expires, the timer queues an event to
|
||||
call the timer's @method[timer% notify] method. Like a top-level
|
||||
window, each timer is associated with a particular eventspace (the
|
||||
|
@ -786,7 +786,7 @@ In addition to events corresponding to user and windowing actions,
|
|||
@secref["mr:currenteventspace"]) when it is created, and the timer
|
||||
queues the event in its eventspace.
|
||||
|
||||
@deftech{Explicitly queued} events are created with
|
||||
@deftech{Explicitly queued events} are created with
|
||||
@scheme[queue-callback], which accepts a callback procedure to handle
|
||||
the event. The event is enqueued in the current eventspace at the
|
||||
time of the call to @scheme[queue-callback], with either a high or
|
||||
|
@ -843,11 +843,8 @@ When a handler thread shows a dialog, the dialog's @method[dialog%
|
|||
@subsection[#:tag "mr:currenteventspace"]{Creating and Setting the Eventspace}
|
||||
|
||||
Whenever a frame, dialog, or timer is created, it is associated with
|
||||
the eventspace specified by the @scheme[current-eventspace] parameter
|
||||
@|SeeMzParam|. When the @scheme[current-eventspace] procedure is
|
||||
called with no arguments, it returns the current eventspace value.
|
||||
When @scheme[current-eventspace] is called with an eventspace value,
|
||||
it changes the current eventspace to the provided one.
|
||||
the @deftech{current eventspace} as determined by the
|
||||
@scheme[current-eventspace] parameter @|SeeMzParam|.
|
||||
|
||||
The @scheme[make-eventspace] procedure creates a new
|
||||
eventspace. The following example creates a new eventspace and a new
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#reader(lib "defreader.ss" "scribble")
|
||||
@require["common.ss"]
|
||||
@require["area-intf.scrbl"]
|
||||
|
||||
@definterface[window<%> (area<%>)]{
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user