A ton of @scheme*' ->
@racket*' and related updates.
Also, updates some of the mzlib files to point at `racket/*' libraries rather than to `scheme/*' ones. original commit: ac26fe75546b5182d78f18c2cd882f0f440849e2
This commit is contained in:
parent
f993ab43fd
commit
ec12cbefed
|
@ -3,4 +3,4 @@
|
|||
|
||||
@defclass/title[aligned-pasteboard% pasteboard% (alignment-parent<%>)]{
|
||||
|
||||
Acts as the top of an @scheme[alignment<%>] tree.}
|
||||
Acts as the top of an @racket[alignment<%>] tree.}
|
||||
|
|
|
@ -16,7 +16,7 @@ Tells the alignment that its sizes should be calculated.}
|
|||
[width (and/c real? (not/c negative?))]
|
||||
[height (and/c real? (not/c negative?))]) void?]{
|
||||
Tells itself to align its children on the pasteboard
|
||||
in the given rectangle defined by @scheme[width], @scheme[height] and a top
|
||||
in the given rectangle defined by @racket[width], @racket[height] and a top
|
||||
left corner point given as offsets into the pasteboards top
|
||||
left corner.}
|
||||
|
||||
|
@ -30,7 +30,7 @@ The minimum height this alignment must be.}
|
|||
|
||||
@defmethod*[([(stretchable-width) boolean?]
|
||||
[(stretchable-width [value boolean?]) void?])]{
|
||||
|
||||
|
||||
Gets/sets the property of stretchability in the x dimension.}
|
||||
|
||||
@defmethod*[([(stretchable-height) boolean?]
|
||||
|
|
|
@ -8,11 +8,11 @@ A clickable button with a bitmap label.
|
|||
@defconstructor[([images (cons/c path-string? path-string?)]
|
||||
[callback ((is-a?/c button-snip%) (is-a?/c event%) . -> . void?)])]{
|
||||
|
||||
The @scheme[images] argument is a pair filenames to be load as the
|
||||
The @racket[images] argument is a pair filenames to be load as the
|
||||
button-label image, where the first is the image for when the button
|
||||
is at rest, and the second is the image for the button while its
|
||||
pressed.
|
||||
|
||||
The @scheme[callback] is called when the button is clicked.}
|
||||
The @racket[callback] is called when the button is clicked.}
|
||||
|
||||
}
|
||||
|
|
|
@ -17,12 +17,12 @@ Gets/sets the previous item in the list.}
|
|||
|
||||
@defmethod[(for-each [f ((is-a?/c dllist<%>) . -> . void?)]) void?]{
|
||||
|
||||
Applies @scheme[f] to every element of the dllist.}
|
||||
Applies @racket[f] to every element of the dllist.}
|
||||
|
||||
@defmethod[(map-to-list [f ((is-a?/c dllist<%>) . -> . any/c)])
|
||||
(listof any/c)]{
|
||||
|
||||
Creates a Scheme list by applying @scheme[f] to every element
|
||||
Creates a Scheme list by applying @racket[f] to every element
|
||||
of @this-obj[].}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,11 +8,11 @@ A clickable button with a bitmap label.
|
|||
@defconstructor[([images (cons/c path-string? path-string?)]
|
||||
[callback ((is-a?/c button-snip%) (is-a?/c event%) . -> . void?)])]{
|
||||
|
||||
The @scheme[images] argument is a pair filenames to be load as the
|
||||
The @racket[images] argument is a pair filenames to be load as the
|
||||
button-label image, where the first is the image for when the button
|
||||
is at rest, and the second is the image for the button while its
|
||||
pressed.
|
||||
|
||||
The @scheme[callback] is called when the button is clicked.}
|
||||
The @racket[callback] is called when the button is clicked.}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
#lang scribble/doc
|
||||
@(require "common.rkt" (for-label framework))
|
||||
|
||||
@title{@bold{Embedded GUI}: Widgets within @scheme[editor<%>]}
|
||||
@title{@bold{Embedded GUI}: Widgets within @racket[editor<%>]}
|
||||
|
||||
@author["Mike T. McHenry"]
|
||||
|
||||
@defmodule[embedded-gui]
|
||||
|
||||
The @schememodname[embedded-gui] library provides a class hierarchy
|
||||
for creating graphical boxes within @scheme[editor<%>] objects with
|
||||
geometry management that mirrors that of @scheme[vertical-panel%] and
|
||||
@scheme[horizontal-panel%].
|
||||
The @racketmodname[embedded-gui] library provides a class hierarchy
|
||||
for creating graphical boxes within @racket[editor<%>] objects with
|
||||
geometry management that mirrors that of @racket[vertical-panel%] and
|
||||
@racket[horizontal-panel%].
|
||||
|
||||
@table-of-contents[]
|
||||
|
||||
|
@ -24,10 +24,10 @@ geometry management that mirrors that of @scheme[vertical-panel%] and
|
|||
|
||||
@defmixin[stretchable-editor-snip-mixin (editor-snip%) (stretchable-snip<%>)]{
|
||||
|
||||
Extends an editor snip the @scheme[stretchable-snip<%>] interface,
|
||||
Extends an editor snip the @racket[stretchable-snip<%>] interface,
|
||||
which allows it to be stretched to fit an
|
||||
@scheme[alignment-parent<%>]'s allotted width. Stretchable snips are
|
||||
useful as the snip of a @scheme[snip-wrapper%] }
|
||||
@racket[alignment-parent<%>]'s allotted width. Stretchable snips are
|
||||
useful as the snip of a @racket[snip-wrapper%] }
|
||||
|
||||
|
||||
@defclass[stretchable-editor-snip% editor-snip% (stretchable-editor-snip-mixin editor-snip%)]{
|
||||
|
@ -41,11 +41,11 @@ geometry management that mirrors that of @scheme[vertical-panel%] and
|
|||
@defproc[(fixed-width-label-snip [possible-labels (listof string?)])
|
||||
(subclass?/c snip%)]{
|
||||
|
||||
Returns a subclass of @scheme[snip%] that takes a single
|
||||
Returns a subclass of @racket[snip%] that takes a single
|
||||
initialization argument. The argument provided when instantiating the
|
||||
class must be a member of @scheme[possible-labels]; the given label
|
||||
class must be a member of @racket[possible-labels]; the given label
|
||||
is displayed by the snip, but the snip is sized to match the longest
|
||||
of the labels in @scheme[possible-labels].
|
||||
of the labels in @racket[possible-labels].
|
||||
|
||||
In other words, the resulting class helps align multiple GUI elements
|
||||
t hat are labeled from a particular set of strings.}
|
||||
|
@ -53,11 +53,11 @@ t hat are labeled from a particular set of strings.}
|
|||
|
||||
@definterface[tabbable-text<%> ()]{
|
||||
|
||||
An interface for tabbing between embedded @scheme[text%]s.
|
||||
An interface for tabbing between embedded @racket[text%]s.
|
||||
|
||||
@defmethod[(set-caret-owner) void?]{
|
||||
|
||||
Moves the caret into the @scheme[tabbable-text<%>].}
|
||||
Moves the caret into the @racket[tabbable-text<%>].}
|
||||
|
||||
@defmethod[(set-ahead) void?]{
|
||||
|
||||
|
@ -70,15 +70,15 @@ t hat are labeled from a particular set of strings.}
|
|||
|
||||
@defmixin[tabbable-text-mixin (editor:keymap<%>) (tabbable-text<%>)]{
|
||||
|
||||
Adds the @scheme[tabbable-text<%>] interface to an
|
||||
@scheme[editor:text%] class, where instantiation installs key
|
||||
Adds the @racket[tabbable-text<%>] interface to an
|
||||
@racket[editor:text%] class, where instantiation installs key
|
||||
bindings to tab ahead and backward}
|
||||
|
||||
|
||||
@defproc[(set-tabbing [a-text (is-a?/c tabbable-text<%>)] ...)
|
||||
void?]{
|
||||
|
||||
Sets the tabbing order of @scheme[tabbable-text<%>]s by setting each
|
||||
Sets the tabbing order of @racket[tabbable-text<%>]s by setting each
|
||||
text's @method[tabbable-text<%> set-ahead] and
|
||||
@method[tabbable-text<%> set-back] thunks to point to its neighbor in
|
||||
the argument list.}
|
||||
|
@ -86,13 +86,13 @@ the argument list.}
|
|||
|
||||
@defmixin[grey-editor-snip-mixin (editor-snip%) ()]{
|
||||
|
||||
Gives an @scheme[editor-snip%] a colored background indicating that
|
||||
Gives an @racket[editor-snip%] a colored background indicating that
|
||||
is disabled. The editor is not disabled by the mixin however, and
|
||||
must be locked separately.}
|
||||
|
||||
@defmixin[grey-editor-mixin (editor<%>) ()]{
|
||||
|
||||
Gives an @scheme[editor<%>] a colored background indicating that is
|
||||
Gives an @racket[editor<%>] a colored background indicating that is
|
||||
disabled. The editor is not disabled by the mixin however, and must be
|
||||
locked separately.}
|
||||
|
||||
|
@ -105,8 +105,8 @@ the argument list.}
|
|||
|
||||
@defmixin[cue-text-mixin (text%) ()]{
|
||||
|
||||
Gives a @scheme[text%] an instantiation argument of a string that is
|
||||
displayed in the @scheme[text%] initially in grey; the text
|
||||
Gives a @racket[text%] an instantiation argument of a string that is
|
||||
displayed in the @racket[text%] initially in grey; the text
|
||||
disappears when the text gets focus. This technique is useful for
|
||||
labeling texts without needing to take up space.}
|
||||
|
||||
|
|
|
@ -8,4 +8,4 @@ A static text label.
|
|||
@defconstructor[([parent (is-a?/c alignment-parent<%>)]
|
||||
[label string?])]{
|
||||
|
||||
Creates a static control that displays @scheme[label].}}
|
||||
Creates a static control that displays @racket[label].}}
|
||||
|
|
|
@ -8,6 +8,6 @@ A button with a text label.
|
|||
@defconstructor[([label string?]
|
||||
[callback ((is-a?/c text-button-snip%) (is-a?/c event%) . -> . void?)])]{
|
||||
|
||||
The @scheme[callback] is called when the button is clicked.}
|
||||
The @racket[callback] is called when the button is clicked.}
|
||||
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
@defclass/title[embedded-toggle-button% snip-wrapper% (alignment<%>)]{
|
||||
|
||||
A @scheme[check-box%]-like control that a user can toggle between
|
||||
A @racket[check-box%]-like control that a user can toggle between
|
||||
checked and unchecked states.
|
||||
|
||||
@defconstructor[([images-off (cons/c path-string? path-string?)]
|
||||
|
@ -12,17 +12,17 @@ checked and unchecked states.
|
|||
[turn-off ((is-a?/c toggle-button-snip%) (is-a?/c event%) . -> . void?)]
|
||||
[state (symbols 'on 'off) 'on])]{
|
||||
|
||||
The @scheme[images-off] argument is a pair filenames to be load as the
|
||||
The @racket[images-off] argument is a pair filenames to be load as the
|
||||
button-label image, where the first is the image for when the button
|
||||
is at rest, and the second is the image for the button while its
|
||||
pressed---in both cases when the button is not checked by the
|
||||
user. The @scheme[images-on] argument similarly determines the images
|
||||
user. The @racket[images-on] argument similarly determines the images
|
||||
for then the button is checked.
|
||||
|
||||
The @scheme[turn-on] and @scheme[turn-off] callbacks are invoked when
|
||||
The @racket[turn-on] and @racket[turn-off] callbacks are invoked when
|
||||
the button changes to checked or unchecked, respectively.
|
||||
|
||||
The @scheme[state] argument determines whether the button is initially
|
||||
The @racket[state] argument determines whether the button is initially
|
||||
checked.}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,5 +8,5 @@
|
|||
[after (or/c (is-a?/c alignment<%>) false/c) #f])]{
|
||||
|
||||
Inserts a new horizontal-alignment container into
|
||||
@scheme[parent]---optionally after a given container also in
|
||||
@scheme[parent]. The new container can be initially shown or hidden.}}
|
||||
@racket[parent]---optionally after a given container also in
|
||||
@racket[parent]. The new container can be initially shown or hidden.}}
|
||||
|
|
|
@ -28,8 +28,8 @@ The pasteboard that contains the snip.}
|
|||
[snip (is-a?/c snip%)])
|
||||
any/c]{
|
||||
|
||||
Applies @scheme[f] to all snips in the parent of @scheme[snip],
|
||||
starting with @scheme[snip].}
|
||||
Applies @racket[f] to all snips in the parent of @racket[snip],
|
||||
starting with @racket[snip].}
|
||||
|
||||
@defproc[(for-each-snip [f ((is-a?/c snip%) . -> . any/c)]
|
||||
[first-snip (is-a?/c snip%)]
|
||||
|
@ -37,9 +37,9 @@ starting with @scheme[snip].}
|
|||
void?]{
|
||||
|
||||
Applies the function to each snip in the parent of
|
||||
@scheme[first-snip], starting with @scheme[first-snip]. If
|
||||
@scheme[more] lists are supplied, they are used for extra arguments to
|
||||
@scheme[f], just like extra lists provided to @scheme[for-each].}
|
||||
@racket[first-snip], starting with @racket[first-snip]. If
|
||||
@racket[more] lists are supplied, they are used for extra arguments to
|
||||
@racket[f], just like extra lists provided to @racket[for-each].}
|
||||
|
||||
@defproc[(map-snip [f ((is-a?/c snip%) . -> . any/c)]
|
||||
[first-snip (is-a?/c snip%)]
|
||||
|
@ -47,10 +47,10 @@ Applies the function to each snip in the parent of
|
|||
void?]{
|
||||
|
||||
Applies the function to each snip in the parent of
|
||||
@scheme[first-snip], starting with @scheme[first-snip], and
|
||||
accumulates the results into a list. If @scheme[more] lists are
|
||||
supplied, they are used for extra arguments to @scheme[f], just like
|
||||
extra lists provided to @scheme[map].}
|
||||
@racket[first-snip], starting with @racket[first-snip], and
|
||||
accumulates the results into a list. If @racket[more] lists are
|
||||
supplied, they are used for extra arguments to @racket[f], just like
|
||||
extra lists provided to @racket[map].}
|
||||
|
||||
|
||||
@defproc[(stretchable-width? [snip (is-a?/c snip%)]) boolean?]{
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
|
||||
@defclass/title[snip-wrapper% dllist<%> (alignment<%>)]{
|
||||
|
||||
Adapts an arbitrary @scheme[snip<%>] to work in an alignment
|
||||
Adapts an arbitrary @racket[snip<%>] to work in an alignment
|
||||
container.
|
||||
|
||||
@defconstructor[([parent (is-a?/c alignment-parent<%>)]
|
||||
[snip (is-a?/c snip%)])]{
|
||||
|
||||
Adds @scheme[snip] to @scheme[parent].}}
|
||||
Adds @racket[snip] to @racket[parent].}}
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
@definterface/title[stretchable-snip<%> ()]{
|
||||
|
||||
Must be implemented by any snip class whose objects will be
|
||||
stretchable when inserted into an @scheme[aligned-pasteboard<%>]
|
||||
within a @scheme[snip-wrapper%].
|
||||
stretchable when inserted into an @racket[aligned-pasteboard<%>]
|
||||
within a @racket[snip-wrapper%].
|
||||
|
||||
@defmethod[(get-aligned-min-width) (and/c real? (not/c negative?))]{
|
||||
|
||||
|
|
|
@ -8,6 +8,6 @@ A button with a text label.
|
|||
@defconstructor[([label string?]
|
||||
[callback ((is-a?/c text-button-snip%) (is-a?/c event%) . -> . void)])]{
|
||||
|
||||
The @scheme[callback] is called when the button is clicked.}
|
||||
The @racket[callback] is called when the button is clicked.}
|
||||
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
@defclass/title[toggle-button-snip% snip% ()]{
|
||||
|
||||
A @scheme[check-box%]-like control that a user can toggle between
|
||||
A @racket[check-box%]-like control that a user can toggle between
|
||||
checked and unchecked states.
|
||||
|
||||
@defconstructor[([images-off (cons/c path-string? path-string?)]
|
||||
|
@ -12,17 +12,17 @@ checked and unchecked states.
|
|||
[turn-off ((is-a?/c toggle-button-snip%) (is-a?/c event%) . -> . void?)]
|
||||
[state (symbols 'on 'off) 'on])]{
|
||||
|
||||
The @scheme[images-off] argument is a pair filenames to be load as the
|
||||
The @racket[images-off] argument is a pair filenames to be load as the
|
||||
button-label image, where the first is the image for when the button
|
||||
is at rest, and the second is the image for the button while its
|
||||
pressed---in both cases when the button is not checked by the
|
||||
user. The @scheme[images-on] argument similarly determines the images
|
||||
user. The @racket[images-on] argument similarly determines the images
|
||||
for then the button is checked.
|
||||
|
||||
The @scheme[turn-on] and @scheme[turn-off] callbacks are invoked when
|
||||
The @racket[turn-on] and @racket[turn-off] callbacks are invoked when
|
||||
the button changes to checked or unchecked, respectively.
|
||||
|
||||
The @scheme[state] argument determines whether the button is initially
|
||||
The @racket[state] argument determines whether the button is initially
|
||||
checked.}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,5 +8,5 @@
|
|||
[after (or/c (is-a?/c alignment<%>) false/c) #f])]{
|
||||
|
||||
Inserts a new vertical-alignment container into
|
||||
@scheme[parent]---optionally after a given container also in
|
||||
@scheme[parent]. The new container can be initially shown or hidden.}}
|
||||
@racket[parent]---optionally after a given container also in
|
||||
@racket[parent]. The new container can be initially shown or hidden.}}
|
||||
|
|
|
@ -39,9 +39,7 @@
|
|||
;; quote-literal-label: string -> string
|
||||
(define (quote-literal-label a-str)
|
||||
(trim-string (regexp-replace* #rx"(&)" a-str "\\1\\1")
|
||||
maximum-string-label-length))
|
||||
|
||||
|
||||
maximum-string-label-length))
|
||||
|
||||
;; selected-text-color : color
|
||||
(define selected-text-color (send the-color-database find-color "black"))
|
||||
|
@ -302,7 +300,7 @@
|
|||
(λ (str)
|
||||
((string-length str) . <= . size)))])
|
||||
@{Constructs a string whose size is less
|
||||
than @scheme[size] by trimming the @scheme[str]
|
||||
than @racket[size] by trimming the @racket[str]
|
||||
and inserting an ellispses into it.})
|
||||
|
||||
(proc-doc
|
||||
|
@ -334,12 +332,12 @@
|
|||
gui-utils:cancel-on-right?
|
||||
(-> boolean?)
|
||||
()
|
||||
@{Returns @scheme[#t] if cancel should be on the right-hand side (or below)
|
||||
in a dialog and @scheme[#f] otherwise.
|
||||
@{Returns @racket[#t] if cancel should be on the right-hand side (or below)
|
||||
in a dialog and @racket[#f] otherwise.
|
||||
|
||||
Just returns what @scheme[system-position-ok-before-cancel?] does.
|
||||
Just returns what @racket[system-position-ok-before-cancel?] does.
|
||||
|
||||
See also @scheme[gui-utils:ok/cancel-buttons].})
|
||||
See also @racket[gui-utils:ok/cancel-buttons].})
|
||||
(proc-doc/names
|
||||
gui-utils:ok/cancel-buttons
|
||||
(->* ((is-a?/c area-container<%>)
|
||||
|
@ -365,12 +363,12 @@
|
|||
The first result is be the OK button and the second is
|
||||
the cancel button.
|
||||
|
||||
By default, the confirmation action button has the @scheme['(border)] style,
|
||||
By default, the confirmation action button has the @racket['(border)] style,
|
||||
meaning that hitting return in the dialog will trigger the confirmation action.
|
||||
The @racket[confirm-style] argument can override this behavior, tho.
|
||||
See @racket[button%] for the precise list of allowed styles.
|
||||
|
||||
See also @scheme[gui-utils:cancel-on-right?].})
|
||||
See also @racket[gui-utils:cancel-on-right?].})
|
||||
|
||||
(proc-doc/names
|
||||
gui-utils:next-untitled-name
|
||||
|
@ -390,13 +388,13 @@
|
|||
|
||||
The first case in the case lambda
|
||||
returns the current delay in seconds before a watch cursor is shown,
|
||||
when either @scheme[gui-utils:local-busy-cursor] or
|
||||
@scheme[gui-utils:show-busy-cursor] is called.
|
||||
when either @racket[gui-utils:local-busy-cursor] or
|
||||
@racket[gui-utils:show-busy-cursor] is called.
|
||||
|
||||
The second case in the case lambda
|
||||
Sets the delay, in seconds, before a watch cursor is shown, when
|
||||
either @scheme[gui-utils:local-busy-cursor] or
|
||||
@scheme[gui-utils:show-busy-cursor] is called.})
|
||||
either @racket[gui-utils:local-busy-cursor] or
|
||||
@racket[gui-utils:show-busy-cursor] is called.})
|
||||
(proc-doc/names
|
||||
gui-utils:show-busy-cursor
|
||||
(->* ((-> any/c))
|
||||
|
@ -404,12 +402,12 @@
|
|||
any/c)
|
||||
((thunk)
|
||||
((delay (gui-utils:cursor-delay))))
|
||||
@{Evaluates @scheme[(thunk)] with a watch cursor. The argument
|
||||
@scheme[delay] specifies the amount of time before the watch cursor is
|
||||
opened. Use @scheme[gui-utils:cursor-delay] to set this value
|
||||
@{Evaluates @racket[(thunk)] with a watch cursor. The argument
|
||||
@racket[delay] specifies the amount of time before the watch cursor is
|
||||
opened. Use @racket[gui-utils:cursor-delay] to set this value
|
||||
to all calls.
|
||||
|
||||
This function returns the result of @scheme[thunk].})
|
||||
This function returns the result of @racket[thunk].})
|
||||
(proc-doc/names
|
||||
gui-utils:delay-action
|
||||
(real?
|
||||
|
@ -424,7 +422,7 @@
|
|||
to appear after 2 seconds and the action may or may not take more than
|
||||
two seconds, use this pattern:
|
||||
|
||||
@schemeblock[(let ([close-down
|
||||
@racketblock[(let ([close-down
|
||||
(gui-utils:delay-action
|
||||
2
|
||||
(λ () .. init watch cursor ...)
|
||||
|
@ -432,11 +430,11 @@
|
|||
;; .. do action ...
|
||||
(close-down))]
|
||||
|
||||
Creates a thread that waits @scheme[delay-time]. After @scheme[delay-time]
|
||||
Creates a thread that waits @racket[delay-time]. After @racket[delay-time]
|
||||
has elapsed, if the result thunk has @italic{not} been called, call
|
||||
@scheme[open]. Then, when the result thunk is called, call
|
||||
@scheme[close]. The function @scheme[close] will only be called if
|
||||
@scheme[open] has been called.})
|
||||
@racket[open]. Then, when the result thunk is called, call
|
||||
@racket[close]. The function @racket[close] will only be called if
|
||||
@racket[open] has been called.})
|
||||
|
||||
(proc-doc/names
|
||||
gui-utils:local-busy-cursor
|
||||
|
@ -447,13 +445,13 @@
|
|||
any/c)
|
||||
((window thunk)
|
||||
((delay (gui-utils:cursor-delay))))
|
||||
@{Evaluates @scheme[(thunk)] with a watch cursor in @scheme[window]. If
|
||||
@scheme[window] is @scheme[#f], the watch cursor is turned on globally.
|
||||
The argument @scheme[delay] specifies the amount of time before the watch
|
||||
cursor is opened. Use @scheme[gui-utils:cursor-delay]
|
||||
@{Evaluates @racket[(thunk)] with a watch cursor in @racket[window]. If
|
||||
@racket[window] is @racket[#f], the watch cursor is turned on globally.
|
||||
The argument @racket[delay] specifies the amount of time before the watch
|
||||
cursor is opened. Use @racket[gui-utils:cursor-delay]
|
||||
to set this value for all uses of this function.
|
||||
|
||||
The result of this function is the result of @scheme[thunk].})
|
||||
The result of this function is the result of @racket[thunk].})
|
||||
|
||||
(proc-doc/names
|
||||
gui-utils:unsaved-warning
|
||||
|
@ -473,17 +471,17 @@
|
|||
|
||||
@{This displays a dialog that warns the user of a unsaved file.
|
||||
|
||||
The string, @scheme[action], indicates what action is about to
|
||||
The string, @racket[action], indicates what action is about to
|
||||
take place, without saving. For example, if the application
|
||||
is about to close a file, a good action is @scheme["Close" "Anyway"].
|
||||
is about to close a file, a good action is @racket["Close" "Anyway"].
|
||||
The result symbol indicates the user's choice. If
|
||||
@scheme[can-save-now?] is @scheme[#f], this function does not
|
||||
@racket[can-save-now?] is @racket[#f], this function does not
|
||||
give the user the ``Save'' option and thus will not return
|
||||
@scheme['save].
|
||||
@racket['save].
|
||||
|
||||
If @scheme[cancel?] is @scheme[#t] there is a cancel button
|
||||
in the dialog and the result may be @scheme['cancel]. If it
|
||||
is @scheme[#f], then there is no cancel button, and @scheme['cancel]
|
||||
If @racket[cancel?] is @racket[#t] there is a cancel button
|
||||
in the dialog and the result may be @racket['cancel]. If it
|
||||
is @racket[#f], then there is no cancel button, and @racket['cancel]
|
||||
will not be the result of the function.
|
||||
|
||||
})
|
||||
|
@ -514,30 +512,30 @@
|
|||
dialog opens a message box asking the user to actually choose one of the
|
||||
two options.
|
||||
|
||||
The dialog will contain the string @scheme[message] and two buttons,
|
||||
labeled with the @scheme[true-choice] and the @scheme[false-choice]. If the
|
||||
user clicks on @scheme[true-choice] @scheme[#t] is returned. If the user
|
||||
clicks on @scheme[false-choice], @scheme[#f] is returned.
|
||||
The dialog will contain the string @racket[message] and two buttons,
|
||||
labeled with the @racket[true-choice] and the @racket[false-choice]. If the
|
||||
user clicks on @racket[true-choice] @racket[#t] is returned. If the user
|
||||
clicks on @racket[false-choice], @racket[#f] is returned.
|
||||
|
||||
The argument @scheme[default-result] determines how closing the window is
|
||||
treated. If the argument is @scheme['disallow-close], closing the window
|
||||
The argument @racket[default-result] determines how closing the window is
|
||||
treated. If the argument is @racket['disallow-close], closing the window
|
||||
is not allowed. If it is anything else, that value is returned when
|
||||
the user closes the window.
|
||||
|
||||
If @scheme[gui-utils:cancel-on-right?]
|
||||
returns @scheme[#t], the false choice is on the right.
|
||||
If @racket[gui-utils:cancel-on-right?]
|
||||
returns @racket[#t], the false choice is on the right.
|
||||
Otherwise, the true choice is on the right.
|
||||
|
||||
The @scheme[style] parameter is (eventually) passed to
|
||||
@scheme[message]
|
||||
The @racket[style] parameter is (eventually) passed to
|
||||
@racket[message]
|
||||
as an icon in the dialog.
|
||||
|
||||
If @scheme[checkbox-proc] is given, it should be a procedure that behaves
|
||||
If @racket[checkbox-proc] is given, it should be a procedure that behaves
|
||||
like a parameter for getting/setting a boolean value. The intention for
|
||||
this value is that it can be used to disable the dialog. When it is
|
||||
given, a checkbox will appear with a @scheme[checkbox-label] label
|
||||
(defaults to the @scheme[dont-ask-again] string constant), and that
|
||||
checkbox value will be sent to the @scheme[checkbox-proc] when the dialog
|
||||
given, a checkbox will appear with a @racket[checkbox-label] label
|
||||
(defaults to the @racket[dont-ask-again] string constant), and that
|
||||
checkbox value will be sent to the @racket[checkbox-proc] when the dialog
|
||||
is closed. Note that the dialog will always pop-up --- it is the
|
||||
caller's responsibility to avoid the dialog if not needed.})
|
||||
|
||||
|
@ -550,13 +548,13 @@
|
|||
((white-on-black? #f)))
|
||||
@{This delta is designed for use with
|
||||
@method[text set-clickback].
|
||||
Use it as one of the @scheme[style-delta%] argument to
|
||||
Use it as one of the @racket[style-delta%] argument to
|
||||
@method[text% set-clickback].
|
||||
|
||||
If @scheme[white-on-black?] is true, the function returns
|
||||
If @racket[white-on-black?] is true, the function returns
|
||||
a delta suitable for use on a black background.
|
||||
|
||||
See also @scheme[gui-utils:get-clickback-delta].})
|
||||
See also @racket[gui-utils:get-clickback-delta].})
|
||||
|
||||
(proc-doc/names
|
||||
gui-utils:get-clickback-delta
|
||||
|
@ -569,8 +567,8 @@
|
|||
Use the result of this function as the style
|
||||
for the region text where the clickback is set.
|
||||
|
||||
If @scheme[white-on-black?] is true, the function returns
|
||||
If @racket[white-on-black?] is true, the function returns
|
||||
a delta suitable for use on a black background.
|
||||
|
||||
See also
|
||||
@scheme[gui-utils:get-clicked-clickback-delta].}))
|
||||
@racket[gui-utils:get-clicked-clickback-delta].}))
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -155,7 +155,7 @@
|
|||
[(an-item? x)
|
||||
(pop-out
|
||||
`@defmethod[(,(an-item->get-item-name x)) (or/c false/c (is-a?/c menu-item%))]{
|
||||
This method returns the @scheme[menu-item%] object corresponding
|
||||
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)]).})
|
||||
|
||||
|
@ -163,8 +163,8 @@
|
|||
`@defmethod[(,(an-item->create-menu-item-name x)) boolean?]{
|
||||
The result of this method determines if the corresponding
|
||||
menu item is created. Override it to control the creation of the menu item.
|
||||
|
||||
Defaults to @scheme[,(an-item-create x)].})
|
||||
|
||||
Defaults to @racket[,(an-item-create x)].})
|
||||
|
||||
(match (an-item-proc x)
|
||||
[`(λ (,item-name ,evt-name) ,bodies ...)
|
||||
|
@ -173,7 +173,7 @@
|
|||
[,item-name (is-a?/c menu-item%)]
|
||||
[,evt-name (is-a?/c control-event%)])
|
||||
void?]{
|
||||
Defaults to @schemeblock[,(if (= 1 (length bodies))
|
||||
Defaults to @racketblock[,(if (= 1 (length bodies))
|
||||
(car bodies)
|
||||
`(begin ,@bodies))] })])
|
||||
|
||||
|
@ -182,21 +182,21 @@
|
|||
(pop-out
|
||||
`@defmethod[(,(an-item->on-demand-name x) [,item-name (is-a?/c menu-item%)]) void?]{
|
||||
The menu item's on-demand proc calls this method.
|
||||
|
||||
Defaults to @schemeblock[,body]})])
|
||||
|
||||
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 @scheme[menu-item%].
|
||||
|
||||
Defaults to @scheme[,(an-item-menu-string x)].})
|
||||
`@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 @scheme[menu-item%] object is created.
|
||||
|
||||
Defaults to @scheme[,(an-item-help-string x)].})]))
|
||||
when the @racket[menu-item%] object is created.
|
||||
|
||||
Defaults to @racket[,(an-item-help-string x)].})]))
|
||||
|
||||
items)
|
||||
(display docs-footer-text port))
|
||||
|
@ -282,6 +282,7 @@
|
|||
;; THIS FILE IS GENERATED. DO NOT EDIT.
|
||||
|
||||
@definterface[frame:standard-menus<%> (frame:basic<%>)]{
|
||||
|
||||
|
||||
|
||||
--
|
||||
)
|
||||
|
|
|
@ -155,7 +155,7 @@
|
|||
The result of this method is used as the class for creating
|
||||
the menu items in this frame.
|
||||
|
||||
Defaultly returns @scheme[menu:can-restore-menu-item].}))
|
||||
Defaultly returns @racket[menu:can-restore-menu-item].}))
|
||||
(make-generic-method
|
||||
'get-checkable-menu-item% '(λ () menu:can-restore-checkable-menu-item%)
|
||||
(list
|
||||
|
@ -163,7 +163,7 @@
|
|||
The result of this method is used as the class for creating
|
||||
checkable menu items in this class.
|
||||
|
||||
Defaultly returns @scheme[menu:can-restore-checkable-menu-item].}))
|
||||
Defaultly returns @racket[menu:can-restore-checkable-menu-item].}))
|
||||
|
||||
(make-generic-method
|
||||
'get-file-menu
|
||||
|
|
|
@ -854,7 +854,7 @@
|
|||
(λ (c) (eq? c btn))))))
|
||||
void?)
|
||||
(button)
|
||||
@{Simulates pushing @scheme[button]. If a string is supplied, the
|
||||
@{Simulates pushing @racket[button]. If a string is supplied, the
|
||||
primitive searches for a button labelled with that string in the
|
||||
active frame. Otherwise, it pushes the button argument.})
|
||||
|
||||
|
@ -862,52 +862,52 @@
|
|||
test:set-radio-box!
|
||||
(-> (or/c string? regexp? (is-a?/c radio-box%)) (or/c string? number?) void?)
|
||||
(radio-box state)
|
||||
@{Sets the radio-box to the label matching @scheme[state]. If @scheme[state] is a
|
||||
@{Sets the radio-box to the label matching @racket[state]. If @racket[state] is a
|
||||
string, this function finds the choice with that label.
|
||||
If it is a regexp, this function finds the first choice whose label matches the regexp.
|
||||
If it is a number, it uses the number as an index into the
|
||||
state. If the number is out of range or if the label isn't
|
||||
in the radio box, an exception is raised.
|
||||
|
||||
If @scheme[radio-box] is a string, this function searches for a
|
||||
@scheme[radio-box%] object with a label matching that string,
|
||||
otherwise it uses @scheme[radio-box] itself.})
|
||||
If @racket[radio-box] is a string, this function searches for a
|
||||
@racket[radio-box%] object with a label matching that string,
|
||||
otherwise it uses @racket[radio-box] itself.})
|
||||
|
||||
(proc-doc/names
|
||||
test:set-radio-box-item!
|
||||
(-> (or/c string? regexp?) void?)
|
||||
(entry)
|
||||
@{Finds a @scheme[radio-box%] that has a label matching @scheme[entry]
|
||||
and sets the radio-box to @scheme[entry].})
|
||||
@{Finds a @racket[radio-box%] that has a label matching @racket[entry]
|
||||
and sets the radio-box to @racket[entry].})
|
||||
|
||||
(proc-doc/names
|
||||
test:set-check-box!
|
||||
(-> (or/c string? (is-a?/c check-box%)) boolean? void?)
|
||||
(check-box state)
|
||||
@{Clears the @scheme[check-box%] item if @scheme[state] is @scheme[#f], and sets it
|
||||
@{Clears the @racket[check-box%] item if @racket[state] is @racket[#f], and sets it
|
||||
otherwise.
|
||||
|
||||
If @scheme[check-box] is a string,
|
||||
this function searches for a @scheme[check-box%] with a label matching that string,
|
||||
otherwise it uses @scheme[check-box] itself.})
|
||||
If @racket[check-box] is a string,
|
||||
this function searches for a @racket[check-box%] with a label matching that string,
|
||||
otherwise it uses @racket[check-box] itself.})
|
||||
|
||||
(proc-doc/names
|
||||
test:set-choice!
|
||||
(-> (or/c string? (is-a?/c choice%)) (or/c string? (and/c number? exact? integer? positive?))
|
||||
void?)
|
||||
(choice str)
|
||||
@{Selects @scheme[choice]'s item @scheme[str]. If @scheme[choice] is a string,
|
||||
this function searches for a @scheme[choice%] with a label matching
|
||||
that string, otherwise it uses @scheme[choice] itself.})
|
||||
@{Selects @racket[choice]'s item @racket[str]. If @racket[choice] is a string,
|
||||
this function searches for a @racket[choice%] with a label matching
|
||||
that string, otherwise it uses @racket[choice] itself.})
|
||||
|
||||
(proc-doc/names
|
||||
test:set-list-box!
|
||||
(-> (or/c string? (is-a?/c list-box%)) (or/c string? (and/c number? exact? integer? positive?))
|
||||
void?)
|
||||
(choice str)
|
||||
@{Selects @scheme[list-box]'s item @scheme[str]. If @scheme[list-box] is a string,
|
||||
this function searches for a @scheme[list-box%] with a label matching
|
||||
that string, otherwise it uses @scheme[list-box] itself.})
|
||||
@{Selects @racket[list-box]'s item @racket[str]. If @racket[list-box] is a string,
|
||||
this function searches for a @racket[list-box%] with a label matching
|
||||
that string, otherwise it uses @racket[list-box] itself.})
|
||||
|
||||
(proc-doc/names
|
||||
test:keystroke
|
||||
|
@ -916,19 +916,19 @@
|
|||
void?)
|
||||
((key)
|
||||
((modifier-list null)))
|
||||
@{This function simulates a user pressing a key. The argument, @scheme[key],
|
||||
@{This function simulates a user pressing a key. The argument, @racket[key],
|
||||
is just like the argument to the
|
||||
@method[key-event% get-key-code]
|
||||
method of the @scheme[key-event%] class.
|
||||
method of the @racket[key-event%] class.
|
||||
|
||||
@italic{Note:}
|
||||
To send the ``Enter'' key, use @scheme[#\return],
|
||||
not @scheme[#\newline].
|
||||
To send the ``Enter'' key, use @racket[#\return],
|
||||
not @racket[#\newline].
|
||||
|
||||
The @scheme['shift] or @scheme['noshift] modifier is implicitly set from @scheme[key],
|
||||
but is overridden by the argument list. The @scheme['shift] modifier is
|
||||
The @racket['shift] or @racket['noshift] modifier is implicitly set from @racket[key],
|
||||
but is overridden by the argument list. The @racket['shift] modifier is
|
||||
set for any capitol alpha-numeric letters and any of the following characters:
|
||||
@schemeblock[
|
||||
@racketblock[
|
||||
#\? #\: #\~ #\\ #\|
|
||||
#\< #\> #\{ #\} #\[ #\] #\( #\)
|
||||
#\! #\@ #\# #\$ #\% #\^ #\& #\* #\_ #\+
|
||||
|
@ -940,7 +940,7 @@
|
|||
test:menu-select
|
||||
(string? string? . -> . void?)
|
||||
(menu item)
|
||||
@{Selects the menu-item named @scheme[item] in the menu named @scheme[menu].
|
||||
@{Selects the menu-item named @racket[item] in the menu named @racket[menu].
|
||||
|
||||
@italic{Note:}
|
||||
The string for the menu item does not include its keyboard equivalent.
|
||||
|
@ -958,17 +958,17 @@
|
|||
((button x y)
|
||||
((modifiers null)))
|
||||
@{Simulates a mouse click at the coordinate (x,y) in the currently
|
||||
focused @scheme[window], assuming that it supports the
|
||||
focused @racket[window], assuming that it supports the
|
||||
@method[canvas<%> on-event] method.
|
||||
Use @scheme[test:button-push] to click on a button.
|
||||
Use @racket[test:button-push] to click on a button.
|
||||
|
||||
On the Macintosh, @scheme['right] corresponds to holding down the command
|
||||
modifier key while clicking and @scheme['middle] cannot be generated.
|
||||
On the Macintosh, @racket['right] corresponds to holding down the command
|
||||
modifier key while clicking and @racket['middle] cannot be generated.
|
||||
|
||||
Under Windows, @scheme['middle] can only be generated if the user has a
|
||||
Under Windows, @racket['middle] can only be generated if the user has a
|
||||
three button mouse.
|
||||
|
||||
The modifiers later in the list @scheme[modifiers] take precedence over
|
||||
The modifiers later in the list @racket[modifiers] take precedence over
|
||||
ones that appear earlier.})
|
||||
|
||||
(proc-doc/names
|
||||
|
@ -979,7 +979,7 @@
|
|||
((msec) ())
|
||||
@{See also @secref{test:actions-completeness}.
|
||||
The first case in the case-lambda sets
|
||||
the run interval to @scheme[msec] milliseconds and the second
|
||||
the run interval to @racket[msec] milliseconds and the second
|
||||
returns the current setting.})
|
||||
|
||||
(parameter-doc
|
||||
|
@ -991,7 +991,7 @@
|
|||
(see also @secref[#:doc '(lib "scribblings/gui/gui.scrbl") "eventspaceinfo"])
|
||||
are considered when finding the frontmost frame.
|
||||
The first case
|
||||
sets the parameter to @scheme[func]. The procedure @scheme[func] will be
|
||||
sets the parameter to @racket[func]. The procedure @racket[func] will be
|
||||
invoked with no arguments to determine the eventspaces to consider
|
||||
when finding the frontmost frame for simulated user events.
|
||||
The second case
|
||||
|
@ -1011,8 +1011,8 @@
|
|||
(-> (is-a?/c top-level-window<%>) void?)
|
||||
(tlw)
|
||||
@{Use this function to simulate clicking on the close box of a frame.
|
||||
Closes @scheme[tlw] with this expression:
|
||||
@schemeblock[
|
||||
Closes @racket[tlw] with this expression:
|
||||
@racketblock[
|
||||
(when (send tlw can-close?)
|
||||
(send tlw on-close)
|
||||
(send tlw show #f))]})
|
||||
|
@ -1021,10 +1021,10 @@
|
|||
test:top-level-focus-window-has?
|
||||
(-> (-> (is-a?/c area<%>) boolean?) boolean?)
|
||||
(test)
|
||||
@{Calls @scheme[test] for each child of the top-level-focus-frame
|
||||
and returns @scheme[#t] if @scheme[test] ever does, otherwise
|
||||
returns @scheme[#f]. If there
|
||||
is no top-level-focus-window, returns @scheme[#f].})
|
||||
@{Calls @racket[test] for each child of the top-level-focus-frame
|
||||
and returns @racket[#t] if @racket[test] ever does, otherwise
|
||||
returns @racket[#f]. If there
|
||||
is no top-level-focus-window, returns @racket[#f].})
|
||||
|
||||
|
||||
(proc-doc
|
||||
|
@ -1041,6 +1041,4 @@
|
|||
test:run-one
|
||||
(-> (-> void?) void?)
|
||||
(f)
|
||||
@{Runs the function @scheme[f] as if it was a simulated event.}))
|
||||
|
||||
|
||||
@{Runs the function @racket[f] as if it was a simulated event.}))
|
||||
|
|
|
@ -25,8 +25,8 @@ fit the widths of all of its children.
|
|||
[(realign)
|
||||
void?])]{
|
||||
|
||||
Realigns the children inside the @scheme[aligned-pasteboard<%>] to
|
||||
either a given @scheme[width] and @scheme[height] or the previously
|
||||
Realigns the children inside the @racket[aligned-pasteboard<%>] to
|
||||
either a given @racket[width] and @racket[height] or the previously
|
||||
alloted width and height.}
|
||||
|
||||
@defmethod[(set-aligned-min-sizes)
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
@definterface/title[aligned-pasteboard-parent<%> ()]{
|
||||
|
||||
This interface must be implemented by any class who's editor
|
||||
is an @scheme[aligned-pasteboard<%>].
|
||||
is an @racket[aligned-pasteboard<%>].
|
||||
|
||||
@defmethod[(set-aligned-min-sizes)
|
||||
void?]{}
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
@title[#:style 'toc]{Aligned Pasteboard}
|
||||
|
||||
The aligned-pasteboard library provides classes derived from
|
||||
@scheme[pasteboard%] with geometry management that mirrors that of
|
||||
@scheme[vertical-panel%] and @scheme[horizontal-panel%].
|
||||
@racket[pasteboard%] with geometry management that mirrors that of
|
||||
@racket[vertical-panel%] and @racket[horizontal-panel%].
|
||||
|
||||
@defmodule[mrlib/aligned-pasteboard]
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
@defclass/title[horizontal-pasteboard% pasteboard% (aligned-pasteboard<%>)]{
|
||||
|
||||
@defconstructor/auto-super[()]{
|
||||
Passes all arguments to @scheme[super-init].
|
||||
Passes all arguments to @racket[super-init].
|
||||
}
|
||||
|
||||
@defmethod[#:mode override
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
This interface must be implemented by any snip class who's
|
||||
objects will be stretchable when inserted into an
|
||||
@scheme[aligned-pasteboard<%>].
|
||||
@racket[aligned-pasteboard<%>].
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
@defclass/title[vertical-pasteboard% pasteboard% (aligned-pasteboard<%>)]{
|
||||
|
||||
@defconstructor/auto-super[()]{
|
||||
Passes all arguments to @scheme[super-init].
|
||||
Passes all arguments to @racket[super-init].
|
||||
}
|
||||
|
||||
@defmethod[#:mode override
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
(is-a?/c bitmap%)]{
|
||||
|
||||
Constructs a bitmap label suitable for use a button that contains the
|
||||
image specified by @scheme[img] followed by the text in @scheme[str].}
|
||||
image specified by @racket[img] followed by the text in @racket[str].}
|
||||
|
||||
|
||||
@defproc[((bitmap-label-maker [str string?]
|
||||
|
@ -19,5 +19,5 @@ image specified by @scheme[img] followed by the text in @scheme[str].}
|
|||
[future-parent (is-a?/c area-container<%>)])
|
||||
(is-a?/c bitmap%)]{
|
||||
|
||||
And older variant of @scheme[make-bitmap-label] that obtains a
|
||||
font to use from a container @scheme[future-parent].}
|
||||
And older variant of @racket[make-bitmap-label] that obtains a
|
||||
font to use from a container @racket[future-parent].}
|
||||
|
|
|
@ -5,21 +5,21 @@
|
|||
|
||||
@defmodule[mrlib/cache-image-snip]{
|
||||
|
||||
The @schememodname[mrlib/cache-image-snip] library provides the core
|
||||
The @racketmodname[mrlib/cache-image-snip] library provides the core
|
||||
data structure for DrRacket's @filepath{image.rkt} teachpack. Images in
|
||||
the @filepath{image.rkt} teachpack are instances of the
|
||||
@scheme[cache-image-snip%] class.}
|
||||
@racket[cache-image-snip%] class.}
|
||||
|
||||
The library also defines a new type, @scheme[argb], that represents a
|
||||
The library also defines a new type, @racket[argb], that represents a
|
||||
bitmap, but with alpha values. It has a maker, two selectors, and a
|
||||
predicate.
|
||||
|
||||
|
||||
@defclass[cache-image-snip% image-snip% ()]{
|
||||
|
||||
The @scheme[cache-image-snip%] class is a subclass of
|
||||
@scheme[image-snip%] simply so that its instances can be compared with
|
||||
@scheme[image-snip%] using @scheme[equal?]. All @scheme[image-snip%]
|
||||
The @racket[cache-image-snip%] class is a subclass of
|
||||
@racket[image-snip%] simply so that its instances can be compared with
|
||||
@racket[image-snip%] using @racket[equal?]. All @racket[image-snip%]
|
||||
functionality is overridden or ignored.
|
||||
|
||||
@defmethod[#:mode overrride
|
||||
|
@ -28,7 +28,7 @@ functionality is overridden or ignored.
|
|||
boolean?]{
|
||||
|
||||
Calls the @method[cache-image-snip% other-equal-to?] method of
|
||||
@scheme[snip] if it is also a @scheme[cache-image-snip%] instance,
|
||||
@racket[snip] if it is also a @racket[cache-image-snip%] instance,
|
||||
otherwise calls the @method[cache-image-snip% other-equal-to?] of
|
||||
@this-obj[].}
|
||||
|
||||
|
@ -52,7 +52,7 @@ otherwise calls the @method[cache-image-snip% other-equal-to?] of
|
|||
@defmethod[(get-argb/no-compute)
|
||||
(or/c false/c argb?)]{
|
||||
|
||||
Returns a pixel array for this image or @scheme[#f] if it has not
|
||||
Returns a pixel array for this image or @racket[#f] if it has not
|
||||
been computed yet.
|
||||
|
||||
|
||||
|
@ -64,8 +64,8 @@ otherwise calls the @method[cache-image-snip% other-equal-to?] of
|
|||
Builds (if not yet built) a bitmap corresponding to
|
||||
this snip and returns it.
|
||||
|
||||
If the width or the height of the snip is @scheme[0],
|
||||
this method return @scheme[#f].
|
||||
If the width or the height of the snip is @racket[0],
|
||||
this method return @racket[#f].
|
||||
}
|
||||
|
||||
@defmethod[(get-dc-proc)
|
||||
|
@ -119,20 +119,20 @@ This snipclass is used for saved cache image snips.}
|
|||
|
||||
@defproc[(argb-vector [argb argb?]) (vectorof (integer-in 0 255))]{
|
||||
|
||||
Extracts the vector from @scheme[argb].}
|
||||
Extracts the vector from @racket[argb].}
|
||||
|
||||
@defproc[(argb-width [argb argb?]) exact-nonnegative-integer?]{
|
||||
|
||||
Extracts the width from @scheme[argb].}
|
||||
Extracts the width from @racket[argb].}
|
||||
|
||||
@defproc[(argb-height [argb argb?]) exact-nonnegative-integer?]{
|
||||
|
||||
Extracts the height from @scheme[argb].}
|
||||
Extracts the height from @racket[argb].}
|
||||
|
||||
|
||||
@defproc[(argb? [v any/c]) boolean?]{
|
||||
|
||||
Returns @scheme[#t] if @scheme[v] is an argb, @scheme[#f] otherwise.}
|
||||
Returns @racket[#t] if @racket[v] is an argb, @racket[#f] otherwise.}
|
||||
|
||||
|
||||
@defproc[(overlay-bitmap [dest argb?]
|
||||
|
@ -142,8 +142,8 @@ Returns @scheme[#t] if @scheme[v] is an argb, @scheme[#f] otherwise.}
|
|||
[mask (is-a?/c bitmap%)])
|
||||
void?]{
|
||||
|
||||
Changes @scheme[argb], overlaying @scheme[img] with masking based on
|
||||
@scheme[mask] at @math{(@scheme[dx], @scheme[dy])} from the top-left.}
|
||||
Changes @racket[argb], overlaying @racket[img] with masking based on
|
||||
@racket[mask] at @math{(@racket[dx], @racket[dy])} from the top-left.}
|
||||
|
||||
|
||||
@defproc[(build-bitmap [draw ((is-a?/c dc<%>) . -> . any)]
|
||||
|
@ -151,34 +151,34 @@ Changes @scheme[argb], overlaying @scheme[img] with masking based on
|
|||
[height (integer-in 1 10000)])
|
||||
(is-a?/c bitmap%)]{
|
||||
|
||||
Builds a bitmap of size @scheme[width] by @scheme[height], using the
|
||||
procedure @scheme[draw] to render the bitmap content into the given
|
||||
@scheme[dc<%>].}
|
||||
Builds a bitmap of size @racket[width] by @racket[height], using the
|
||||
procedure @racket[draw] to render the bitmap content into the given
|
||||
@racket[dc<%>].}
|
||||
|
||||
|
||||
@defproc[(flatten-bitmap [bitmap (is-a?/c bitmap%)]) (is-a?/c bitmap%)]{
|
||||
|
||||
Builds a new bitmap that flattens the original @scheme[bitmap]
|
||||
Builds a new bitmap that flattens the original @racket[bitmap]
|
||||
with its mask (as determined by @xmethod[bitmap%
|
||||
get-loaded-mask]), producing a bitmap that has no mask, and looks
|
||||
the way that bitmap would draw (when drawn with the mask) onto a
|
||||
white background.}
|
||||
|
||||
|
||||
|
||||
@defproc[(argb->cache-image-snip [argb argb?][dx real?][dy real?])
|
||||
(is-a?/c cache-image-snip%)]{
|
||||
|
||||
Builds a new @scheme[cache-image-snip%] based on the contents of
|
||||
@scheme[argb], using @scheme[dx] and @scheme[dy] as the pinhole.}
|
||||
Builds a new @racket[cache-image-snip%] based on the contents of
|
||||
@racket[argb], using @racket[dx] and @racket[dy] as the pinhole.}
|
||||
|
||||
|
||||
@defproc[(argb->bitmap [argb argb?]) (or/c false/c (is-a?/c bitmap%))]{
|
||||
|
||||
Builds a bitmap that draws the same way as @scheme[argb]; the alpha
|
||||
Builds a bitmap that draws the same way as @racket[argb]; the alpha
|
||||
pixels are put into the bitmap's @method[bitmap% get-loaded-mask]
|
||||
bitmap.
|
||||
|
||||
If the width or height of @scheme[argb] is @scheme[0],
|
||||
this returns @scheme[#f].
|
||||
If the width or height of @racket[argb] is @racket[0],
|
||||
this returns @racket[#f].
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
@title{Close Icon}
|
||||
|
||||
@defmodule[mrlib/close-icon]{The @scheme[close-icon%] class
|
||||
@defmodule[mrlib/close-icon]{The @racket[close-icon%] class
|
||||
provides a clickable close button icon.}
|
||||
|
||||
@defclass[close-icon% canvas% ()]{
|
||||
|
@ -14,8 +14,8 @@ provides a clickable close button icon.}
|
|||
[bg-color (or/c #f string (is-a?/c color%))]
|
||||
[horizontal-pad positive-integer? 4]
|
||||
[vertical-pad positive-integer? 4])]{
|
||||
The @scheme[callback] is called when the close icon is clicked.
|
||||
|
||||
If @scheme[bg-color] is specified, it is used as the background color of the icon.
|
||||
The @racket[callback] is called when the close icon is clicked.
|
||||
|
||||
If @racket[bg-color] is specified, it is used as the background color of the icon.
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,11 +11,11 @@
|
|||
[filename path-string])
|
||||
void?]{
|
||||
|
||||
Writes the given @scheme[bitmap] to @scheme[filename] as a GIF image,
|
||||
where @scheme[bitmap] is either an instance of @scheme[bitmap%] or a
|
||||
Writes the given @racket[bitmap] to @racket[filename] as a GIF image,
|
||||
where @racket[bitmap] is either an instance of @racket[bitmap%] or a
|
||||
thunk (to be called just once) that generates such an object. If the
|
||||
bitmap uses more than 256 colors, it is automatically quantized using
|
||||
a simple algorithm; see @scheme[quantize]. If the bitmap has a mask
|
||||
a simple algorithm; see @racket[quantize]. If the bitmap has a mask
|
||||
bitmap via @method[bitmap% get-loaded-mask], it is used to determine
|
||||
transparent pixels in the generated GIF image.}
|
||||
|
||||
|
@ -30,28 +30,28 @@ transparent pixels in the generated GIF image.}
|
|||
[#:last-frame-delay last-frame-delay (or/c (integer-in 0 #xFFFFFFFF) false/c) #f])
|
||||
void?]{
|
||||
|
||||
Writes the bitmaps in @scheme[bitmaps] to @scheme[filename] as an
|
||||
animated GIF. The @scheme[bitmaps] list can contain a mixture of
|
||||
@scheme[bitmap%] objects and thunks (each called just once) that
|
||||
produce @scheme[bitmap%] objects. The @scheme[delay-csec] argument is
|
||||
Writes the bitmaps in @racket[bitmaps] to @racket[filename] as an
|
||||
animated GIF. The @racket[bitmaps] list can contain a mixture of
|
||||
@racket[bitmap%] objects and thunks (each called just once) that
|
||||
produce @racket[bitmap%] objects. The @racket[delay-csec] argument is
|
||||
the amount of time in 1/100s of a second to wait between transitions.
|
||||
If @scheme[loop?] is a true value, then the GIF is marked as a looping
|
||||
If @racket[loop?] is a true value, then the GIF is marked as a looping
|
||||
animation.
|
||||
|
||||
If @scheme[one-at-a-time?] is @scheme[#f], then the content of all
|
||||
If @racket[one-at-a-time?] is @racket[#f], then the content of all
|
||||
images is collected and quantized at once, to produce a single
|
||||
colortable; a drawback to this approach is that it uses more memory,
|
||||
and it allows less color variation among animation frames. Even when
|
||||
@scheme[one-at-a-time?] is @scheme[#f], the result of each thunk in
|
||||
@scheme[bitmaps] is converted to a byte-string one at a time.
|
||||
@racket[one-at-a-time?] is @racket[#f], the result of each thunk in
|
||||
@racket[bitmaps] is converted to a byte-string one at a time.
|
||||
|
||||
If @scheme[one-at-a-time?] is true, then the bitmaps are quantized and
|
||||
If @racket[one-at-a-time?] is true, then the bitmaps are quantized and
|
||||
written to the file one at a time; that is, for each thunk in
|
||||
@scheme[bitmaps], its result is written and discarded before another
|
||||
@racket[bitmaps], its result is written and discarded before another
|
||||
thunk is called. A drawback to this approach is that a separate
|
||||
colortable is written for each frame in the animation, which can make
|
||||
the resulting file large.
|
||||
|
||||
If @scheme[last-frame-delay] is not false, a delay of
|
||||
@scheme[last-frame-delay] (in 1/100s of a second) is added to the last
|
||||
frame. This extra delay is useful when @scheme[loop?] is true.}
|
||||
If @racket[last-frame-delay] is not false, a delay of
|
||||
@racket[last-frame-delay] (in 1/100s of a second) is added to the last
|
||||
frame. This extra delay is useful when @racket[loop?] is true.}
|
||||
|
|
|
@ -70,8 +70,8 @@ different nodes.
|
|||
graph pasteboard, and is expected to draw the edges between the
|
||||
snips. The argments are a subset of those passed to
|
||||
@method[editor<%> on-paint] and it is only called when the
|
||||
@scheme[before?] argument to @method[editor<%> on-paint]
|
||||
is @scheme[#t].
|
||||
@racket[before?] argument to @method[editor<%> on-paint]
|
||||
is @racket[#t].
|
||||
}
|
||||
|
||||
@defmethod[(draw-single-edge [dc (is-a?/c dc<%>)]
|
||||
|
@ -88,25 +88,25 @@ different nodes.
|
|||
This method is called to draw each edge in the graph, except
|
||||
for the edges that connect a node to itself.
|
||||
|
||||
The @scheme[dc], @scheme[dx], and @scheme[dy] arguments are
|
||||
The @racket[dc], @racket[dx], and @racket[dy] arguments are
|
||||
the same as in @method[editor<%> on-paint].
|
||||
|
||||
The
|
||||
@scheme[from-x], @scheme[from-y], @scheme[to-x], and
|
||||
@scheme[to-y] arguments specify points on the source and
|
||||
@racket[from-x], @racket[from-y], @racket[to-x], and
|
||||
@racket[to-y] arguments specify points on the source and
|
||||
destination snip's bounding box where a straight line
|
||||
between the centers of the snip would intersect.
|
||||
|
||||
The @scheme[arrow-point-ok?] function returns @scheme[#t]
|
||||
The @racket[arrow-point-ok?] function returns @racket[#t]
|
||||
when the point specified by its arguments is inside the
|
||||
smallest rectangle that covers both the source and
|
||||
destination snips, but is outside of both of the rectangles
|
||||
that surround the source and destination snips themselves.
|
||||
|
||||
This default implementation uses @scheme[update-polygon] to compute
|
||||
This default implementation uses @racket[update-polygon] to compute
|
||||
the arrowheads and otherwise draws a straight line between the two
|
||||
points and then the arrowheads, unless the arrowhead points
|
||||
are not ok according to @scheme[arrow-point-ok?], in which case
|
||||
are not ok according to @racket[arrow-point-ok?], in which case
|
||||
it just draws the line.
|
||||
}
|
||||
|
||||
|
@ -116,8 +116,8 @@ it just draws the line.
|
|||
[point3 (is-a?/c point%)]
|
||||
[point4 (is-a?/c point%)]) void?]{
|
||||
|
||||
Updates the arguments @scheme[point1], @scheme[point2], @scheme[point3], @scheme[point4] with the coordinates
|
||||
of an arrowhead for a line that connects (@scheme[from-x],@scheme[from-y]) to (@scheme[to-x],@scheme[to-y]).
|
||||
Updates the arguments @racket[point1], @racket[point2], @racket[point3], @racket[point4] with the coordinates
|
||||
of an arrowhead for a line that connects (@racket[from-x],@racket[from-y]) to (@racket[to-x],@racket[to-y]).
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -7,12 +7,12 @@
|
|||
[edge-label-font (or/c #f (is-a?/c font%)) #f]
|
||||
[cache-arrow-drawing? any])]{
|
||||
|
||||
If @scheme[edge-labels?] is @scheme[#f], no edge labels are
|
||||
If @racket[edge-labels?] is @racket[#f], no edge labels are
|
||||
drawn. Otherwise, they are.
|
||||
|
||||
If @scheme[edge-label-font] is supplied, it is used when drawing the
|
||||
If @racket[edge-label-font] is supplied, it is used when drawing the
|
||||
labels on the edges. Otherwise, the font is not set before drawing
|
||||
the labels, defaulting to the @scheme[dc<%>] object's font.
|
||||
the labels, defaulting to the @racket[dc<%>] object's font.
|
||||
|
||||
If @racket[cache-arrow-drawing?] is @racket[#f], then the arrows in the snip
|
||||
are not cached in a bitmap (to speed up drawing when the mouse moves around).
|
||||
|
@ -21,4 +21,4 @@ Otherwise, they are.
|
|||
}
|
||||
|
||||
This mixin overrides many methods to draw lines between
|
||||
@scheme[graph-snip<%>] that it contains.}
|
||||
@racket[graph-snip<%>] that it contains.}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
void?]{
|
||||
|
||||
Adds a child of this snip. Instead of calling this method,
|
||||
consider using the @scheme[add-links] function.
|
||||
consider using the @racket[add-links] function.
|
||||
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
|||
void?])]{
|
||||
|
||||
Adds a parent of this snip. Instead of calling this
|
||||
method, consider using the @scheme[add-links] function.
|
||||
method, consider using the @racket[add-links] function.
|
||||
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
|||
(listof snip%)]{
|
||||
|
||||
returns a list of snips that implement
|
||||
@scheme[graph-snip<%>]. Each of these snips will have a line
|
||||
@racket[graph-snip<%>]. Each of these snips will have a line
|
||||
drawn from it, pointing at this snip.
|
||||
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ drawn from it, pointing at this snip.
|
|||
@defmethod[(get-parents)
|
||||
(listof graph-snip<%>)]{
|
||||
|
||||
Returns a list of snips that implement @scheme[graph-snip<%>]. Each
|
||||
Returns a list of snips that implement @racket[graph-snip<%>]. Each
|
||||
of these snips will have a line drawn to it, starting from
|
||||
this snip.
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ this snip.
|
|||
Removes a child snip from this snip. Be sure to remove
|
||||
this snip as a parent from the argument, too.
|
||||
Instead of calling this method, consider using the
|
||||
@scheme[remove-links] function.
|
||||
@racket[remove-links] function.
|
||||
}
|
||||
|
||||
|
||||
|
@ -62,7 +62,7 @@ this snip.
|
|||
Removes a parent snip from this snip. Be sure to remove this
|
||||
snip as a child from the argument, too.
|
||||
Instead of calling this method, consider using the
|
||||
@scheme[remove-links] function.
|
||||
@racket[remove-links] function.
|
||||
}
|
||||
|
||||
|
||||
|
@ -70,8 +70,8 @@ this snip.
|
|||
[label (or/c false/c string/)])
|
||||
void?]{
|
||||
|
||||
Changes the label on the edge going to the @scheme[parent] to be
|
||||
@scheme[label]. Ignored if no such egde exists.
|
||||
Changes the label on the edge going to the @racket[parent] to be
|
||||
@racket[label]. Ignored if no such egde exists.
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
@title[#:style 'toc]{Graphs}
|
||||
|
||||
@defmodule[mrlib/graph]{The @schememodname[mrlib/graph] library
|
||||
provides a graph drawing toolkit built out of @scheme[pasteboard%]s.}
|
||||
@defmodule[mrlib/graph]{The @racketmodname[mrlib/graph] library
|
||||
provides a graph drawing toolkit built out of @racket[pasteboard%]s.}
|
||||
|
||||
@local-table-of-contents[]
|
||||
|
||||
|
@ -42,20 +42,20 @@ provides a graph drawing toolkit built out of @scheme[pasteboard%]s.}
|
|||
|
||||
Connects a parent snip to a child snip within a pasteboard.
|
||||
|
||||
The default @scheme[dark-pen]/@scheme[dark-brush] and
|
||||
@scheme[light-pen]/@scheme[light-brush] are blue and purple,
|
||||
respectively. The @scheme[dark-pen] and @scheme[dark-brush] are used
|
||||
The default @racket[dark-pen]/@racket[dark-brush] and
|
||||
@racket[light-pen]/@racket[light-brush] are blue and purple,
|
||||
respectively. The @racket[dark-pen] and @racket[dark-brush] are used
|
||||
when the mouse cursor is over the snip (or a child or parent), and the
|
||||
@scheme[light-pen] and @scheme[light-brush] are used when the mouse
|
||||
@racket[light-pen] and @racket[light-brush] are used when the mouse
|
||||
cursor is not over the snip. The brush is used to draw inside the
|
||||
arrow head and the pen is used to draw the border of the arrowhead and
|
||||
the line connecting the two snips.
|
||||
|
||||
if @scheme[label] is provided and not @scheme[#f], it is used as a
|
||||
if @racket[label] is provided and not @racket[#f], it is used as a
|
||||
label on the edge.
|
||||
|
||||
When @scheme[dx] and @scheme[dy] are provided, the are offsets for the
|
||||
head and the tail of the arrow. Otherwise, @scheme[0] offsets are
|
||||
When @racket[dx] and @racket[dy] are provided, the are offsets for the
|
||||
head and the tail of the arrow. Otherwise, @racket[0] offsets are
|
||||
used.}
|
||||
|
||||
@defproc[(add-links/text-colors [parent (is-a?/c graph-snip<%>)]
|
||||
|
@ -71,8 +71,8 @@ used.}
|
|||
[label (or/c string? false/c)])
|
||||
void?]{
|
||||
|
||||
Like @scheme[add-links], but with extra @scheme[dark-text] and
|
||||
@scheme[light-text] arguments to set the colors of the label.}
|
||||
Like @racket[add-links], but with extra @racket[dark-text] and
|
||||
@racket[light-text] arguments to set the colors of the label.}
|
||||
|
||||
@defproc[(remove-links [parent (is-a?/c graph-snip<%>)]
|
||||
[child (is-a?/c graph-snip<%>)])
|
||||
|
@ -85,6 +85,6 @@ Disconnects a parent snip from a child snip within a pasteboard.}
|
|||
[label (or/c string? false/c)])
|
||||
void?]{
|
||||
|
||||
Changes the label on the edge going from @scheme[child] to
|
||||
@scheme[parent] to be @scheme[label]. If there is no existing edge
|
||||
Changes the label on the edge going from @racket[child] to
|
||||
@racket[parent] to be @racket[label]. If there is no existing edge
|
||||
between the two nodes, then nothing happens.}
|
||||
|
|
|
@ -32,7 +32,7 @@ Like @xmethod[hierarchical-list% new-list].}
|
|||
|
||||
@defmethod[(delete-item [i (is-a?/c hierarchical-list-item<%>)]) void?]{
|
||||
|
||||
Deletes immediate item or sub-list @scheme[i] from the sub-list.}
|
||||
Deletes immediate item or sub-list @racket[i] from the sub-list.}
|
||||
|
||||
|
||||
@defmethod[(get-items) (listof (is-a?/c hierarchical-list-item<%>))]{
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
@defmodule[mrlib/hierlist]
|
||||
|
||||
A @scheme[hierarchical-list%] control is a list of items, some of
|
||||
A @racket[hierarchical-list%] control is a list of items, some of
|
||||
which can themselves be hierarchical lists. Each such sub-list has an
|
||||
arrow that the user can click to hide or show the sub-list's items.
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ Reports whether the item is selected.}
|
|||
[(click-select [on? any/c]) void?])]{
|
||||
|
||||
Calls @method[hierarchical-list% select] or @method[hierarchical-list%
|
||||
click-select]. The @scheme[on?] argument can be @scheme[#f] only if
|
||||
click-select]. The @racket[on?] argument can be @racket[#f] only if
|
||||
@xmethod[hierarchical-list% allow-deselect] allows it.}
|
||||
|
||||
|
||||
|
|
|
@ -17,9 +17,9 @@ Creates a hierarchical-list control.
|
|||
|
||||
Creates the control.
|
||||
|
||||
If the style @scheme['transparent] is passed, then the
|
||||
If the style @racket['transparent] is passed, then the
|
||||
@method[editor-snip% use-style-background] method will be
|
||||
called with @scheme[#t] when editor snips are created as part of
|
||||
called with @racket[#t] when editor snips are created as part of
|
||||
the hierarchical list, ensuring that the entire control is
|
||||
transparent.
|
||||
|
||||
|
@ -39,11 +39,11 @@ Returns the currently selected item, if any.}
|
|||
(is-a?/c hierarchical-list-item<%>)]{
|
||||
|
||||
Creates and returns a new (empty) item in the list. See
|
||||
@scheme[hierarchical-list-item<%>] for methods to fill in the item's
|
||||
@racket[hierarchical-list-item<%>] for methods to fill in the item's
|
||||
label.
|
||||
|
||||
The @scheme[mixin] argument is applied to a class implementing
|
||||
@scheme[hierarchical-list-item<%>], and the resulting class is
|
||||
The @racket[mixin] argument is applied to a class implementing
|
||||
@racket[hierarchical-list-item<%>], and the resulting class is
|
||||
instantiated as the list item.}
|
||||
|
||||
|
||||
|
@ -62,17 +62,17 @@ list is empty.}
|
|||
(is-a?/c hierarchical-list-compound-item<%>)]{
|
||||
|
||||
Creates and returns a new (empty) sub-list in the list. See
|
||||
@scheme[hierarchical-list-compound-item<%>] for methods to fill in the
|
||||
@racket[hierarchical-list-compound-item<%>] for methods to fill in the
|
||||
item's label and content.
|
||||
|
||||
The @scheme[mixin] argument is applied to a class implementing
|
||||
@scheme[hierarchical-list-compound-item<%>], and the resulting class
|
||||
The @racket[mixin] argument is applied to a class implementing
|
||||
@racket[hierarchical-list-compound-item<%>], and the resulting class
|
||||
is instantiated as the sub-list.}
|
||||
|
||||
|
||||
@defmethod[(delete-item [i (is-a?/c hierarchical-list-item<%>)]) void?]{
|
||||
|
||||
Deletes immediate item or sub-list @scheme[i] from the list.}
|
||||
Deletes immediate item or sub-list @racket[i] from the list.}
|
||||
|
||||
|
||||
@defmethod[(get-items) (listof (is-a?/c hierarchical-list-item<%>))]{
|
||||
|
@ -89,7 +89,7 @@ selection.}
|
|||
|
||||
@defmethod[(on-select [i (or/c (is-a?/c hierarchical-list-item<%>) false/c)]) any]{
|
||||
|
||||
Called for new select of @scheme[i], where @scheme[i] is @scheme[#f]
|
||||
Called for new select of @racket[i], where @racket[i] is @racket[#f]
|
||||
if no item is now selected.}
|
||||
|
||||
|
||||
|
@ -103,17 +103,17 @@ set-allow-selection].}
|
|||
|
||||
@defmethod[(on-double-select [i (is-a?/c hierarchical-list-item<%>)]) any]{
|
||||
|
||||
Called for a double-click on @scheme[i].}
|
||||
Called for a double-click on @racket[i].}
|
||||
|
||||
|
||||
@defmethod[(on-item-opened [i (is-a?/c hierarchical-list-compound-item<%>)]) any]{
|
||||
|
||||
Called when the arrow for @scheme[i] is turned down.}
|
||||
Called when the arrow for @racket[i] is turned down.}
|
||||
|
||||
|
||||
@defmethod[(on-item-closed [i (is-a?/c hierarchical-list-compound-item<%>)]) any]{
|
||||
|
||||
Called when the arrow for @scheme[i] is turned up.}
|
||||
Called when the arrow for @racket[i] is turned up.}
|
||||
|
||||
|
||||
@defmethod[(sort [less-than-proc ((is-a?/c hierarchical-list-item<%>)
|
||||
|
@ -122,8 +122,8 @@ Called when the arrow for @scheme[i] is turned up.}
|
|||
[recur? any/c #t])
|
||||
void?]{
|
||||
|
||||
Sorts items in the list by calling @scheme[less-than-proc] on pairs of
|
||||
items. If @scheme[recur?] is true, items in sub-lists are sorted
|
||||
Sorts items in the list by calling @racket[less-than-proc] on pairs of
|
||||
items. If @racket[recur?] is true, items in sub-lists are sorted
|
||||
recursively.}
|
||||
|
||||
|
||||
|
@ -131,7 +131,7 @@ recursively.}
|
|||
boolean?]{
|
||||
|
||||
Like @xmethod[editor<%> can-do-edit-operation?]. The default
|
||||
implementation always returns @scheme[#f].}
|
||||
implementation always returns @racket[#f].}
|
||||
|
||||
|
||||
@defmethod[(do-edit-operation [op symbol?] [recursive? any/c #t])
|
||||
|
@ -161,7 +161,7 @@ Moves the selection, scrolls as necessary to show it, and calls
|
|||
@method[hierarchical-list% on-select-always].
|
||||
|
||||
The @method[hierarchical-list% allow-deselect] method controls whether
|
||||
@scheme[i] is allowed to be @scheme[#f] to deselect the currently
|
||||
@racket[i] is allowed to be @racket[#f] to deselect the currently
|
||||
selected item.}
|
||||
|
||||
|
||||
|
@ -199,7 +199,7 @@ This is initially disabled, by default.}
|
|||
|
||||
|
||||
Gets/sets whether the @method[hierarchical-list% on-select] can be
|
||||
called with a @scheme[#f] argument to deselect the current item
|
||||
called with a @racket[#f] argument to deselect the current item
|
||||
(leaving none selected).
|
||||
|
||||
The initial mode does not allow deselection.}
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
#lang scribble/doc
|
||||
@(require "../common.rkt" (for-label mrlib/hierlist))
|
||||
|
||||
@title{Snips in a @scheme[hierarchical-list%] Instance}
|
||||
@title{Snips in a @racket[hierarchical-list%] Instance}
|
||||
|
||||
The @xmethod[text% find-snip] method of the editor in a
|
||||
@scheme[hierarchical-list%] return instances of
|
||||
@scheme[hierarchical-item-snip%] and @scheme[hierarchical-list-snip%].
|
||||
@racket[hierarchical-list%] return instances of
|
||||
@racket[hierarchical-item-snip%] and @racket[hierarchical-list-snip%].
|
||||
|
||||
@defclass[hierarchical-item-snip% editor-snip% ()]{
|
||||
|
||||
@defmethod[(get-item) (is-a?/c hierarchical-list-item<%>)]{
|
||||
|
||||
Returns the @scheme[hierarchical-list-item<%>] corresponding to the
|
||||
Returns the @racket[hierarchical-list-item<%>] corresponding to the
|
||||
snip.}
|
||||
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ The @xmethod[text% find-snip] method of the editor in a
|
|||
|
||||
@defmethod[(get-item) (is-a?/c hierarchical-list-compound-item<%>)]{
|
||||
|
||||
Returns the @scheme[hierarchical-list-compound-item<%>] corresponding to the
|
||||
Returns the @racket[hierarchical-list-compound-item<%>] corresponding to the
|
||||
snip.}
|
||||
|
||||
@defmethod[(get-content-buffer) (is-a?/c text%)]{
|
||||
|
|
|
@ -18,7 +18,7 @@ up an image.
|
|||
void?]{
|
||||
Draws @racket[image] in @racket[dc] at the position (@racket[dx],@racket[dy]).
|
||||
}
|
||||
|
||||
|
||||
@defproc[(image? [v any/c]) boolean?]{
|
||||
Recognizes the images that library handles.
|
||||
}
|
||||
|
|
|
@ -4,28 +4,28 @@
|
|||
|
||||
@title{Include Bitmap}
|
||||
|
||||
@defmodule[mrlib/include-bitmap]{The @scheme[include-bitmap] form
|
||||
@defmodule[mrlib/include-bitmap]{The @racket[include-bitmap] form
|
||||
takes a filename containing a bitmap and ``inlines'' the bitmap into
|
||||
the program.}
|
||||
|
||||
Historically, the advantage of inlining the bitmap is that a
|
||||
stand-alone executable can be created that contains the bitmap and
|
||||
does not refer to the original image file. The
|
||||
@scheme[define-runtime-path] form, however, now provides a better
|
||||
@racket[define-runtime-path] form, however, now provides a better
|
||||
alternative.
|
||||
|
||||
@defform*[[(include-bitmap path-spec)
|
||||
(include-bitmap path-spec type-expr)]]{
|
||||
|
||||
|
||||
The @scheme[path-spec] is the same as for @scheme[include] form. The
|
||||
@scheme[type-expr] should produce @scheme['unknown],
|
||||
@scheme['unknown/mask], etc., as for @scheme[bitmap%], and the default
|
||||
is @scheme['unknown/mask].}
|
||||
The @racket[path-spec] is the same as for @racket[include] form. The
|
||||
@racket[type-expr] should produce @racket['unknown],
|
||||
@racket['unknown/mask], etc., as for @racket[bitmap%], and the default
|
||||
is @racket['unknown/mask].}
|
||||
|
||||
|
||||
@defform*[[(include-bitmap/relative-to source path-spec)
|
||||
(include-bitmap/relative-to source path-spec [type-expr])]]{
|
||||
|
||||
Analogous to @scheme[include-at/relative-to], though only a source is
|
||||
Analogous to @racket[include-at/relative-to], though only a source is
|
||||
needed (no context).}
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
|
||||
@defproc[(set-interactive-display-handler [port output-port?]) void?]{
|
||||
|
||||
Sets @scheme[port]'s display handler (via
|
||||
@scheme[port-display-handler]) so that when it encounters these
|
||||
Sets @racket[port]'s display handler (via
|
||||
@racket[port-display-handler]) so that when it encounters these
|
||||
values:
|
||||
|
||||
@itemize[
|
||||
|
@ -20,21 +20,21 @@ values:
|
|||
|
||||
]
|
||||
|
||||
it uses @scheme[write-special] to send snips to the port,
|
||||
it uses @racket[write-special] to send snips to the port,
|
||||
instead of those values. Otherwise, it behaves like the
|
||||
default handler.
|
||||
|
||||
To show values embedded in lists and other compound object, it uses
|
||||
@scheme[pretty-print].}
|
||||
@racket[pretty-print].}
|
||||
|
||||
|
||||
@defproc[(set-interactive-write-handler [port output-port?]) void?]{
|
||||
|
||||
Like @scheme[set-interactive-display-handler], but sets the
|
||||
@scheme[port-write-handler].}
|
||||
Like @racket[set-interactive-display-handler], but sets the
|
||||
@racket[port-write-handler].}
|
||||
|
||||
|
||||
@defproc[(set-interactive-print-handler [port output-port?]) void?]{
|
||||
|
||||
Like @scheme[set-interactive-display-handler], but sets the
|
||||
@scheme[port-print-handler].}
|
||||
Like @racket[set-interactive-display-handler], but sets the
|
||||
@racket[port-print-handler].}
|
||||
|
|
|
@ -71,7 +71,7 @@ saying that there is no file name until the file is saved.}
|
|||
the label is determined by
|
||||
the @method[name-message% set-message].
|
||||
}
|
||||
|
||||
|
||||
@defmethod[(get-background-color) (or/c #f (is-a/c color%) string?)]{
|
||||
|
||||
The result of this method is used for the background color
|
||||
|
|
|
@ -8,11 +8,11 @@
|
|||
|
||||
@defclass[path-dialog% dialog% ()]{
|
||||
|
||||
The @scheme[path-dialog%] class implements a platform-independent
|
||||
The @racket[path-dialog%] class implements a platform-independent
|
||||
file/directory dialog. The dialog is similar in functionality to the
|
||||
@scheme[get-file], @scheme[put-file], @scheme[get-directory], and
|
||||
@scheme[get-file-list] procedures, but considerable extra functionality
|
||||
is available through the @scheme[path-dialog%] class.
|
||||
@racket[get-file], @racket[put-file], @racket[get-directory], and
|
||||
@racket[get-file-list] procedures, but considerable extra functionality
|
||||
is available through the @racket[path-dialog%] class.
|
||||
|
||||
|
||||
@defconstructor[([label (or/c label-string? false/c) #f]
|
||||
|
@ -34,79 +34,79 @@ is available through the @scheme[path-dialog%] class.
|
|||
[ok? (or/c (path? . -> . any) false/c) #f]
|
||||
[guard (or/c (path? . -> . any) false/c) #f])]{
|
||||
|
||||
The @scheme[label] argument is the dialog's title string. If
|
||||
@scheme[label] is @scheme[#f], the default is based on other field
|
||||
The @racket[label] argument is the dialog's title string. If
|
||||
@racket[label] is @racket[#f], the default is based on other field
|
||||
values.
|
||||
|
||||
The @scheme[message] argument is a prompt message to show at the top
|
||||
of the dialog. If it is @scheme[#f], no prompt line.
|
||||
The @racket[message] argument is a prompt message to show at the top
|
||||
of the dialog. If it is @racket[#f], no prompt line.
|
||||
|
||||
The @scheme[parent] argument is the parent frame or dialog, if any,
|
||||
The @racket[parent] argument is the parent frame or dialog, if any,
|
||||
for this dialog.
|
||||
|
||||
The @scheme[directory] argument specifies the dialog's initial
|
||||
directory. If it is @scheme[#f], the initial directory is the last
|
||||
The @racket[directory] argument specifies the dialog's initial
|
||||
directory. If it is @racket[#f], the initial directory is the last
|
||||
directory that was used by the user (or the current directory on first
|
||||
use).
|
||||
|
||||
The @scheme[filename] argument provides an initial filename text, if
|
||||
The @racket[filename] argument provides an initial filename text, if
|
||||
any.
|
||||
|
||||
If @scheme[put?] is true, the dialog operates in choose-file-to-write
|
||||
If @racket[put?] is true, the dialog operates in choose-file-to-write
|
||||
mode (and warn the user if choosing an existing name).
|
||||
|
||||
If @scheme[dir?] is true, the dialog operates in directory-choice
|
||||
If @racket[dir?] is true, the dialog operates in directory-choice
|
||||
mode.
|
||||
|
||||
If @scheme[existing?] is true, the use must choose an existing file.
|
||||
If @racket[existing?] is true, the use must choose an existing file.
|
||||
|
||||
If @scheme[new?] is true, the user must choose a non-existant
|
||||
path. Providing both @scheme[new?] and @scheme[existing?] as true
|
||||
If @racket[new?] is true, the user must choose a non-existant
|
||||
path. Providing both @racket[new?] and @racket[existing?] as true
|
||||
triggers an exception.
|
||||
|
||||
If @scheme[multi?] is true, the dialog allows selection of multiple
|
||||
If @racket[multi?] is true, the dialog allows selection of multiple
|
||||
paths.
|
||||
|
||||
If @scheme[can-mkdir?] is true, the dialog includes a button for the
|
||||
If @racket[can-mkdir?] is true, the dialog includes a button for the
|
||||
user to create a new directory.
|
||||
|
||||
The @scheme[filters] argument is one of:
|
||||
The @racket[filters] argument is one of:
|
||||
|
||||
@itemize[
|
||||
|
||||
@item{@scheme[(list (list _filter-name _filter-glob) ...)] --- a
|
||||
list of pattern names (e.g., @scheme["Scheme Files"]) and glob
|
||||
patterns (e.g., @scheme["*.rkt;*.scrbl"]). Any list, including an
|
||||
@item{@racket[(list (list _filter-name _filter-glob) ...)] --- a
|
||||
list of pattern names (e.g., @racket["Scheme Files"]) and glob
|
||||
patterns (e.g., @racket["*.rkt;*.scrbl"]). Any list, including an
|
||||
empty list, enables a filter box for the user to enter glob
|
||||
patterns, and the given list of choices is available in a
|
||||
combo-box drop-down menu. Glob patterns are the usual Unix ones
|
||||
(see @scheme[glob->regexp]), and a semicolon can be used to allow
|
||||
(see @racket[glob->regexp]), and a semicolon can be used to allow
|
||||
multiple patterns.}
|
||||
|
||||
@item{@scheme[#f] --- no patterns and no filter input box.}
|
||||
@item{@racket[#f] --- no patterns and no filter input box.}
|
||||
|
||||
@item{@scheme[#t] --- use a generic @scheme["All"] filter, which is
|
||||
@scheme["*.*"] on Windows and @scheme["*"] on other
|
||||
@item{@racket[#t] --- use a generic @racket["All"] filter, which is
|
||||
@racket["*.*"] on Windows and @racket["*"] on other
|
||||
platforms.}
|
||||
|
||||
]
|
||||
|
||||
The @scheme[show-file?] predicate is used to filter file paths that
|
||||
The @racket[show-file?] predicate is used to filter file paths that
|
||||
are shown in the dialog. The predicate is applied to the file name as
|
||||
a string while the current-directory parameter is set. This predicate
|
||||
is intended to be a lightweight filter for choosing which names to
|
||||
display.
|
||||
|
||||
The @scheme[show-dir?] predicate is similar, but for directories
|
||||
The @racket[show-dir?] predicate is similar, but for directories
|
||||
instead of files.
|
||||
|
||||
The @scheme[ok?] predicate is used in a similar fashion to the
|
||||
@scheme[show-file?] and @scheme[show-dir?] predicate, but it is used
|
||||
The @racket[ok?] predicate is used in a similar fashion to the
|
||||
@racket[show-file?] and @racket[show-dir?] predicate, but it is used
|
||||
to determine whether the @onscreen{OK} button should be enabled when a
|
||||
file or directory is selected (so it need not be as lightweight as the
|
||||
other predicates).
|
||||
|
||||
The @scheme[guard] procedure is a generic verifier for the dialog's
|
||||
The @racket[guard] procedure is a generic verifier for the dialog's
|
||||
final result, as produced by the @method[path-dialog% run] method. It
|
||||
receives the result that is about to be returned (which can be a list
|
||||
in a multi-selection dialog), and can return a different value (any
|
||||
|
@ -119,9 +119,9 @@ message.}
|
|||
|
||||
@defmethod[(run) any/c]{
|
||||
|
||||
Shows the dialog and returns the selected result. If a @scheme[guard]
|
||||
Shows the dialog and returns the selected result. If a @racket[guard]
|
||||
procedure is not supplied when the dialog is created, then the result
|
||||
is either a path or a list of paths (and the latter only when
|
||||
@scheme[_multi?] is true when the dialog is created). If a
|
||||
@scheme[_guard] procedure is supplied, its result determines the result
|
||||
@racket[_multi?] is true when the dialog is created). If a
|
||||
@racket[_guard] procedure is supplied, its result determines the result
|
||||
of this method.}}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
@title{Plot}
|
||||
|
||||
@defmodule[mrlib/plot]{The @schememodname[mrlib/plot] library provides
|
||||
@defmodule[mrlib/plot]{The @racketmodname[mrlib/plot] library provides
|
||||
a simple tool for plotting data values to a device context.}
|
||||
|
||||
@defstruct[data-set ([points (listof (is-a?/c point%))]
|
||||
|
@ -14,9 +14,9 @@ a simple tool for plotting data values to a device context.}
|
|||
[min-y real?]
|
||||
[max-y real?])]{
|
||||
|
||||
The @scheme[points] field contains the data values to plot, and
|
||||
@scheme[connected?] indicates whether the points are connected by a
|
||||
line. The @scheme[pen] field provides a pen for plotting
|
||||
The @racket[points] field contains the data values to plot, and
|
||||
@racket[connected?] indicates whether the points are connected by a
|
||||
line. The @racket[pen] field provides a pen for plotting
|
||||
points/lines. The remaining fields determine the plotting area within
|
||||
a drawing context.}
|
||||
|
||||
|
@ -30,9 +30,9 @@ a drawing context.}
|
|||
[x-axis-label string?]
|
||||
[y-axis-label string?])]{
|
||||
|
||||
Configures a plot. The @scheme[grid?] field determines whether to draw
|
||||
a grid at axis markings, and the @scheme[x-axis-marking] and
|
||||
@scheme[y-axis-marking] lists supply locations for marks on each
|
||||
Configures a plot. The @racket[grid?] field determines whether to draw
|
||||
a grid at axis markings, and the @racket[x-axis-marking] and
|
||||
@racket[y-axis-marking] lists supply locations for marks on each
|
||||
axis. The other fields are self-explanatory.}
|
||||
|
||||
@defproc[(plot [dc (is-a?/c dc<%>)]
|
||||
|
@ -40,6 +40,6 @@ axis. The other fields are self-explanatory.}
|
|||
[setup plot-setup?])
|
||||
void?]{
|
||||
|
||||
Draws the @scheme[data-set]s in @scheme[data] into the given
|
||||
@scheme[dc]. Uses drawing-context coordinates in @scheme[data-set]s
|
||||
Draws the @racket[data-set]s in @racket[data] into the given
|
||||
@racket[dc]. Uses drawing-context coordinates in @racket[data-set]s
|
||||
that will accommodate all of the data sets.}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
@defclass[switchable-button% canvas% ()]{
|
||||
|
||||
A @scheme[switchable-button%] control displays
|
||||
A @racket[switchable-button%] control displays
|
||||
and icon and a string label. It toggles between
|
||||
display of just the icon and a display with the
|
||||
label and the icon side-by-side.
|
||||
|
@ -17,15 +17,15 @@
|
|||
[bitmap (is-a?/c bitmap%)]
|
||||
[alternate-bitmap (is-a?/c bitmap%) bitmap]
|
||||
[vertical-tight? boolean? #f])]{
|
||||
The @scheme[callback] is called when the button
|
||||
is pressed. The @scheme[string] and @scheme[bitmap] are
|
||||
The @racket[callback] is called when the button
|
||||
is pressed. The @racket[string] and @racket[bitmap] are
|
||||
used as discussed above.
|
||||
|
||||
If @scheme[alternate-bitmap] is supplied, then it is used
|
||||
If @racket[alternate-bitmap] is supplied, then it is used
|
||||
when the button is switched to the view that just shows the bitmap.
|
||||
If it is not supplied, both modes show the same bitmap.
|
||||
|
||||
If the @scheme[vertical-tight?] argument is @scheme[#t], then the button takes up
|
||||
If the @racket[vertical-tight?] argument is @racket[#t], then the button takes up
|
||||
as little as possible vertical space.
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
DrRacket uses with its @tt{control-\} (or @tt{command-\}) strings to
|
||||
their corresponding unicode characters. For example, it contains
|
||||
this mapping:
|
||||
@schemeblock[
|
||||
@racketblock[
|
||||
("alpha" "α")
|
||||
]
|
||||
as well as many more.
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
Classes that implement this interface can be autosaved.
|
||||
@defmethod*[(((do-autosave) void?))]{
|
||||
This method is called when the object is registered to be
|
||||
autosaved (see @scheme[autosave:register]).
|
||||
autosaved (see @racket[autosave:register]).
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
Mixins that implement this interface initialize the
|
||||
background color of the canvas to the value of the
|
||||
@index{'framework:basic-canvas-background}
|
||||
@scheme['framework:basic-canvas-background] preference.
|
||||
@racket['framework:basic-canvas-background] preference.
|
||||
Adds a callback so that when that preference is modified,
|
||||
the background color changes.
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
|||
}
|
||||
@defmixin[canvas:delegate-mixin (canvas:basic<%>) (canvas:delegate<%>)]{
|
||||
Provides an implementation of
|
||||
@scheme[canvas:delegate<%>].
|
||||
@racket[canvas:delegate<%>].
|
||||
@defmethod*[#:mode override (((on-superwindow-show (shown? boolean?)) void?))]{
|
||||
|
||||
Notifies the delegate window when the original window is
|
||||
|
@ -51,7 +51,7 @@
|
|||
}
|
||||
@definterface[canvas:wide-snip<%> (canvas:basic<%>)]{
|
||||
Any
|
||||
@scheme[canvas%]
|
||||
@racket[canvas%]
|
||||
that matches this interface will automatically
|
||||
resize selected snips when its size changes. Use
|
||||
@method[canvas:wide-snip<%> add-tall-snip]
|
||||
|
@ -66,14 +66,11 @@
|
|||
Snips passed to this method will be resized when the canvas's size
|
||||
changes. Their width will be set so they take up all of the space
|
||||
from their lefts to the right edge of the canvas.
|
||||
|
||||
|
||||
}
|
||||
@defmethod*[(((add-tall-snip (snip (is-a?/c snip%))) void?))]{
|
||||
Snips passed to this method will be resized when the canvas's size
|
||||
changes. Their height will be set so they take up all of the space
|
||||
from their tops to the bottom of the canvas.
|
||||
|
||||
}
|
||||
}
|
||||
@defmixin[canvas:wide-snip-mixin (canvas:basic<%>) (canvas:wide-snip<%>)]{
|
||||
|
|
|
@ -28,99 +28,93 @@
|
|||
(pairs (listof (list/c symbol? symbol?)))) void?))]{
|
||||
Starts tokenizing the buffer for coloring and parenthesis matching.
|
||||
|
||||
The @scheme[token-sym->style] argument will be passed the first return symbol from @scheme[get-token],
|
||||
and it should return the style-name that the token should be colored.
|
||||
The @racket[token-sym->style] argument will be passed the first return
|
||||
symbol from @racket[get-token], and it should return the style-name that
|
||||
the token should be colored.
|
||||
|
||||
The @scheme[get-token] argument takes an input port and optionally an offset and mode value.
|
||||
When it accepts just an input port, @scheme[get-token] returns the next token as 5 values:
|
||||
The @racket[get-token] argument takes an input port and optionally an
|
||||
offset and mode value. When it accepts just an input port,
|
||||
@racket[get-token] returns the next token as 5 values:
|
||||
|
||||
@itemize[
|
||||
@item{
|
||||
An unused value. This value is intended to represent the textual
|
||||
component of the token and may be used as such in the future.}
|
||||
@item{
|
||||
A symbol describing the type of the token. This symbol is transformed
|
||||
into a style-name via the @scheme[token-sym->style] argument. The symbols
|
||||
@scheme['white-space] and @scheme['comment] have special meaning and should always be
|
||||
returned for white space and comment tokens respectively. The symbol
|
||||
@scheme['no-color] can be used to indicate that although the token is not white
|
||||
space, it should not be colored. The symbol @scheme['eof] must be used to
|
||||
indicate when all the tokens have been consumed.}
|
||||
@item{
|
||||
A symbol indicating how the token should be treated by the paren
|
||||
matcher or @scheme[#f]. This symbol should be in the pairs argument.}
|
||||
@item{
|
||||
The starting position of the token (or @scheme[#f] if eof).}
|
||||
@item{
|
||||
The ending position of the token (or @scheme[#f] if eof).}]
|
||||
@item{An unused value. This value is intended to represent the textual
|
||||
component of the token and may be used as such in the future.}
|
||||
@item{A symbol describing the type of the token. This symbol is
|
||||
transformed into a style-name via the @racket[token-sym->style] argument.
|
||||
The symbols @racket['white-space] and @racket['comment] have special
|
||||
meaning and should always be returned for white space and comment tokens
|
||||
respectively. The symbol @racket['no-color] can be used to indicate that
|
||||
although the token is not white space, it should not be colored. The
|
||||
symbol @racket['eof] must be used to indicate when all the tokens have
|
||||
been consumed.}
|
||||
@item{A symbol indicating how the token should be treated by the paren
|
||||
matcher or @racket[#f]. This symbol should be in the pairs argument.}
|
||||
@item{The starting position of the token (or @racket[#f] if eof).}
|
||||
@item{The ending position of the token (or @racket[#f] if eof).}]
|
||||
|
||||
When @scheme[get-token] accepts an offset and mode value in addition to an
|
||||
When @racket[get-token] accepts an offset and mode value in addition to an
|
||||
input port, it must also return two extra results, which are a backup
|
||||
distance and new mode. The offset given to @scheme[get-token] can be added
|
||||
to the position of the input port to obtain absolute coordinates within a
|
||||
text stream. The mode argument allows @scheme[get-token] to communicate information
|
||||
from earlier parsing to later.
|
||||
When @scheme[get-token] is called for the beginning on a
|
||||
stream, the mode argument is @scheme[#f]; thereafter, the mode
|
||||
returned for the previous token is provided to @scheme[get-token]
|
||||
for the next token. The mode should not be a mutable value; if
|
||||
part of the stream is re-tokenized, the mode saved from the
|
||||
immediately preceding token is given again to the
|
||||
@scheme[get-token] function. The backup distance returned by @scheme[get-token]
|
||||
indicates the maximum number of characters to back up (counting from the start of the token)
|
||||
and for re-parsing after a change to the editor within the token's region.
|
||||
distance and new mode. The offset given to @racket[get-token] can be added
|
||||
to the position of the input port to obtain absolute coordinates within a
|
||||
text stream. The mode argument allows @racket[get-token] to communicate
|
||||
information from earlier parsing to later. When @racket[get-token] is
|
||||
called for the beginning on a stream, the mode argument is @racket[#f];
|
||||
thereafter, the mode returned for the previous token is provided to
|
||||
@racket[get-token] for the next token. The mode should not be a mutable
|
||||
value; if part of the stream is re-tokenized, the mode saved from the
|
||||
immediately preceding token is given again to the @racket[get-token]
|
||||
function. The backup distance returned by @racket[get-token] indicates the
|
||||
maximum number of characters to back up (counting from the start of the
|
||||
token) and for re-parsing after a change to the editor within the token's
|
||||
region.
|
||||
|
||||
The @scheme[get-token] function is usually be implemented with a lexer using the
|
||||
@scheme[parser-tools/lex] library. The
|
||||
@scheme[get-token] function must obey the following invariants:
|
||||
The @racket[get-token] function is usually be implemented with a lexer using the
|
||||
@racket[parser-tools/lex] library. The
|
||||
@racket[get-token] function must obey the following invariants:
|
||||
@itemize[
|
||||
@item{
|
||||
Every position in the buffer must be accounted for in exactly one
|
||||
token, and every token must have a non-zero width.}
|
||||
@item{
|
||||
The token returned by @scheme[get-token] must rely only on the contents of the
|
||||
input port argument plus the mode argument. This constraint means that the
|
||||
tokenization of some part of the input cannot depend on earlier parts of the
|
||||
input except through the mode (and implicitly through the starting positions
|
||||
for tokens).}
|
||||
@item{
|
||||
A change to the stream must not change the tokenization of the stream prior
|
||||
to the token immediately preceding the change plus the backup distance. In the following
|
||||
example, this invariant does not hold for a zero backup distance: If the buffer contains
|
||||
@verbatim[#:indent 2]{" 1 2 3}
|
||||
and the tokenizer treats the unmatched " as its own token (a string
|
||||
error token), and separately tokenizes the 1 2 and 3, an edit to make
|
||||
the buffer look like
|
||||
@verbatim[#:indent 2]{" 1 2 3"}
|
||||
would result in a single string token modifying previous tokens. To
|
||||
handle these situations, @scheme[get-token] can treat the first line as a
|
||||
single token, or it can precisely track backup distances.}]
|
||||
@item{Every position in the buffer must be accounted for in exactly one
|
||||
token, and every token must have a non-zero width.}
|
||||
@item{The token returned by @racket[get-token] must rely only on the
|
||||
contents of the input port argument plus the mode argument. This
|
||||
constraint means that the tokenization of some part of the input cannot
|
||||
depend on earlier parts of the input except through the mode (and
|
||||
implicitly through the starting positions for tokens).}
|
||||
@item{A change to the stream must not change the tokenization of the
|
||||
stream prior to the token immediately preceding the change plus the
|
||||
backup distance. In the following example, this invariant does not hold
|
||||
for a zero backup distance: If the buffer contains
|
||||
@verbatim[#:indent 2]{" 1 2 3}
|
||||
and the tokenizer treats the unmatched " as its own token (a string error
|
||||
token), and separately tokenizes the 1 2 and 3, an edit to make the
|
||||
buffer look like
|
||||
@verbatim[#:indent 2]{" 1 2 3"}
|
||||
would result in a single string token modifying previous tokens. To
|
||||
handle these situations, @racket[get-token] can treat the first line as a
|
||||
single token, or it can precisely track backup distances.}]
|
||||
|
||||
The @scheme[pairs] argument is a list of different kinds of matching parens. The second
|
||||
value returned by @scheme[get-token] is compared to this list to see how the
|
||||
paren matcher should treat the token. An example: Suppose pairs is
|
||||
@scheme['((|(| |)|) (|[| |]|) (begin end))]. This means that there
|
||||
are three kinds of parens. Any token which has @scheme['begin] as its second
|
||||
return value will act as an open for matching tokens with @scheme['end].
|
||||
Similarly any token with @scheme['|]|] will act as a closing match for
|
||||
tokens with @scheme['|[|]. When trying to correct a mismatched
|
||||
closing parenthesis, each closing symbol in pairs will be converted to
|
||||
a string and tried as a closing parenthesis.
|
||||
The @racket[pairs] argument is a list of different kinds of matching
|
||||
parens. The second value returned by @racket[get-token] is compared to
|
||||
this list to see how the paren matcher should treat the token. An example:
|
||||
Suppose pairs is @racket['((|(| |)|) (|[| |]|) (begin end))]. This means
|
||||
that there are three kinds of parens. Any token which has @racket['begin]
|
||||
as its second return value will act as an open for matching tokens with
|
||||
@racket['end]. Similarly any token with @racket['|]|] will act as a
|
||||
closing match for tokens with @racket['|[|]. When trying to correct a
|
||||
mismatched closing parenthesis, each closing symbol in pairs will be
|
||||
converted to a string and tried as a closing parenthesis.
|
||||
}
|
||||
@defmethod*[(((stop-colorer (clear-colors boolean? #t)) void?))]{
|
||||
Stops coloring and paren matching the buffer.
|
||||
|
||||
|
||||
If @scheme[clear-colors] is true all the text in the buffer will have its
|
||||
If @racket[clear-colors] is true all the text in the buffer will have its
|
||||
style set to Standard.
|
||||
}
|
||||
@defmethod*[(((force-stop-colorer (stop? boolean?)) void?))]{
|
||||
Causes the entire tokenizing/coloring system to become inactive.
|
||||
Intended for debugging purposes only.
|
||||
|
||||
|
||||
@scheme[stop?] determines whether the system is being forced to stop or allowed
|
||||
to wake back up.
|
||||
@racket[stop?] determines whether the system is being forced to stop or
|
||||
allowed to wake back up.
|
||||
}
|
||||
@defmethod*[(((is-stopped?) boolean?))]{
|
||||
Indicates if the colorer for this editor has been stopped, or not.
|
||||
|
@ -136,21 +130,20 @@
|
|||
@defmethod*[(((freeze-colorer) void?))]{
|
||||
Keep the text tokenized and paren matched, but stop altering the colors.
|
||||
|
||||
@scheme[freeze-colorer] will not return until the coloring/tokenization of the
|
||||
entire text is brought up-to-date. It must not be called on a locked
|
||||
@racket[freeze-colorer] will not return until the coloring/tokenization of
|
||||
the entire text is brought up-to-date. It must not be called on a locked
|
||||
text.
|
||||
}
|
||||
@defmethod*[(((thaw-colorer (recolor boolean? #t) (retokenize boolean? #f)) void?))]{
|
||||
Start coloring a frozen buffer again.
|
||||
|
||||
|
||||
If @scheme[recolor?] is @scheme[#t], the text is re-colored. If it is
|
||||
@scheme[#f] the text is not recolored. When @scheme[recolor?] is @scheme[#t],
|
||||
@scheme[retokenize?] controls how the text is recolored. @scheme[#f] causes
|
||||
the text to be entirely re-colored before thaw-colorer returns using
|
||||
the existing tokenization. @scheme[#t] causes the entire text to be
|
||||
retokenized and recolored from scratch. This will happen in the
|
||||
background after the call to @scheme[thaw-colorer] returns.
|
||||
If @racket[recolor?] is @racket[#t], the text is re-colored. If it is
|
||||
@racket[#f] the text is not recolored. When @racket[recolor?] is
|
||||
@racket[#t], @racket[retokenize?] controls how the text is recolored.
|
||||
@racket[#f] causes the text to be entirely re-colored before thaw-colorer
|
||||
returns using the existing tokenization. @racket[#t] causes the entire
|
||||
text to be retokenized and recolored from scratch. This will happen in the
|
||||
background after the call to @racket[thaw-colorer] returns.
|
||||
|
||||
}
|
||||
@defmethod*[(((reset-region (start natural-number/c) (end (or/c (quote end) natural-number/c))) void?))]{
|
||||
|
@ -159,90 +152,92 @@
|
|||
}
|
||||
@defmethod*[(((reset-regions (regions (listof (list/c number? (or/c (quote end) number?))))) void?))]{
|
||||
|
||||
Sets the currently active regions to be @scheme[regions].
|
||||
Sets the currently active regions to be @racket[regions].
|
||||
}
|
||||
@defmethod*[(((get-regions) (listof (list/c number? (or/c (quote end) number?)))))]{
|
||||
This returns the list of regions that are currently being colored in the editor.
|
||||
This returns the list of regions that are currently being colored in the
|
||||
editor.
|
||||
|
||||
}
|
||||
@defmethod*[(((skip-whitespace (position natural-number/c) (direction (symbols (quote forward) (quote backward))) (comments? boolean?)) natural-number/c))]{
|
||||
Returns the next non-whitespace character.
|
||||
|
||||
Starts from position and skips whitespace in the direction indicated
|
||||
by direction. If @scheme[comments?] is true, comments are skipped as well as
|
||||
Starts from position and skips whitespace in the direction indicated by
|
||||
direction. If @racket[comments?] is true, comments are skipped as well as
|
||||
whitespace. skip-whitespace determines whitespaces and comments by
|
||||
comparing the token type to @scheme['white-space] and @scheme['comment].
|
||||
comparing the token type to @racket['white-space] and @racket['comment].
|
||||
|
||||
Must only be called while the tokenizer is started.
|
||||
}
|
||||
@defmethod*[(((backward-match (position natural-number/c) (cutoff natural-number/c)) (or/c natural-number/c false?)))]{
|
||||
|
||||
Skip all consecutive whitespaces and comments (using @scheme[skip-whitespace])
|
||||
immediately preceding the position. If the token at this position is
|
||||
a close, return the position of the matching open, or @scheme[#f] if
|
||||
there is none. If the token was an open, return @scheme[#f]. For any
|
||||
other token, return the start of that token.
|
||||
Skip all consecutive whitespaces and comments (using
|
||||
@racket[skip-whitespace]) immediately preceding the position. If the token
|
||||
at this position is a close, return the position of the matching open, or
|
||||
@racket[#f] if there is none. If the token was an open, return
|
||||
@racket[#f]. For any other token, return the start of that token.
|
||||
|
||||
Must only be called while the tokenizer is started.
|
||||
}
|
||||
@defmethod*[(((backward-containing-sexp (position natural-number/c) (cutoff natural-number/c)) (or/c natural-number/c false?)))]{
|
||||
|
||||
Return the starting position of the interior of the (non-atomic)
|
||||
s-expression containing position, or @scheme[#f] is there is none.
|
||||
s-expression containing position, or @racket[#f] is there is none.
|
||||
|
||||
Must only be called while the tokenizer is started.
|
||||
}
|
||||
@defmethod*[(((forward-match (position natural-number/c) (cutoff natural-number/c)) (or/c natural-number/c false?)))]{
|
||||
|
||||
Skip all consecutive whitespaces and comments (using @scheme[skip-whitespace])
|
||||
immediately following position. If the token at this position is an
|
||||
open, return the position of the matching close, or @scheme[#f] if
|
||||
there is none. For any other token, return the end of that token.
|
||||
Skip all consecutive whitespaces and comments (using
|
||||
@racket[skip-whitespace]) immediately following position. If the token at
|
||||
this position is an open, return the position of the matching close, or
|
||||
@racket[#f] if there is none. For any other token, return the end of that
|
||||
token.
|
||||
|
||||
Must only be called while the tokenizer is started.
|
||||
}
|
||||
@defmethod*[(((insert-close-paren (position natural-number/c) (char char?) (flash? boolean?) (fixup? boolean?)) void?))]{
|
||||
|
||||
The @scheme[position] is the place to put the parenthesis, and @scheme[char] is the
|
||||
parenthesis to be added (e.g., that the user typed). If @scheme[fixup?] is true, the right kind of closing
|
||||
parenthesis will be chosen from the set previously passed to
|
||||
@scheme[start-colorer]---but only if an inserted @scheme[char] would be colored
|
||||
as a parenthesis (i.e., with the @scheme['parenthesis] classification).
|
||||
Otherwise, @scheme[char] will be inserted, even if it is not the
|
||||
right kind. If @scheme[flash?] is true, the matching open parenthesis will be
|
||||
flashed.
|
||||
The @racket[position] is the place to put the parenthesis, and
|
||||
@racket[char] is the parenthesis to be added (e.g., that the user typed).
|
||||
If @racket[fixup?] is true, the right kind of closing parenthesis will be
|
||||
chosen from the set previously passed to @racket[start-colorer]---but only
|
||||
if an inserted @racket[char] would be colored as a parenthesis (i.e., with
|
||||
the @racket['parenthesis] classification). Otherwise, @racket[char] will
|
||||
be inserted, even if it is not the right kind. If @racket[flash?] is true,
|
||||
the matching open parenthesis will be flashed.
|
||||
}
|
||||
@defmethod*[(((classify-position (position exact-nonnegative-integer?)) symbol?))]{
|
||||
|
||||
|
||||
Return a symbol for the lexer-determined token type for the token that
|
||||
contains the item after @scheme[position].
|
||||
contains the item after @racket[position].
|
||||
|
||||
Must only be called while the tokenizer is started.
|
||||
}
|
||||
|
||||
|
||||
@defmethod[(get-token-range [position exact-nonnegative-integer?])
|
||||
(values (or/c #f exact-nonnegative-integer?)
|
||||
(or/c #f exact-nonnegative-integer?))]{
|
||||
|
||||
Returns the range of the token surrounding @racket[position], if there is a token there.
|
||||
|
||||
|
||||
Returns the range of the token surrounding @racket[position], if there is a
|
||||
token there.
|
||||
|
||||
This method must be called only when the tokenizer is started.
|
||||
|
||||
}
|
||||
|
||||
|
||||
@defmethod[#:mode augment (on-lexer-valid [valid? boolean?]) any]{
|
||||
This method is an observer for when the lexer is working.
|
||||
It is called when the lexer's state changes from valid to invalid (and back).
|
||||
The @racket[valid?] argument indicates if the lexer has finished running over the editor (or not).
|
||||
|
||||
This method is an observer for when the lexer is working. It is called
|
||||
when the lexer's state changes from valid to invalid (and back). The
|
||||
@racket[valid?] argument indicates if the lexer has finished running over
|
||||
the editor (or not).
|
||||
|
||||
The default method just returns @racket[(void?)].
|
||||
}
|
||||
|
||||
|
||||
@defmethod[#:mode public-final (is-lexer-valid?) boolean?]{
|
||||
Indicates if the lexer is currently valid for this editor.
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@defmixin[color:text-mixin (text:basic<%>) (color:text<%>)]{
|
||||
Adds the functionality needed for on-the-fly coloring and parenthesis
|
||||
|
|
|
@ -9,40 +9,26 @@
|
|||
DrRacket.
|
||||
|
||||
@defmethod*[#:mode override (((make-editor) (is-a?/c text%)))]{
|
||||
Makes an instance of
|
||||
@racketblock[(scheme:text-mixin text:keymap%)]}
|
||||
|
||||
Makes an instance of
|
||||
@schemeblock[
|
||||
(scheme:text-mixin text:keymap%)]
|
||||
|
||||
}
|
||||
@defmethod*[#:mode override (((make-snip) (is-a?/c comment-snip%)))]{
|
||||
Returns an instance of the @racket[comment-snip%] class.}
|
||||
|
||||
Returns an instance of the
|
||||
@scheme[comment-snip%]
|
||||
class.
|
||||
}
|
||||
@defmethod*[#:mode override (((get-corner-bitmap) (is-a?/c bitmap%)))]{
|
||||
|
||||
Returns the semicolon bitmap from the file
|
||||
@schemeblock[
|
||||
(build-path (collection-path "icons") "semicolon.gif")]
|
||||
@racketblock[(build-path (collection-path "icons") "semicolon.gif")]}
|
||||
|
||||
}
|
||||
@defmethod*[#:mode override (((get-position) (symbols (quote left-top) (quote top-right))))]{
|
||||
Returns @racket['left-top]}
|
||||
|
||||
Returns @scheme['left-top]
|
||||
}
|
||||
@defmethod*[#:mode override (((get-text) string))]{
|
||||
|
||||
Returns the same string as the super method, but with
|
||||
newlines replaced by newline-semicolon-space.
|
||||
}
|
||||
newlines replaced by newline-semicolon-space.}
|
||||
|
||||
@defmethod*[#:mode override (((get-menu) (is-a?/c popup-menu%)))]{
|
||||
|
||||
Returns a menu with a single item to change the box into
|
||||
semicolon comments.
|
||||
|
||||
}
|
||||
semicolon comments.}
|
||||
}
|
||||
|
||||
@(include-previously-extracted "main-extracts.rkt" #rx"^comment-box:")
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
}
|
||||
@defmethod[(get-position) (symbols 'top-right 'left-top)]{
|
||||
Returns the location of the image and the clickable
|
||||
region. The symbol @scheme['top-right] indicates top portion is clickable
|
||||
and icon on right. The symbol @scheme['left-top] means left portion is
|
||||
region. The symbol @racket['top-right] indicates top portion is clickable
|
||||
and icon on right. The symbol @racket['left-top] means left portion is
|
||||
clickable and icon on top.
|
||||
}
|
||||
@defmethod[(reset-min-sizes) void?]{
|
||||
|
@ -29,25 +29,25 @@
|
|||
|
||||
@defmixin[editor-snip:decorated-mixin (editor-snip%) (editor-snip:decorated<%>)]{
|
||||
@defmethod[(get-corner-bitmap) (or/c false/c (is-a?/c bitmap%))]{
|
||||
Returns @scheme[#f].
|
||||
Returns @racket[#f].
|
||||
}
|
||||
@defmethod[(get-color) (or/c string? (is-a?/c color%))]{
|
||||
Returns @schemeblock[
|
||||
Returns @racketblock[
|
||||
(if (preferences:get 'framework:white-on-black?)
|
||||
"white"
|
||||
"black")]
|
||||
}
|
||||
@defmethod[(get-menu) (or/c false/c (is-a?/c popup-menu%))]{
|
||||
Returns @scheme[#f].
|
||||
Returns @racket[#f].
|
||||
}
|
||||
@defmethod[(get-position) (symbols 'top-right 'left-top)]{
|
||||
Returns @scheme['top-right].
|
||||
Returns @racket['top-right].
|
||||
}
|
||||
}
|
||||
|
||||
@defclass[editor-snip:decorated% (editor-snip:decorated-mixin editor-snip%) ()]{
|
||||
@defconstructor/auto-super[()]{
|
||||
Invokes the super constructor with the keyword @scheme[editor] as a call to
|
||||
Invokes the super constructor with the keyword @racket[editor] as a call to
|
||||
@method[editor-snip:decorated% make-editor].
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,7 @@
|
|||
Uses the @method[editor-snip:decorated% make-editor] and
|
||||
@method[editor-snip:decorated% make-snip] methods to create a
|
||||
copy of this snip, as follows:
|
||||
@schememod[
|
||||
@racketmod[
|
||||
(let ([snip (make-snip)])
|
||||
(send snip set-editor (send (get-editor) copy-self))
|
||||
(send snip set-style (get-style))
|
||||
|
@ -74,13 +74,13 @@
|
|||
|
||||
@defclass[editor-snip:decorated-snipclass% snip-class% ()]{
|
||||
@defmethod[(make-snip [stream-in (is-a?/c editor-stream-in%)]) (is-a?/c editor-snip:decorated<%>)]{
|
||||
Returns an instance of @scheme[editor-snip:decorated%].
|
||||
Returns an instance of @racket[editor-snip:decorated%].
|
||||
}
|
||||
@defmethod[(read [stream-in (is-a?/c editor-stream-in%)]) (is-a?/c editor-snip:decorated<%>)]{
|
||||
Calls @method[editor-snip:decorated-snipclass% make-snip] to get an object and
|
||||
then invokes its @scheme[editor<%>]'s @method[editor<%> read-from-file] method
|
||||
in order to read a snip from @scheme[stream-in], eg:
|
||||
@schemeblock[
|
||||
then invokes its @racket[editor<%>]'s @method[editor<%> read-from-file] method
|
||||
in order to read a snip from @racket[stream-in], eg:
|
||||
@racketblock[
|
||||
(let ([snip (make-snip stream-in)])
|
||||
(send (send snip get-editor) read-from-file stream-in #f)
|
||||
snip)
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
|
||||
@definterface[editor:basic<%> (editor<%>)]{
|
||||
Classes matching this interface support the basic
|
||||
@scheme[editor<%>]
|
||||
@racket[editor<%>]
|
||||
functionality required by the framework.
|
||||
@defmethod*[(((has-focus?) boolean?))]{
|
||||
This function returns @scheme[#t] when the editor has the keyboard
|
||||
This function returns @racket[#t] when the editor has the keyboard
|
||||
focus. It is implemented using:
|
||||
@method[editor<%> on-focus]
|
||||
|
||||
|
@ -30,11 +30,11 @@
|
|||
edit-sequence completes.
|
||||
|
||||
|
||||
The procedure @scheme[thunk] will be called immediately if the edit is
|
||||
The procedure @racket[thunk] will be called immediately if the edit is
|
||||
not in an edit-sequence. If the edit is in an edit-sequence, it will
|
||||
be called when the edit-sequence completes.
|
||||
|
||||
If @scheme[tag] is a symbol, the @scheme[thunk] is keyed on that symbol, and
|
||||
If @racket[tag] is a symbol, the @racket[thunk] is keyed on that symbol, and
|
||||
only one thunk per symbol will be called after the
|
||||
edit-sequence. Specifically, the last call to
|
||||
@method[editor:basic<%> run-after-edit-sequence]'s argument will be called.
|
||||
|
@ -42,7 +42,7 @@
|
|||
}
|
||||
@defmethod*[(((get-top-level-window) (or/c #f (is-a?/c top-level-window<%>))))]{
|
||||
Returns the
|
||||
@scheme[top-level-window<%>]
|
||||
@racket[top-level-window<%>]
|
||||
currently associated with this buffer.
|
||||
|
||||
This does not work for embedded editors.
|
||||
|
@ -50,7 +50,7 @@
|
|||
|
||||
}
|
||||
@defmethod*[(((save-file-out-of-date?) boolean?))]{
|
||||
Returns @scheme[#t] if the file on disk has been modified, by some other program.
|
||||
Returns @racket[#t] if the file on disk has been modified, by some other program.
|
||||
|
||||
}
|
||||
@defmethod*[(((save-file/gui-error (filename (or/c path? #f) #f) (format (or/c (quote guess) (quote standard) (quote text) (quote text-force-cr) (quote same) (quote copy)) (quote same)) (show-errors? boolean? #t)) boolean?))]{
|
||||
|
@ -59,8 +59,8 @@
|
|||
opens a dialog with an error message showing the error.
|
||||
|
||||
The result indicates if an error happened (the error has
|
||||
already been shown to the user). It returns @scheme[#t] if
|
||||
no error occurred and @scheme[#f] if an error occurred.
|
||||
already been shown to the user). It returns @racket[#t] if
|
||||
no error occurred and @racket[#f] if an error occurred.
|
||||
|
||||
}
|
||||
@defmethod*[(((load-file/gui-error (filename (or/c string? #f) #f) (format (or/c (quote guess) (quote standard) (quote text) (quote text-force-cr) (quote same) (quote copy)) (quote guess)) (show-errors? boolean? #t)) boolean?))]{
|
||||
|
@ -69,8 +69,8 @@
|
|||
opens a dialog with an error message showing the error.
|
||||
|
||||
The result indicates if an error happened (the error has
|
||||
already been shown to the user). It returns @scheme[#t] if
|
||||
no error occurred and @scheme[#f] if an error occurred.
|
||||
already been shown to the user). It returns @racket[#t] if
|
||||
no error occurred and @racket[#f] if an error occurred.
|
||||
|
||||
}
|
||||
@defmethod*[(((on-close) void?))]{
|
||||
|
@ -81,13 +81,9 @@
|
|||
editor is considered ``closed'' before the frame it is
|
||||
in is closed (e.g., when a tab in DrRacket is closed), and
|
||||
thus @method[editor:basic<%> on-close] will be called at that point.
|
||||
|
||||
|
||||
See also
|
||||
@method[editor:basic<%> can-close?]
|
||||
and
|
||||
@method[editor:basic<%> close].
|
||||
|
||||
See also @method[editor:basic<%> can-close?] and @method[editor:basic<%>
|
||||
close].
|
||||
|
||||
Does nothing.
|
||||
}
|
||||
|
@ -103,11 +99,11 @@
|
|||
@method[editor:basic<%> close].
|
||||
|
||||
|
||||
Returns @scheme[#t].
|
||||
Returns @racket[#t].
|
||||
}
|
||||
@defmethod*[(((close) boolean?))]{
|
||||
This method is merely
|
||||
@schemeblock[
|
||||
@racketblock[
|
||||
(if (can-close?)
|
||||
(begin (on-close) #t)
|
||||
#f)]
|
||||
|
@ -117,27 +113,25 @@
|
|||
@method[editor:basic<%> can-close?]
|
||||
and
|
||||
@method[editor:basic<%> on-close].
|
||||
|
||||
}
|
||||
@defmethod*[(((get-filename/untitled-name) string?))]{
|
||||
Returns the printed version of the filename for this
|
||||
editor. If the editor doesn't yet have a filename, it
|
||||
returns a symbolic name (something like "Untitled").
|
||||
|
||||
}
|
||||
|
||||
@defmethod[(get-pos/text [event (is-a?/c mouse-event%)])
|
||||
(values (or/c false/c number?)
|
||||
(or/c false/c (is-a?/c editor<%>)))]{
|
||||
|
||||
This method's first result is @scheme[#f] when the mouse
|
||||
This method's first result is @racket[#f] when the mouse
|
||||
event does not correspond to a location in the editor.
|
||||
|
||||
If the second result is a @scheme[text%] object, then the
|
||||
first result will be a position in the editor and
|
||||
otherwise the first result will be @scheme[#f].
|
||||
|
||||
The @scheme[editor<%>] object will always be the nearest
|
||||
If the second result is a @racket[text%] object, then the
|
||||
first result will be a position in the editor and
|
||||
otherwise the first result will be @racket[#f].
|
||||
|
||||
The @racket[editor<%>] object will always be the nearest
|
||||
enclosing editor containing the mouse click.
|
||||
}
|
||||
}
|
||||
|
@ -149,11 +143,11 @@
|
|||
mixin's argument.
|
||||
|
||||
Each instance of a class created with this mixin contains a private
|
||||
@scheme[keymap%] that is chained to the global keymap via:
|
||||
@scheme[(send keymap chain-to-keymap (keymap:get-global) #f)].
|
||||
@racket[keymap%] that is chained to the global keymap via:
|
||||
@racket[(send keymap chain-to-keymap (keymap:get-global) #f)].
|
||||
|
||||
This installs the global keymap @scheme[keymap:get-global] to
|
||||
handle keyboard and mouse mappings not handled by @scheme[keymap]. The
|
||||
This installs the global keymap @racket[keymap:get-global] to
|
||||
handle keyboard and mouse mappings not handled by @racket[keymap]. The
|
||||
global keymap is created when the framework is invoked.
|
||||
@defmethod*[#:mode augment (((can-save-file? (filename string?) (format symbol?)) boolean?))]{
|
||||
|
||||
|
@ -166,7 +160,7 @@
|
|||
@defmethod*[#:mode augment (((after-save-file (success? boolean?)) void?))]{
|
||||
|
||||
If the current filename is not a temporary filename, this method calls
|
||||
@scheme[handler:add-to-recent]with the current filename.
|
||||
@racket[handler:add-to-recent]with the current filename.
|
||||
|
||||
to add the new filename to the list of recently opened files.
|
||||
|
||||
|
@ -189,7 +183,7 @@
|
|||
}
|
||||
@defmethod*[#:mode augment (((on-edit-sequence) boolean?))]{
|
||||
|
||||
Always returns @scheme[#t]. Updates a flag for
|
||||
Always returns @racket[#t]. Updates a flag for
|
||||
@method[editor:basic<%> local-edit-sequence?]
|
||||
}
|
||||
@defmethod*[#:mode augment (((after-edit-sequence) void?))]{
|
||||
|
@ -200,21 +194,21 @@
|
|||
@defmethod*[#:mode override (((on-new-box (type (or/c (quote pasteboard) (quote text)))) (is-a?/c editor-snip%)))]{
|
||||
|
||||
Creates instances of
|
||||
@scheme[pasteboard:basic%]
|
||||
@racket[pasteboard:basic%]
|
||||
or
|
||||
@scheme[text:basic%]
|
||||
@racket[text:basic%]
|
||||
instead of the built in
|
||||
@scheme[pasteboard%]
|
||||
@racket[pasteboard%]
|
||||
and
|
||||
@scheme[text%]
|
||||
classes.
|
||||
@racket[text%]
|
||||
classes.
|
||||
}
|
||||
@defmethod[#:mode override (on-new-image-snip [filename (or/c path? false/c)]
|
||||
[kind (one-of/c 'unknown 'gif 'jpeg 'xbm 'xpm 'bmp 'pict)]
|
||||
[kind (one-of/c 'unknown 'gif 'jpeg 'xbm 'xpm 'bmp 'pict)]
|
||||
[relative-path? any/c]
|
||||
[inline? any/c])
|
||||
(is-a?/c image-snip%)]{
|
||||
@schemeblock[
|
||||
@racketblock[
|
||||
(super on-new-image-snip
|
||||
(if (eq? kind 'unknown) 'unknown/mask kind)
|
||||
relative-path?
|
||||
|
@ -224,25 +218,25 @@
|
|||
@defmethod*[#:mode override (((get-file (directory (or/c path-string? false/c))) string))]{
|
||||
|
||||
Uses
|
||||
@scheme[finder:get-file]
|
||||
@racket[finder:get-file]
|
||||
to find a filename. Also, sets the parameter
|
||||
@scheme[finder:dialog-parent-parameter]
|
||||
@racket[finder:dialog-parent-parameter]
|
||||
to the result of
|
||||
@method[editor:basic<%> get-top-level-window].
|
||||
}
|
||||
@defmethod*[#:mode override (((put-file (directory (or/c path? false/c)) (default-name (or/c path? false/c))) string))]{
|
||||
|
||||
Uses
|
||||
@scheme[finder:put-file]
|
||||
@racket[finder:put-file]
|
||||
to find a filename. Also, sets the parameter
|
||||
@scheme[finder:dialog-parent-parameter]
|
||||
@racket[finder:dialog-parent-parameter]
|
||||
to the result of
|
||||
@method[editor:basic<%> get-top-level-window].
|
||||
}
|
||||
}
|
||||
@definterface[editor:standard-style-list<%> (editor<%>)]{
|
||||
This interface is implemented by the results of
|
||||
@scheme[editor:standard-style-list-mixin].
|
||||
@racket[editor:standard-style-list-mixin].
|
||||
}
|
||||
@defmixin[editor:standard-style-list-mixin (editor<%>) (editor:standard-style-list<%>)]{
|
||||
The mixin adds code to the initialization
|
||||
|
@ -250,11 +244,11 @@
|
|||
list (via
|
||||
@method[editor<%> set-style-list])
|
||||
to the result of
|
||||
@scheme[editor:get-standard-style-list].
|
||||
@racket[editor:get-standard-style-list].
|
||||
|
||||
In addition, it calls
|
||||
@method[editor<%> set-load-overwrites-styles]
|
||||
with @scheme[#f].
|
||||
with @racket[#f].
|
||||
This ensures that saved files with different
|
||||
settings for the style list do not clobber
|
||||
the shared style list.
|
||||
|
@ -267,46 +261,46 @@
|
|||
method.
|
||||
|
||||
This editor is initialized by calling
|
||||
@scheme[add-editor-keymap-functions],
|
||||
@scheme[add-text-keymap-functions], and
|
||||
@scheme[add-pasteboard-keymap-functions].
|
||||
@racket[add-editor-keymap-functions],
|
||||
@racket[add-text-keymap-functions], and
|
||||
@racket[add-pasteboard-keymap-functions].
|
||||
@defmethod*[(((get-keymaps) (list-of (is-a?/c keymap%))))]{
|
||||
The keymaps returned from this method are chained to this
|
||||
@scheme[editor<%>]'s keymap.
|
||||
@racket[editor<%>]'s keymap.
|
||||
|
||||
The result of this method should not change -- that is, it
|
||||
should return the same list of keymaps each time it is
|
||||
called.
|
||||
|
||||
See also @scheme[editor:add-after-user-keymap].
|
||||
See also @racket[editor:add-after-user-keymap].
|
||||
|
||||
Defaultly returns @scheme[(list (keymap:get-user) (keymap:get-global))]
|
||||
Defaultly returns @racket[(list (keymap:get-user) (keymap:get-global))]
|
||||
}
|
||||
}
|
||||
@defmixin[editor:keymap-mixin (editor:basic<%>) (editor:keymap<%>)]{
|
||||
This provides a mixin that implements the
|
||||
@scheme[editor:keymap<%>]
|
||||
@racket[editor:keymap<%>]
|
||||
interface.
|
||||
}
|
||||
@definterface[editor:autowrap<%> (editor:basic<%>)]{
|
||||
Classes implementing this interface keep the
|
||||
@method[editor<%> auto-wrap]
|
||||
state set based on the
|
||||
@scheme['framework:auto-set-wrap?] preference
|
||||
(see @scheme[preferences:get] for more information about preferences).
|
||||
@racket['framework:auto-set-wrap?] preference
|
||||
(see @racket[preferences:get] for more information about preferences).
|
||||
|
||||
They install a preferences callback with
|
||||
@scheme[preferences:add-callback]
|
||||
@racket[preferences:add-callback]
|
||||
that sets the state when the preference changes and
|
||||
initialize the value of
|
||||
@method[editor<%> auto-wrap]
|
||||
to the current value of @scheme['framework:auto-set-wrap?]
|
||||
to the current value of @racket['framework:auto-set-wrap?]
|
||||
via
|
||||
@scheme[preferences:get].
|
||||
@racket[preferences:get].
|
||||
}
|
||||
@defmixin[editor:autowrap-mixin (editor:basic<%>) (editor:autowrap<%>)]{
|
||||
See
|
||||
@scheme[editor:autowrap<%>]
|
||||
@racket[editor:autowrap<%>]
|
||||
}
|
||||
@definterface[editor:file<%> (editor:keymap<%>)]{
|
||||
Objects supporting this interface are expected to support files.
|
||||
|
@ -314,8 +308,7 @@
|
|||
The result of this method is used as the parent for the
|
||||
dialog that asks about closing.
|
||||
|
||||
|
||||
Defaultly returns @scheme[#f].
|
||||
Defaultly returns @racket[#f].
|
||||
}
|
||||
@defmethod*[(((update-frame-filename) void?))]{
|
||||
Attempts to find a frame that displays this editor. If it
|
||||
|
@ -328,15 +321,14 @@
|
|||
been saved is a reason to alert the user. See also
|
||||
@method[editor:file-mixin can-close?].
|
||||
|
||||
|
||||
Defaultly returns @scheme[#f].
|
||||
Defaultly returns @racket[#f].
|
||||
}
|
||||
|
||||
@defmethod[(user-saves-or-not-modified? [allow-cancel? #t]) boolean?]{
|
||||
If the file has not been saved, this prompts the user about saving and,
|
||||
if the user says to save, then it saves the file.
|
||||
|
||||
The result is @scheme[#t] if the save file is up to date, or if
|
||||
|
||||
The result is @racket[#t] if the save file is up to date, or if
|
||||
the user says it is okay to continue without saving. Generally used
|
||||
when closing the file or quiting the app.
|
||||
}
|
||||
|
@ -351,19 +343,19 @@
|
|||
|
||||
Updates the filename on each frame displaying this editor, for each
|
||||
frame that matches
|
||||
@scheme[frame:editor<%>].
|
||||
@racket[frame:editor<%>].
|
||||
}
|
||||
@defmethod*[#:mode augment (((can-close?) boolean?))]{
|
||||
|
||||
If the
|
||||
@method[editor:file<%> allow-close-with-no-filename?]
|
||||
method returns @scheme[#f], this method checks to see if the file
|
||||
method returns @racket[#f], this method checks to see if the file
|
||||
has been saved at all yet. If not, it asks the user
|
||||
about saving (and saves if they ask).
|
||||
|
||||
If the
|
||||
@method[editor:file<%> allow-close-with-no-filename?]
|
||||
method returns @scheme[#t], this method does as before,
|
||||
method returns @racket[#t], this method does as before,
|
||||
except only asks if the editor's
|
||||
@method[editor<%> get-filename]method returns a path.
|
||||
|
||||
|
@ -373,60 +365,47 @@
|
|||
|
||||
This returns a list containing the super-class's keymaps, plus the
|
||||
result of
|
||||
@scheme[keymap:get-file]
|
||||
@racket[keymap:get-file]
|
||||
}
|
||||
}
|
||||
@definterface[editor:backup-autosave<%> (editor:basic<%>)]{
|
||||
Classes matching this interface support backup files and autosaving.
|
||||
@defmethod*[(((backup?) boolean?))]{
|
||||
Indicates whether this
|
||||
@scheme[editor<%>]
|
||||
@racket[editor<%>]
|
||||
should be backed up.
|
||||
|
||||
|
||||
Returns the value of the
|
||||
@scheme[preferences:get]
|
||||
applied to
|
||||
@scheme['framework:backup-files?].
|
||||
@index{'framework:backup-files?}
|
||||
|
||||
Returns the value of the @racket[preferences:get] applied to
|
||||
@racket['framework:backup-files?]. @index{'framework:backup-files?}
|
||||
}
|
||||
@defmethod*[(((autosave?) boolean?))]{
|
||||
Indicates whether this
|
||||
@scheme[editor<%>]
|
||||
@racket[editor<%>]
|
||||
should be autosaved.
|
||||
|
||||
|
||||
Returns @scheme[#t].
|
||||
Returns @racket[#t].
|
||||
}
|
||||
@defmethod*[(((do-autosave) (or/c #f path?)))]{
|
||||
This method is called to perform the autosaving.
|
||||
See also
|
||||
@scheme[autosave:register]
|
||||
This method is called to perform the autosaving. See also
|
||||
@racket[autosave:register]
|
||||
|
||||
When the file has been modified since it was last saved and autosaving it
|
||||
turned on (via the @method[editor:backup-autosave<%> autosave?] method) an
|
||||
autosave file is created for this @racket[editor<%>].
|
||||
|
||||
When the file has been modified since it was last saved and autosaving
|
||||
it turned on (via the
|
||||
@method[editor:backup-autosave<%> autosave?]
|
||||
method) an autosave file is created for this
|
||||
@scheme[editor<%>].
|
||||
|
||||
Returns the filename where the autosave took place, or
|
||||
@scheme[#f] if none did.
|
||||
Returns the filename where the autosave took place, or @racket[#f] if none
|
||||
did.
|
||||
}
|
||||
@defmethod*[(((remove-autosave) void?))]{
|
||||
This method removes the autosave file associated with this
|
||||
@scheme[editor<%>].
|
||||
|
||||
|
||||
@racket[editor<%>].
|
||||
}
|
||||
}
|
||||
@defmixin[editor:backup-autosave-mixin (editor:basic<%>) (editor:backup-autosave<%> autosave:autosavable<%>)]{
|
||||
This mixin adds backup and autosave functionality to an editor.
|
||||
|
||||
During initialization, this object is registered
|
||||
with
|
||||
@scheme[autosave:register].
|
||||
During initialization, this object is registered with
|
||||
@racket[autosave:register].
|
||||
|
||||
The result of this mixin uses the same initialization arguments as the
|
||||
mixin's argument.
|
||||
|
@ -436,7 +415,7 @@
|
|||
If a backup file has not been created this session for this file,
|
||||
deletes any existing backup file and copies the old save file into the
|
||||
backup file. For the backup file's name, see
|
||||
@scheme[path-utils:generate-backup-name]
|
||||
@racket[path-utils:generate-backup-name]
|
||||
}
|
||||
@defmethod*[#:mode augment (((on-close) void?))]{
|
||||
|
||||
|
@ -444,7 +423,7 @@
|
|||
}
|
||||
@defmethod*[#:mode augment (((on-change) void?))]{
|
||||
|
||||
Sets a flag indicating that this @scheme[editor<%>] needs to be autosaved.
|
||||
Sets a flag indicating that this @racket[editor<%>] needs to be autosaved.
|
||||
}
|
||||
@defmethod*[#:mode override (((set-modified (modified? any/c)) void?))]{
|
||||
|
||||
|
@ -454,13 +433,12 @@
|
|||
}
|
||||
}
|
||||
@definterface[editor:info<%> (editor:basic<%>)]{
|
||||
An @scheme[editor<%>]
|
||||
matching this interface provides information about its lock state to its
|
||||
@scheme[top-level-window<%>].
|
||||
An @racket[editor<%>] matching this interface provides information about its
|
||||
lock state to its @racket[top-level-window<%>].
|
||||
}
|
||||
@defmixin[editor:info-mixin (editor:basic<%>) (editor:info<%>)]{
|
||||
This editor tells the frame when it is locked and unlocked.
|
||||
See also @scheme[frame:text-info<%>].
|
||||
See also @racket[frame:text-info<%>].
|
||||
|
||||
@defmethod*[#:mode override (((lock (lock? boolean?)) void?))]{
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -5,119 +5,96 @@
|
|||
@title{Group}
|
||||
|
||||
@defclass[group:% object% ()]{
|
||||
This class manages a group of frames matching the
|
||||
@scheme[frame:basic<%>]
|
||||
interface. There is one instance created by
|
||||
the framework, returned by the function
|
||||
@scheme[group:get-the-frame-group]
|
||||
and every frame that was constructed with
|
||||
@scheme[frame:basic-mixin]
|
||||
adds itself to the result of
|
||||
@scheme[group:get-the-frame-group].
|
||||
This class manages a group of frames matching the @racket[frame:basic<%>]
|
||||
interface. There is one instance created by the framework, returned by the
|
||||
function @racket[group:get-the-frame-group] and every frame that was
|
||||
constructed with @racket[frame:basic-mixin] adds itself to the result of
|
||||
@racket[group:get-the-frame-group].
|
||||
|
||||
@defmethod*[(((set-open-here-frame (frame (is-a?/c frame:editor%))) void?))]{
|
||||
Sets the frame to load new files into.
|
||||
See also
|
||||
@scheme[frame:open-here<%>].
|
||||
|
||||
|
||||
Sets the frame to load new files into. See also
|
||||
@racket[frame:open-here<%>].
|
||||
}
|
||||
|
||||
@defmethod*[(((get-open-here-frame) (or/c false/c (is-a?/c frame:editor<%>))))]{
|
||||
Returns the currently saved frame
|
||||
to load new files into.
|
||||
|
||||
Returns the currently saved frame to load new files into.
|
||||
}
|
||||
|
||||
@defmethod*[(((get-mdi-parent) (or/c false/c (is-a?/c frame%))))]{
|
||||
The result of this method must be used as the parent frame for each
|
||||
frame in the group.
|
||||
|
||||
The result of this method must be used as the parent frame for each frame
|
||||
in the group.
|
||||
}
|
||||
|
||||
@defmethod*[(((get-frames) (list-of (is-a?/c frame:basic<%>))))]{
|
||||
Returns the frames in the group.
|
||||
|
||||
}
|
||||
@defmethod*[(((frame-label-changed (frame (is-a?/c frame:basic<%>))) void?))]{
|
||||
This method is called by frames constructed with
|
||||
@scheme[frame:basic-mixin]
|
||||
when their titles change.
|
||||
|
||||
@defmethod*[(((frame-label-changed (frame (is-a?/c frame:basic<%>))) void?))]{
|
||||
This method is called by frames constructed with @racket[frame:basic-mixin]
|
||||
when their titles change.
|
||||
|
||||
Updates the windows menu of each frame in the group.
|
||||
}
|
||||
@defmethod*[(((frame-shown/hidden) void?))]{
|
||||
This method is called by instances of
|
||||
@scheme[frame:basic%]
|
||||
to notify the frame group that
|
||||
a frame's visibility is changed.
|
||||
|
||||
@defmethod*[(((frame-shown/hidden) void?))]{
|
||||
This method is called by instances of @racket[frame:basic%] to notify the
|
||||
frame group that a frame's visibility is changed.
|
||||
|
||||
Updates the Windows menus of all of the frames in the frame group.
|
||||
}
|
||||
|
||||
@defmethod*[(((for-each-frame (f ((is-a?/c frame:basic<%>) -> void?))) void?))]{
|
||||
This method applies a function to each frame in the group. It also
|
||||
remembers the function and applies it to any new frames that are added
|
||||
to the group when they are added.
|
||||
remembers the function and applies it to any new frames that are added to
|
||||
the group when they are added.
|
||||
|
||||
See also
|
||||
@method[group:% get-frames].
|
||||
See also @method[group:% get-frames].
|
||||
|
||||
|
||||
Applies @scheme[f] to each frame in the group
|
||||
Applies @racket[f] to each frame in the group
|
||||
}
|
||||
|
||||
@defmethod*[(((get-active-frame) (is-a?/c frame:basic<%>)))]{
|
||||
Returns the frame with the keyboard focus or the first frame in the
|
||||
group.
|
||||
|
||||
Returns the frame with the keyboard focus or the first frame in the group.
|
||||
}
|
||||
|
||||
@defmethod*[(((set-active-frame (frame (is-a?/c frame:basic<%>))) void?))]{
|
||||
Sets the active frame in the group.
|
||||
This method is called by
|
||||
Sets the active frame in the group. This method is called by
|
||||
@method[frame:register-group-mixin on-activate].
|
||||
|
||||
}
|
||||
|
||||
@defmethod*[(((insert-frame (frame (is-a?/c frame:basic<%>))) void?))]{
|
||||
Inserts a frame into the group.
|
||||
|
||||
}
|
||||
|
||||
@defmethod*[(((remove-frame (frame (is-a?/c frame:basic<%>))) void?))]{
|
||||
Removes a frame from the group.
|
||||
|
||||
|
||||
}
|
||||
|
||||
@defmethod*[(((clear) boolean?))]{
|
||||
This removes all of the frames in the group. It does not close the frames. See also
|
||||
@method[group:% on-close-all]and
|
||||
@method[group:% can-close-all?].
|
||||
|
||||
This removes all of the frames in the group. It does not close the frames.
|
||||
See also @method[group:% on-close-all]and @method[group:% can-close-all?].
|
||||
}
|
||||
|
||||
@defmethod*[(((on-close-all) void?))]{
|
||||
Call this method to close all of the frames in the group.
|
||||
The function
|
||||
@method[group:% can-close-all?]
|
||||
must have been called just before this function and it must have returned
|
||||
@scheme[#t].
|
||||
Call this method to close all of the frames in the group. The function
|
||||
@method[group:% can-close-all?] must have been called just before this
|
||||
function and it must have returned @racket[#t].
|
||||
|
||||
|
||||
Calls the
|
||||
@method[top-level-window<%> on-close]
|
||||
method and the
|
||||
@method[top-level-window<%> show]
|
||||
method (with @scheme[#f] as argument)
|
||||
on each frame in the group.
|
||||
Calls the @method[top-level-window<%> on-close] method and the
|
||||
@method[top-level-window<%> show] method (with @racket[#f] as argument) on
|
||||
each frame in the group.
|
||||
}
|
||||
|
||||
@defmethod*[(((can-close-all?) void?))]{
|
||||
Call this method to make sure that closing all of the frames in the frame groups is
|
||||
permitted by the user. The function
|
||||
@method[group:% on-close-all]
|
||||
Call this method to make sure that closing all of the frames in the frame
|
||||
groups is permitted by the user. The function @method[group:% on-close-all]
|
||||
is expected to be called just after this method is called.
|
||||
|
||||
|
||||
Calls the
|
||||
@method[top-level-window<%> can-close?]
|
||||
method of each frame in the group.
|
||||
Calls the @method[top-level-window<%> can-close?] method of each frame in
|
||||
the group.
|
||||
}
|
||||
@defmethod*[(((locate-file [name path?]) (or/c false/c (is-a?/c frame:basic<%>))))]{
|
||||
Returns the frame that is editing or viewing the file @scheme[name].
|
||||
|
||||
Returns the frame that is editing or viewing the file @racket[name].
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -5,41 +5,40 @@
|
|||
@title{Keymap}
|
||||
|
||||
@definterface[keymap:aug-keymap<%> (keymap%)]{
|
||||
This keymap overrides some of the built in @scheme[keymap%] methods
|
||||
to be able to extract the keybindings from the keymap.
|
||||
@defmethod*[(((get-chained-keymaps) (listof (is-a?/c keymap%))))]{
|
||||
This keymap overrides some of the built in @racket[keymap%] methods to be
|
||||
able to extract the keybindings from the keymap.
|
||||
|
||||
@defmethod*[(((get-chained-keymaps) (listof (is-a?/c keymap%))))]{
|
||||
Returns the list of keymaps that are chained to this one.
|
||||
}
|
||||
|
||||
@defmethod*[(((get-map-function-table) hash?))]{
|
||||
|
||||
Returns a hash-table that maps symbols naming key sequences to the
|
||||
names of the keymap functions the are bound to.
|
||||
Returns a hash-table that maps symbols naming key sequences to the names of
|
||||
the keymap functions the are bound to.
|
||||
}
|
||||
@defmethod*[(((get-map-function-table/ht (ht hash?)) hash?))]{
|
||||
|
||||
This is a helper function for
|
||||
@method[keymap:aug-keymap<%> get-map-function-table]
|
||||
that returns the same result, except it accepts a hash-table that
|
||||
it inserts the bindings into. It does not replace any bindings already in
|
||||
@scheme[ht].
|
||||
@defmethod*[(((get-map-function-table/ht (ht hash?)) hash?))]{
|
||||
This is a helper function for @method[keymap:aug-keymap<%>
|
||||
get-map-function-table] that returns the same result, except it accepts a
|
||||
hash-table that it inserts the bindings into. It does not replace any
|
||||
bindings already in @racket[ht].
|
||||
}
|
||||
}
|
||||
@defmixin[keymap:aug-keymap-mixin (keymap%) (keymap:aug-keymap<%>)]{
|
||||
@defmethod*[#:mode override (((chain-to-keymap (next (is-a?/c keymap%)) (prefix? boolean?)) void))]{
|
||||
|
||||
Keeps a list of the keymaps chained to this one.
|
||||
}
|
||||
@defmethod*[#:mode override (((remove-chained-keymap (keymap (is-a?/c keymap))) void))]{
|
||||
|
||||
@defmethod*[#:mode override (((remove-chained-keymap (keymap (is-a?/c keymap))) void))]{
|
||||
Keeps the list of the keymaps chained to this one up to date.
|
||||
}
|
||||
@defmethod*[#:mode override (((map-function (key-name string) (function-name string)) void))]{
|
||||
|
||||
Keeps a separate record of the key names and functions that they are
|
||||
bound to in this keymap.
|
||||
@defmethod*[#:mode override (((map-function (key-name string) (function-name string)) void))]{
|
||||
Keeps a separate record of the key names and functions that they are bound
|
||||
to in this keymap.
|
||||
}
|
||||
}
|
||||
|
||||
@defclass[keymap:aug-keymap% (keymap:aug-keymap-mixin keymap%) ()]{}
|
||||
|
||||
@(include-previously-extracted "main-extracts.rkt" #rx"^keymap:")
|
||||
|
|
|
@ -5,42 +5,40 @@
|
|||
@title{Menu}
|
||||
|
||||
@definterface[menu:can-restore<%> (selectable-menu-item<%>)]{
|
||||
Classes created with this mixin remember their keybindings so the
|
||||
keybindings can be removed and then restored.
|
||||
Classes created with this mixin remember their keybindings so the keybindings
|
||||
can be removed and then restored.
|
||||
|
||||
@defmethod*[(((restore-keybinding) void?))]{
|
||||
Sets the keyboard shortcut to the setting it had when the class was
|
||||
created.
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@defmixin[menu:can-restore-mixin (selectable-menu-item<%>) (menu:can-restore<%>)]{
|
||||
|
||||
}
|
||||
|
||||
@definterface[menu:can-restore-underscore<%> (labelled-menu-item<%>)]{
|
||||
These menus can save and restore the underscores (indicated
|
||||
via the @litchar{&} characters in the original labels) in their
|
||||
labels.
|
||||
These menus can save and restore the underscores (indicated via the
|
||||
@litchar{&} characters in the original labels) in their labels.
|
||||
|
||||
If the preference @racket['framework:menu-bindings] is @racket[#f], calls
|
||||
@method[menu:can-restore-underscore<%> erase-underscores] during
|
||||
initialization.
|
||||
|
||||
If the preference @scheme['framework:menu-bindings]
|
||||
is @scheme[#f], calls
|
||||
@method[menu:can-restore-underscore<%> erase-underscores]
|
||||
during initialization.
|
||||
@defmethod*[(((erase-underscores) void?))]{
|
||||
Erases the underscores in the label of this menu, but
|
||||
remembers them so they can be restores with
|
||||
@method[menu:can-restore-underscore<%> restore-underscores].
|
||||
|
||||
Erases the underscores in the label of this menu, but remembers them so
|
||||
they can be restores with @method[menu:can-restore-underscore<%>
|
||||
restore-underscores].
|
||||
}
|
||||
|
||||
@defmethod*[(((restore-underscores) void?))]{
|
||||
Restores underscores in the menu's label to their original
|
||||
state.
|
||||
|
||||
|
||||
Restores underscores in the menu's label to their original state.
|
||||
}
|
||||
}
|
||||
@defmixin[menu:can-restore-underscore-mixin (labelled-menu-item<%>) (menu:can-restore-underscore<%>)]{
|
||||
|
||||
@defmixin[menu:can-restore-underscore-mixin (labelled-menu-item<%>) (menu:can-restore-underscore<%>)]{
|
||||
}
|
||||
|
||||
@defclass[menu:can-restore-menu-item% (menu:can-restore-mixin menu-item%) ()]{}
|
||||
@defclass[menu:can-restore-checkable-menu-item% (menu:can-restore-mixin checkable-menu-item%) ()]{}
|
||||
@defclass[menu:can-restore-underscore-menu% (menu:can-restore-underscore-mixin menu%) ()]{}
|
||||
|
|
|
@ -10,19 +10,19 @@
|
|||
(syntax-case* spec (override augment) (λ (x y) (eq? (syntax-e x) (syntax-e y)))
|
||||
[(override mtd (x ...) ...)
|
||||
#'@defmethod*[(((mtd (x any/c) ...) any) ...)]{
|
||||
Delegates to the result of @method[mode:host-text<%> get-surrogate] if it is not @scheme[#f].}]
|
||||
Delegates to the result of @method[mode:host-text<%> get-surrogate] if it is not @racket[#f].}]
|
||||
[(augment default mtd (x ...) ...)
|
||||
#'@defmethod*[(((mtd (x any/c) ...) any) ...)]{
|
||||
Delegates to the result of @method[mode:host-text<%> get-surrogate] if it is not @scheme[#f].}]))
|
||||
Delegates to the result of @method[mode:host-text<%> get-surrogate] if it is not @racket[#f].}]))
|
||||
|
||||
(define (spec->surrogate-method spec)
|
||||
(syntax-case* spec (override augment) (λ (x y) (eq? (syntax-e x) (syntax-e y)))
|
||||
[(override method (x ...) ...)
|
||||
#'@defmethod*[(((method (orig (is-a?/c text%)) (call-super (-> any)) (x any/c) ...) any) ...)]{
|
||||
Returns the result of invoking @scheme[call-super].
|
||||
Returns the result of invoking @racket[call-super].
|
||||
}]
|
||||
[(augment default method (x ...) ...)
|
||||
#'@defmethod*[(((method (orig (is-a?/c text%)) (call-inner (-> any)) (x any/c) ...) any) ...)]{
|
||||
Returns the result of invoking @scheme[call-super].
|
||||
Returns the result of invoking @racket[call-super].
|
||||
}]))
|
||||
|
||||
|
|
|
@ -12,32 +12,32 @@
|
|||
[(_ spec ...)
|
||||
#`(begin
|
||||
@definterface[mode:surrogate-text<%> ()]{
|
||||
@defmethod[(on-enable-surrogate) any]{
|
||||
Called by @method[mode:host-text<%> set-surrogate] to
|
||||
notify the surrogate that it has just become active.
|
||||
}
|
||||
@defmethod[(on-disable-surrogate) any]{
|
||||
Called by @method[mode:host-text<%> set-surrogate] to
|
||||
notify the surrogate that it has just been disabled.
|
||||
}
|
||||
}
|
||||
@defmethod[(on-enable-surrogate) any]{
|
||||
Called by @method[mode:host-text<%> set-surrogate] to notify the
|
||||
surrogate that it has just become active.
|
||||
}
|
||||
@defmethod[(on-disable-surrogate) any]{
|
||||
Called by @method[mode:host-text<%> set-surrogate] to notify the
|
||||
surrogate that it has just been disabled.
|
||||
}
|
||||
}
|
||||
@defclass[mode:surrogate-text% object% (mode:surrogate-text<%>)]{
|
||||
@#,@(map spec->surrogate-method (syntax->list #'(spec ...)))
|
||||
@#,@(map spec->surrogate-method (syntax->list #'(spec ...)))
|
||||
}
|
||||
@definterface[mode:host-text<%> ()]{
|
||||
@defmethod[(get-surrogate)
|
||||
(or/c false/c (is-a?/c mode:surrogate-text<%>))]{
|
||||
Returns the currently active surrogate.
|
||||
}
|
||||
@defmethod[(set-surrogate
|
||||
[surrogate (or/c false/c (is-a?/c mode:surrogate-text<%>))])
|
||||
void?]{
|
||||
Sets the current surrogate to @scheme[surrogate].
|
||||
}
|
||||
@defmethod[(get-surrogate)
|
||||
(or/c false/c (is-a?/c mode:surrogate-text<%>))]{
|
||||
Returns the currently active surrogate.
|
||||
}
|
||||
@defmethod[(set-surrogate
|
||||
[surrogate (or/c false/c (is-a?/c mode:surrogate-text<%>))])
|
||||
void?]{
|
||||
Sets the current surrogate to @racket[surrogate].
|
||||
}
|
||||
}
|
||||
@defmixin[mode:host-text-mixin () (mode:host-text<%>)]{
|
||||
@#,@(map spec->host-method (syntax->list #'(spec ...)))
|
||||
})]))
|
||||
@#,@(map spec->host-method (syntax->list #'(spec ...)))
|
||||
})]))
|
||||
|
||||
(surrogate-methods docs)
|
||||
)
|
||||
|
|
|
@ -5,178 +5,164 @@
|
|||
@title{Panel}
|
||||
|
||||
@definterface[panel:single<%> (area-container<%>)]{
|
||||
See
|
||||
@scheme[panel:single-mixin%].
|
||||
See @racket[panel:single-mixin%].
|
||||
|
||||
@defmethod*[(((active-child (child (is-a?/c area<%>))) void?) ((active-child) (is-a?/c area<%>)))]{
|
||||
|
||||
Sets the active child to be @scheme[child]
|
||||
|
||||
Sets the active child to be @racket[child]
|
||||
|
||||
Returns the current active child.
|
||||
}
|
||||
}
|
||||
|
||||
@defmixin[panel:single-mixin (area-container<%>) (panel:single<%>)]{
|
||||
This mixin adds single panel functionality to an implementation of the
|
||||
@scheme[area-container<%>] interface.
|
||||
This mixin adds single panel functionality to an implementation of the
|
||||
@racket[area-container<%>] interface.
|
||||
|
||||
Single panels place all of the children in the center of the panel,
|
||||
and allow make one child to be visible at a time. The
|
||||
@method[panel:single<%> active-child]
|
||||
method controls which panel is currently active.
|
||||
Single panels place all of the children in the center of the panel, and allow
|
||||
make one child to be visible at a time. The
|
||||
@method[panel:single<%> active-child] method controls which panel is
|
||||
currently active.
|
||||
|
||||
The @method[window<%> show] method is used to hide and show the children of a
|
||||
single panel.
|
||||
|
||||
The
|
||||
@method[window<%> show]
|
||||
method is used to hide and show the children of a single panel.
|
||||
@defmethod*[#:mode override (((after-new-child (child (is-a?/c subarea<%>))) void?))]{
|
||||
|
||||
Hides this child by calling @scheme[(send child show #f)], unless
|
||||
this is the first child in which case it does nothing.
|
||||
Hides this child by calling @racket[(send child show #f)], unless this is
|
||||
the first child in which case it does nothing.
|
||||
}
|
||||
|
||||
@defmethod*[#:mode override (((container-size) (values exact-integer? exact-integer?)))]{
|
||||
|
||||
Returns the maximum width of all the children and the maximum height
|
||||
of all of the children.
|
||||
Returns the maximum width of all the children and the maximum height of all
|
||||
of the children.
|
||||
}
|
||||
@defmethod*[#:mode override (((place-children) (listof (list/c exact-integer? exact-integer? exact-integer? exact-integer?))))]{
|
||||
|
||||
@defmethod*[#:mode override (((place-children) (listof (list/c exact-integer? exact-integer? exact-integer? exact-integer?))))]{
|
||||
Returns the positions for single panels and panes.
|
||||
}
|
||||
}
|
||||
|
||||
@definterface[panel:single-window<%> (panel:single<%> window<%>)]{
|
||||
|
||||
}
|
||||
|
||||
@defmixin[panel:single-window-mixin (panel:single<%> window<%>) (panel:single-window<%>)]{
|
||||
|
||||
@defmethod*[#:mode override (((container-size (info (listof (list/c exact-integer? exact-integer? boolean? boolean?)))) (values exact-integer? exact-integer?)))]{
|
||||
|
||||
Factors the border width into the size calculation.
|
||||
}
|
||||
}
|
||||
|
||||
@defclass[panel:single% (panel:single-window-mixin (panel:single-mixin panel%)) ()]{}
|
||||
@defclass[panel:single-pane% (panel:single-mixin pane%) ()]{}
|
||||
|
||||
@definterface[panel:dragable<%> (window<%> area-container<%>)]{
|
||||
Classes matching this interface implement a panel where the
|
||||
user can adjust the percentage of the space that each takes
|
||||
up. The user adjusts the size by clicking and dragging the
|
||||
empty space between the children.
|
||||
Classes matching this interface implement a panel where the user can adjust
|
||||
the percentage of the space that each takes up. The user adjusts the size by
|
||||
clicking and dragging the empty space between the children.
|
||||
|
||||
@defmethod*[(((after-percentage-change) void?))]{
|
||||
This method is called when the user changes the percentage
|
||||
by dragging the bar between the children, or when a new
|
||||
child is added to the frame, but not when
|
||||
@method[panel:dragable<%> set-percentages]
|
||||
is called.
|
||||
|
||||
Use
|
||||
@method[panel:dragable<%> get-percentages]
|
||||
to find the current percentages.
|
||||
|
||||
This method is called when the user changes the percentage by dragging the
|
||||
bar between the children, or when a new child is added to the frame, but
|
||||
not when @method[panel:dragable<%> set-percentages] is called.
|
||||
|
||||
Use @method[panel:dragable<%> get-percentages] to find the current
|
||||
percentages.
|
||||
}
|
||||
|
||||
@defmethod*[(((set-percentages (new-percentages (listof number?))) void?))]{
|
||||
Call this method to set the percentages that each window
|
||||
takes up of the panel.
|
||||
Call this method to set the percentages that each window takes up of the
|
||||
panel.
|
||||
|
||||
|
||||
The argument, @scheme[new-percentages] must be a list of
|
||||
numbers that sums to 1. It's length must be equal to the
|
||||
number of children of the panel (see
|
||||
@method[area-container<%> get-children]) and each percentage must correspond to a number of pixels
|
||||
that is equal to or larger than the
|
||||
minimum with of the child, as reported by
|
||||
@method[area<%> min-width].
|
||||
The argument, @racket[new-percentages] must be a list of numbers that sums
|
||||
to 1. It's length must be equal to the number of children of the panel (see
|
||||
@method[area-container<%> get-children]) and each percentage must
|
||||
correspond to a number of pixels that is equal to or larger than the
|
||||
minimum with of the child, as reported by @method[area<%> min-width].
|
||||
}
|
||||
|
||||
@defmethod*[(((get-percentages) (listof number?)))]{
|
||||
Return the current percentages of the children.
|
||||
|
||||
}
|
||||
|
||||
@defmethod*[(((get-vertical?) boolean?))]{
|
||||
This method controls the behavior of the other overridden
|
||||
methods in mixins that implement this interface.
|
||||
|
||||
If it returns @scheme[#t], the panel will be vertically
|
||||
aligned and if it returns @scheme[#f], they will be
|
||||
horizontally aligned.
|
||||
This method controls the behavior of the other overridden methods in mixins
|
||||
that implement this interface.
|
||||
|
||||
If it returns @racket[#t], the panel will be vertically aligned and if it
|
||||
returns @racket[#f], they will be horizontally aligned.
|
||||
}
|
||||
|
||||
|
||||
@defmethod[(set-orientation [horizontal? boolean?]) void?]{
|
||||
Sets the orientation of the panel, switching it from behaving
|
||||
like a @racket[panel:horizontal-dragable<%>] and
|
||||
Sets the orientation of the panel, switching it from behaving like a
|
||||
@racket[panel:horizontal-dragable<%>] and
|
||||
@racket[panel:vertical-dragable<%>].
|
||||
}
|
||||
}
|
||||
|
||||
@definterface[panel:vertical-dragable<%> (panel:dragable<%>)]{
|
||||
A panel that implements
|
||||
@scheme[panel:vertical-dragable<%>]. It aligns its children vertically.
|
||||
A panel that implements @racket[panel:vertical-dragable<%>]. It aligns its
|
||||
children vertically.
|
||||
}
|
||||
|
||||
@definterface[panel:horizontal-dragable<%> (panel:dragable<%>)]{
|
||||
A panel that implements
|
||||
@scheme[panel:horizontal-dragable<%>]. It aligns its children horizontally.
|
||||
A panel that implements @racket[panel:horizontal-dragable<%>]. It aligns its
|
||||
children horizontally.
|
||||
}
|
||||
|
||||
@defmixin[panel:dragable-mixin (window<%> area-container<%>) (panel:dragable<%>)]{
|
||||
This mixin adds the
|
||||
@scheme[panel:dragable<%>]
|
||||
functionality to a
|
||||
@scheme[panel%].
|
||||
|
||||
It is not useful unless the
|
||||
@method[panel:dragable<%> get-vertical?]
|
||||
method is overridden.
|
||||
This mixin adds the @racket[panel:dragable<%>] functionality to a
|
||||
@racket[panel%].
|
||||
|
||||
It is not useful unless the @method[panel:dragable<%> get-vertical?] method
|
||||
is overridden.
|
||||
|
||||
@defmethod*[#:mode override (((after-new-child (child (is-a?/c subarea<%>))) void?))]{
|
||||
|
||||
Updates the number of percentages to make sure that it
|
||||
matches the number of children and calls
|
||||
@method[panel:dragable<%> after-percentage-change].
|
||||
Updates the number of percentages to make sure that it matches the number
|
||||
of children and calls @method[panel:dragable<%> after-percentage-change].
|
||||
}
|
||||
|
||||
@defmethod*[#:mode override (((on-subwindow-event (receiver (is-a?/c window<%>)) (event (is-a?/c mouse-event%))) boolean?))]{
|
||||
|
||||
When the cursor is dragging the middle bar around, this
|
||||
method handles the resizing of the two panes.
|
||||
When the cursor is dragging the middle bar around, this method handles the
|
||||
resizing of the two panes.
|
||||
}
|
||||
@defmethod*[#:mode override (((place-children (info (listof (list/c exact-integer? exact-integer?))) (w exact-integer?) (h exact-integer?)) (listof (list/c exact-integer? exact-integer? exact-integer? exact-integer?))))]{
|
||||
|
||||
@defmethod*[#:mode override
|
||||
(((place-children (info (listof (list/c exact-integer? exact-integer?)))
|
||||
(w exact-integer?)
|
||||
(h exact-integer?))
|
||||
(listof (list/c exact-integer? exact-integer? exact-integer? exact-integer?))))]{
|
||||
Places the children vertically in the panel, based on the percentages
|
||||
returned from
|
||||
@method[panel:dragable<%> get-percentages]. Also leaves a little gap between each pair of children.
|
||||
returned from @method[panel:dragable<%> get-percentages]. Also leaves a
|
||||
little gap between each pair of children.
|
||||
}
|
||||
|
||||
@defmethod*[#:mode override (((container-size (info (listof (list/c exact-integer? exact-integer? any/c any/c))))
|
||||
(values exact-integer? exact-integer?)))]{
|
||||
|
||||
Computes the minimum size the panel would have to be in
|
||||
order to have the current percentages (see
|
||||
@method[panel:dragable<%> get-percentages]).
|
||||
|
||||
(values exact-integer? exact-integer?)))]{
|
||||
Computes the minimum size the panel would have to be in order to have the
|
||||
current percentages (see @method[panel:dragable<%> get-percentages]).
|
||||
}
|
||||
}
|
||||
@defmixin[panel:vertical-dragable-mixin (panel:dragable<%>) (panel:vertical-dragable<%>)]{
|
||||
This mixin merely overrides the
|
||||
@method[panel:dragable<%> get-vertical?]
|
||||
method of the
|
||||
@scheme[panel:dragable-mixin]
|
||||
to return @scheme[#t].
|
||||
@defmethod*[#:mode override (((get-vertical?) boolean?))]{
|
||||
|
||||
Returns @scheme[#t].
|
||||
@defmixin[panel:vertical-dragable-mixin (panel:dragable<%>) (panel:vertical-dragable<%>)]{
|
||||
This mixin merely overrides the @method[panel:dragable<%> get-vertical?]
|
||||
method of the @racket[panel:dragable-mixin] to return @racket[#t].
|
||||
|
||||
@defmethod*[#:mode override (((get-vertical?) boolean?))]{
|
||||
Returns @racket[#t].
|
||||
}
|
||||
}
|
||||
@defmixin[panel:horizontal-dragable-mixin (panel:dragable<%>) (panel:vertical-dragable<%>)]{
|
||||
This mixin merely overrides the
|
||||
@method[panel:dragable<%> get-vertical?]
|
||||
method of the
|
||||
@scheme[panel:dragable-mixin]
|
||||
to return @scheme[#f].
|
||||
@defmethod*[#:mode override (((get-vertical?) boolean?))]{
|
||||
This mixin merely overrides the @method[panel:dragable<%> get-vertical?]
|
||||
method of the @racket[panel:dragable-mixin] to return @racket[#f].
|
||||
|
||||
Returns @scheme[#f].
|
||||
@defmethod*[#:mode override (((get-vertical?) boolean?))]{
|
||||
Returns @racket[#f].
|
||||
}
|
||||
}
|
||||
|
||||
@defclass[panel:vertical-dragable% (panel:vertical-dragable-mixin (panel:dragable-mixin panel%)) ()]{}
|
||||
@defclass[panel:horizontal-dragable% (panel:horizontal-dragable-mixin (panel:dragable-mixin panel%)) ()]{}
|
||||
|
||||
@definterface[panel:splitter<%> ()]{
|
||||
A panel that implements @scheme[panel:splitter<%>]. Children can be split
|
||||
A panel that implements @racket[panel:splitter<%>]. Children can be split
|
||||
horizonally or vertically.
|
||||
}
|
||||
|
||||
|
@ -189,9 +175,9 @@
|
|||
(maker (-> (is-a?/c panel:splitter<%>)
|
||||
(is-a?/c canvas<%>))))
|
||||
(is-a?/c canvas<%>)]{
|
||||
Splits the @scheme[canvas] vertically by creating a new instance using
|
||||
@scheme[maker]. This splitter object is passed as the argument to
|
||||
@scheme[maker] and should be used as the @scheme[parent] field of the newly
|
||||
Splits the @racket[canvas] vertically by creating a new instance using
|
||||
@racket[maker]. This splitter object is passed as the argument to
|
||||
@racket[maker] and should be used as the @racket[parent] field of the newly
|
||||
created canvas.
|
||||
}
|
||||
|
||||
|
@ -199,11 +185,11 @@
|
|||
(maker (-> (is-a?/c panel:splitter<%>)
|
||||
(is-a?/c canvas<%>))))
|
||||
(is-a?/c canvas<%>)]{
|
||||
Similar to @scheme[split-vertical] but splits horizontally.
|
||||
Similar to @racket[split-vertical] but splits horizontally.
|
||||
}
|
||||
|
||||
@defmethod[(collapse (canvas (is-a?/c canvas<%>))) void]{
|
||||
Removes the given @scheme[canvas] from the splitter hierarchy and collapses
|
||||
Removes the given @racket[canvas] from the splitter hierarchy and collapses
|
||||
any split panes as necessary.
|
||||
}
|
||||
|
||||
|
|
|
@ -43,159 +43,183 @@
|
|||
}
|
||||
@definterface[scheme:text<%> (text:basic<%> mode:host-text<%> color:text<%>)]{
|
||||
Texts matching this interface support Racket mode operations.
|
||||
|
||||
@defmethod*[(((get-limit (start exact-integer?)) exact-integer?))]{
|
||||
Returns a limit for backward-matching parenthesis starting at
|
||||
position @scheme[start].
|
||||
Returns a limit for backward-matching parenthesis starting at position
|
||||
@racket[start].
|
||||
}
|
||||
|
||||
@defmethod*[(((balance-parens (key-event (is-a?/c key-event%))) void?))]{
|
||||
This function is called when the user types a close parenthesis in
|
||||
the @scheme[text%]. If the close parenthesis that the user inserted
|
||||
does not match the corresponding open parenthesis and the
|
||||
@scheme['framework:fixup-parens] preference is @scheme[#t] (see
|
||||
@scheme[preferences:get]) the correct closing parenthesis is
|
||||
inserted. If the @scheme['framework:paren-match] preference is
|
||||
@scheme[#t] (see @scheme[preferences:get]) the matching open
|
||||
parenthesis is flashed.
|
||||
This function is called when the user types a close parenthesis in the
|
||||
@racket[text%]. If the close parenthesis that the user inserted does not
|
||||
match the corresponding open parenthesis and the
|
||||
@racket['framework:fixup-parens] preference is @racket[#t] (see
|
||||
@racket[preferences:get]) the correct closing parenthesis is inserted. If
|
||||
the @racket['framework:paren-match] preference is @racket[#t] (see
|
||||
@racket[preferences:get]) the matching open parenthesis is flashed.
|
||||
}
|
||||
|
||||
@defmethod*[(((tabify-on-return?) boolean?))]{
|
||||
The result of this method is used to determine if the return key
|
||||
automatically tabs over to the correct position.
|
||||
|
||||
Override it to change its behavior.
|
||||
}
|
||||
|
||||
@defmethod*[(((tabify (start-pos exact-integer?
|
||||
(send this text get-start-position)))
|
||||
void?))]{
|
||||
Tabs the line containing by @scheme[start-pos]
|
||||
Tabs the line containing by @racket[start-pos]
|
||||
}
|
||||
|
||||
@defmethod*[(((tabify-selection (start exact-integer?) (end exact-integer?))
|
||||
void?))]{
|
||||
Sets the tabbing for the lines containing positions @scheme[start]
|
||||
through @scheme[end].
|
||||
Sets the tabbing for the lines containing positions @racket[start]
|
||||
through @racket[end].
|
||||
}
|
||||
|
||||
@defmethod*[(((tabify-all) void?))]{
|
||||
Tabs all lines.
|
||||
}
|
||||
|
||||
@defmethod*[(((insert-return) void?))]{
|
||||
Inserts a newline into the buffer. If
|
||||
@method[scheme:text<%> tabify-on-return?] returns @scheme[#t], this
|
||||
will tabify the new line.
|
||||
Inserts a newline into the buffer. If @method[scheme:text<%>
|
||||
tabify-on-return?] returns @racket[#t], this will tabify the new line.
|
||||
}
|
||||
|
||||
@defmethod*[(((box-comment-out-selection
|
||||
(start-pos (or/c (symbols 'start) exact-integer?))
|
||||
(end-pos (or/c (symbols 'end) exact-integer?)))
|
||||
void?))]{
|
||||
This method comments out a selection in the text by putting it into
|
||||
a comment box.
|
||||
This method comments out a selection in the text by putting it into a
|
||||
comment box.
|
||||
|
||||
Removes the region from @scheme[start-pos] to @scheme[end-pos] from
|
||||
the editor and inserts a comment box with that region of text
|
||||
inserted into the box.
|
||||
Removes the region from @racket[start-pos] to @racket[end-pos] from the
|
||||
editor and inserts a comment box with that region of text inserted into the
|
||||
box.
|
||||
|
||||
If @scheme[start-pos] is @scheme['start], the starting point of the
|
||||
selection is used. If @scheme[end-pos] is @scheme['end], the ending
|
||||
point of the selection is used.
|
||||
If @racket[start-pos] is @racket['start], the starting point of the
|
||||
selection is used. If @racket[end-pos] is @racket['end], the ending point
|
||||
of the selection is used.
|
||||
}
|
||||
|
||||
@defmethod*[(((comment-out-selection (start exact-integer?)
|
||||
(end exact-integer?))
|
||||
void?))]{
|
||||
Comments the lines containing positions @scheme[start] through
|
||||
@scheme[end] by inserting a semi-colon at the front of each line.
|
||||
Comments the lines containing positions @racket[start] through @racket[end]
|
||||
by inserting a semi-colon at the front of each line.
|
||||
}
|
||||
|
||||
@defmethod*[(((uncomment-selection (start exact-integer?) (end exact-integer?)) void?))]{
|
||||
Uncomments the lines containing positions @scheme[start] through
|
||||
@scheme[end].
|
||||
Uncomments the lines containing positions @racket[start] through
|
||||
@racket[end].
|
||||
}
|
||||
|
||||
@defmethod*[(((get-forward-sexp (start exact-integer?))
|
||||
(or/c #f exact-integer?)))]{
|
||||
Returns the position of the end of next S-expression after position
|
||||
@scheme[start], or @scheme[#f] if there is no appropriate answer.
|
||||
@racket[start], or @racket[#f] if there is no appropriate answer.
|
||||
}
|
||||
|
||||
@defmethod*[(((remove-sexp (start exact-integer?)) void?))]{
|
||||
Forward-deletes the S-expression starting after the position
|
||||
@scheme[start].
|
||||
@racket[start].
|
||||
}
|
||||
|
||||
@defmethod*[(((forward-sexp (start exact-integer?)) void?))]{
|
||||
Moves forward over the S-expression starting at position
|
||||
@scheme[start].
|
||||
Moves forward over the S-expression starting at position @racket[start].
|
||||
}
|
||||
|
||||
@defmethod*[(((flash-forward-sexp (start-pos exact-integer?)) void?))]{
|
||||
Flashes the parenthesis that closes the sexpression at
|
||||
@scheme[start-pos].
|
||||
Flashes the parenthesis that closes the sexpression at @racket[start-pos].
|
||||
}
|
||||
|
||||
@defmethod*[(((get-backward-sexp (start exact-integer?))
|
||||
(or/c exact-integer? #f)))]{
|
||||
Returns the position of the start of the S-expression before or
|
||||
containing @scheme[start], or @scheme[#f] if there is no appropriate
|
||||
answer.
|
||||
Returns the position of the start of the S-expression before or containing
|
||||
@racket[start], or @racket[#f] if there is no appropriate answer.
|
||||
}
|
||||
|
||||
@defmethod*[(((flash-backward-sexp (start-pos exact-integer?)) void?))]{
|
||||
Flashes the parenthesis that opens the sexpression at
|
||||
@scheme[start-pos].
|
||||
Flashes the parenthesis that opens the sexpression at @racket[start-pos].
|
||||
}
|
||||
|
||||
@defmethod*[(((backward-sexp (start-pos exact-integer?)) void?))]{
|
||||
Move the caret backwards one sexpression
|
||||
|
||||
Moves the caret to the beginning of the sexpression that ends at
|
||||
@scheme[start-pos].
|
||||
@racket[start-pos].
|
||||
}
|
||||
|
||||
@defmethod*[(((find-up-sexp (start-pos exact-integer?))
|
||||
(or/c #f exact-integer?)))]{
|
||||
Returns the position of the beginning of the next sexpression
|
||||
outside the sexpression that contains @scheme[start-pos]. If there
|
||||
is no such sexpression, it returns @scheme[#f].
|
||||
Returns the position of the beginning of the next sexpression outside the
|
||||
sexpression that contains @racket[start-pos]. If there is no such
|
||||
sexpression, it returns @racket[#f].
|
||||
}
|
||||
|
||||
@defmethod*[(((up-sexp (start exact-integer?)) void?))]{
|
||||
Moves backward out of the S-expression containing the position
|
||||
@scheme[start].
|
||||
@racket[start].
|
||||
}
|
||||
|
||||
@defmethod*[(((find-down-sexp (start-pos exact-integer?))
|
||||
(or/c #f exact-integer?)))]{
|
||||
Returns the position of the beginning of the next sexpression inside
|
||||
the sexpression that contains @scheme[start-pos]. If there is no
|
||||
such sexpression, it returns @scheme[#f].
|
||||
Returns the position of the beginning of the next sexpression inside the
|
||||
sexpression that contains @racket[start-pos]. If there is no such
|
||||
sexpression, it returns @racket[#f].
|
||||
}
|
||||
|
||||
@defmethod*[(((down-sexp (start exact-integer?)) void?))]{
|
||||
Moves forward into the next S-expression after the position
|
||||
@scheme[start].
|
||||
Moves forward into the next S-expression after the position @racket[start].
|
||||
}
|
||||
|
||||
@defmethod*[(((remove-parens-forward (start exact-integer?)) void?))]{
|
||||
Removes the parentheses from the S-expression starting after the
|
||||
position @scheme[start].
|
||||
Removes the parentheses from the S-expression starting after the position
|
||||
@racket[start].
|
||||
}
|
||||
|
||||
@defmethod*[(((select-forward-sexp) void?))]{
|
||||
Selects the next S-expression, starting at the start of the current selection.
|
||||
}
|
||||
|
||||
@defmethod*[(((select-backward-sexp) void?))]{
|
||||
Selects the previous S-expression, starting at the start of the current selection.
|
||||
|
||||
}
|
||||
|
||||
@defmethod*[(((select-up-sexp) void?))]{
|
||||
Selects the region to the enclosing S-expression, starting at the start of the current selection.
|
||||
}
|
||||
|
||||
}
|
||||
@defmethod*[(((select-down-sexp) void?))]{
|
||||
Selects the region to the next contained S-expression, starting at the start of the current selection.
|
||||
Selects the region to the next contained S-expression, starting at the
|
||||
start of the current selection.
|
||||
}
|
||||
|
||||
@defmethod*[(((transpose-sexp (start exact-integer?)) void?))]{
|
||||
Swaps the S-expression beginning before the position @scheme[start] with
|
||||
the next S-expression following @scheme[start].
|
||||
Swaps the S-expression beginning before the position @racket[start] with
|
||||
the next S-expression following @racket[start].
|
||||
}
|
||||
|
||||
@defmethod*[(((mark-matching-parenthesis (pos exact-positive-integer?)) void?))]{
|
||||
If the paren after @scheme[pos] is matched, this method
|
||||
highlights it and its matching counterpart in dark green.
|
||||
If the paren after @racket[pos] is matched, this method highlights it and
|
||||
its matching counterpart in dark green.
|
||||
}
|
||||
|
||||
@defmethod*[(((get-tab-size) exact-integer?))]{
|
||||
This method returns the current size of the tabs for scheme mode.
|
||||
See also @method[scheme:text<%> set-tab-size].
|
||||
}
|
||||
|
||||
@defmethod*[(((set-tab-size (new-size exact-integer?)) void?))]{
|
||||
This method sets the tab size for this text.
|
||||
}
|
||||
|
||||
@defmethod*[(((introduce-let-ans (start-pos exact-integer?)) void?))]{
|
||||
Adds a let around the current s-expression and a printf into the
|
||||
body of the let.
|
||||
}
|
||||
|
||||
@defmethod*[(((move-sexp-out (start-pos exact-integer?)) void?))]{
|
||||
Replaces the sexpression surrounding the insertion point with the
|
||||
sexpression following the insertion point.
|
||||
|
@ -210,48 +234,54 @@
|
|||
mixin's argument.
|
||||
@defmethod*[#:mode override
|
||||
(((get-word-at (pos exact-positive-integer?)) string?))]{
|
||||
Returns the word just before @scheme[pos], which is then used as the
|
||||
prefix for auto-completion.
|
||||
Returns the word just before @racket[pos], which is then used as the prefix
|
||||
for auto-completion.
|
||||
}
|
||||
|
||||
@defmethod[#:mode override
|
||||
(get-start-of-line [pos exact-nonnegative-integer?])
|
||||
exact-nonnegative-integer?]{
|
||||
Returns the first non-whitespace character in the paragraph
|
||||
containing @racket[pos], unless the position is already there, in
|
||||
which case it returns the first position of the paragraph.
|
||||
Returns the first non-whitespace character in the paragraph containing
|
||||
@racket[pos], unless the position is already there, in which case it
|
||||
returns the first position of the paragraph.
|
||||
}
|
||||
}
|
||||
|
||||
@definterface[scheme:text-mode<%> ()]{
|
||||
The result of @scheme[scheme:text-mode-mixin] implements this
|
||||
The result of @racket[scheme:text-mode-mixin] implements this
|
||||
interface.
|
||||
}
|
||||
|
||||
@defmixin[scheme:text-mode-mixin
|
||||
(color:text-mode<%> mode:surrogate-text<%>)
|
||||
(scheme:text-mode<%>)]{
|
||||
This mixin adds Racket mode functionality to the mode that it is mixed
|
||||
into. The resulting mode assumes that it is only set to an editor
|
||||
that is the result of @scheme[scheme:text-mixin].
|
||||
This mixin adds Racket mode functionality to the mode that it is mixed into.
|
||||
The resulting mode assumes that it is only set to an editor that is the
|
||||
result of @racket[scheme:text-mixin].
|
||||
|
||||
@defmethod*[#:mode override (((on-disable-surrogate) void?))]{
|
||||
Removes the scheme keymap (see also @scheme[scheme:get-keymap]) and
|
||||
Removes the scheme keymap (see also @racket[scheme:get-keymap]) and
|
||||
disables any parenthesis highlighting in the host editor.
|
||||
}
|
||||
|
||||
@defmethod*[#:mode override (((on-enable-surrogate) void?))]{
|
||||
Adds the scheme keymap (see also @scheme[scheme:get-keymap]) and
|
||||
enables a parenthesis highlighting in the host editor.
|
||||
Adds the scheme keymap (see also @racket[scheme:get-keymap]) and enables a
|
||||
parenthesis highlighting in the host editor.
|
||||
}
|
||||
}
|
||||
|
||||
@defmixin[scheme:set-mode-mixin (scheme:text<%> mode:host-text<%>) ()]{
|
||||
This mixin creates a new instance of @scheme[scheme:text-mode%] and
|
||||
installs it, by calling its own @method[mode:host-text<%>
|
||||
set-surrogate] method with the object.
|
||||
This mixin creates a new instance of @racket[scheme:text-mode%] and installs
|
||||
it, by calling its own @method[mode:host-text<%> set-surrogate] method with
|
||||
the object.
|
||||
}
|
||||
|
||||
@defclass[scheme:text%
|
||||
(scheme:set-mode-mixin
|
||||
(scheme:text-mixin
|
||||
(text:autocomplete-mixin (mode:host-text-mixin color:text%))))
|
||||
()]{}
|
||||
|
||||
@defclass[scheme:text-mode% (scheme:text-mode-mixin color:text-mode%) ()]{}
|
||||
|
||||
@(include-previously-extracted "main-extracts.rkt" #rx"^scheme:")
|
||||
|
|
|
@ -73,7 +73,7 @@ that number to control the gauge along the bottom of the splash screen.
|
|||
the initial bitmap, use @racket[start-splash] instead.
|
||||
}
|
||||
@defproc[(get-splash-canvas) (is-a?/c canvas%)]{
|
||||
Returns the canvas where the splash screen bitmap is drawn (if there is a bitmap; see @racket[start-splash] for how the splash is drawn.
|
||||
Returns the canvas where the splash screen bitmap is drawn (if there is a bitmap); see @racket[start-splash] for how the splash is drawn.
|
||||
}
|
||||
@defproc[(get-splash-eventspace) eventspace?]{
|
||||
Returns the splash screen's eventspace.
|
||||
|
@ -129,5 +129,5 @@ that number to control the gauge along the bottom of the splash screen.
|
|||
Triggers a refresh of the splash, handling the details of double buffering
|
||||
and doing the drawing on the splash's
|
||||
@tech[#:doc '(lib "scribblings/gui/gui.scrbl") #:key "eventspace"]{eventspace's}
|
||||
main thread.
|
||||
main thread.
|
||||
}
|
||||
|
|
|
@ -7,110 +7,95 @@
|
|||
@defmodule*/no-declare[(framework/test)]
|
||||
@declare-exporting[framework/test framework]
|
||||
|
||||
The framework provides several new primitive functions that simulate
|
||||
user actions, which may be used to test applications. You use these
|
||||
primitives and combine them just as regular Racket functions. For
|
||||
example,
|
||||
@schemeblock[
|
||||
(test:keystroke #\A)
|
||||
(test:menu-select "File" "Save")
|
||||
The framework provides several new primitive functions that simulate user
|
||||
actions, which may be used to test applications. You use these primitives and
|
||||
combine them just as regular Racket functions. For example,
|
||||
@racketblock[
|
||||
(test:keystroke #\A)
|
||||
(test:menu-select "File" "Save")
|
||||
]
|
||||
sends a keystroke event to the window with the keyboard focus and invokes
|
||||
the callback function for the ``Save'' menu item from the ``File'' menu.
|
||||
This has the same effect as if the user typed the key ``A'', pulled
|
||||
down the ``File'' menu and selected ``Save''.
|
||||
sends a keystroke event to the window with the keyboard focus and invokes the
|
||||
callback function for the ``Save'' menu item from the ``File'' menu. This has
|
||||
the same effect as if the user typed the key ``A'', pulled down the ``File''
|
||||
menu and selected ``Save''.
|
||||
|
||||
It is possible to load this portion of the framework without loading
|
||||
the rest of the framework. Use
|
||||
@scheme[(require framework/test)].
|
||||
It is possible to load this portion of the framework without loading the rest
|
||||
of the framework. Use @racket[(require framework/test)].
|
||||
|
||||
Currently, the test engine has primitives for pushing
|
||||
buttons, setting check-boxes and choices, sending keystrokes,
|
||||
selecting menu items and clicking the mouse. Many functions
|
||||
that are also useful in application testing, such as
|
||||
traversing a tree of panels, getting the text from a canvas,
|
||||
determining if a window is shown, and so on, exist in GRacket.
|
||||
Currently, the test engine has primitives for pushing buttons, setting
|
||||
check-boxes and choices, sending keystrokes, selecting menu items and clicking
|
||||
the mouse. Many functions that are also useful in application testing, such as
|
||||
traversing a tree of panels, getting the text from a canvas, determining if a
|
||||
window is shown, and so on, exist in GRacket.
|
||||
|
||||
@section[#:tag "test:actions-completeness"]{Actions and completeness}
|
||||
|
||||
The actions associated with a testing primitive may not have finished
|
||||
when the primitive returns to its caller.
|
||||
Some actions may yield control before they can complete.
|
||||
For example, selecting ``Save As...'' from the ``File'' menu
|
||||
opens a dialog box and will not complete until the ``OK''
|
||||
or ``Cancel'' button is pushed.
|
||||
The actions associated with a testing primitive may not have finished when the
|
||||
primitive returns to its caller. Some actions may yield control before they
|
||||
can complete. For example, selecting ``Save As...'' from the ``File'' menu
|
||||
opens a dialog box and will not complete until the ``OK'' or ``Cancel'' button
|
||||
is pushed.
|
||||
|
||||
However, all testing functions wait at least a minimum interval
|
||||
before returning to give the action a chance to finish.
|
||||
This interval controls the speed at which the test suite runs,
|
||||
and gives some slack time for events to complete.
|
||||
The default interval is 100 milliseconds. The interval can be queried
|
||||
or set with @scheme[test:run-interval].
|
||||
However, all testing functions wait at least a minimum interval before
|
||||
returning to give the action a chance to finish. This interval controls the
|
||||
speed at which the test suite runs, and gives some slack time for events to
|
||||
complete. The default interval is 100 milliseconds. The interval can be
|
||||
queried or set with @racket[test:run-interval].
|
||||
|
||||
A primitive action will not return until the run-interval has
|
||||
expired and the action has finished, raised an error, or yielded.
|
||||
The number of incomplete actions is given by
|
||||
@scheme[test:number-pending-actions].
|
||||
A primitive action will not return until the run-interval has expired and the
|
||||
action has finished, raised an error, or yielded. The number of incomplete
|
||||
actions is given by @racket[test:number-pending-actions].
|
||||
|
||||
@italic{Note:}
|
||||
Once a primitive action is started, it is not possible to undo it
|
||||
or kill its remaining effect.
|
||||
Thus, it is not possible to write a utility that flushes the
|
||||
Once a primitive action is started, it is not possible to undo it or kill its
|
||||
remaining effect. Thus, it is not possible to write a utility that flushes the
|
||||
incomplete actions and resets number-pending-actions to zero.
|
||||
|
||||
However, actions which do not complete right away often provide a
|
||||
way to cancel themselves.
|
||||
For example, many dialog boxes have a ``Cancel'' button which will
|
||||
terminate the action with no further effect.
|
||||
But this is accomplished by sending an additional action
|
||||
(the button push), not by undoing the original action.
|
||||
However, actions which do not complete right away often provide a way to cancel
|
||||
themselves. For example, many dialog boxes have a ``Cancel'' button which will
|
||||
terminate the action with no further effect. But this is accomplished by
|
||||
sending an additional action (the button push), not by undoing the original
|
||||
action.
|
||||
|
||||
@section[#:tag "test:errors"]{Errors}
|
||||
|
||||
Errors in the primitive actions (which necessarily run in the
|
||||
handler thread) are caught and reraised in the calling thread.
|
||||
Errors in the primitive actions (which necessarily run in the handler thread)
|
||||
are caught and reraised in the calling thread.
|
||||
|
||||
However, the primitive actions can only guarantee that the action
|
||||
has started, and they may return before the action has completed.
|
||||
As a consequence, an action may raise an error long after the
|
||||
function that started it has returned.
|
||||
In this case, the error is saved and reraised at the first opportunity
|
||||
(the next primitive action).
|
||||
However, the primitive actions can only guarantee that the action has started,
|
||||
and they may return before the action has completed. As a consequence, an
|
||||
action may raise an error long after the function that started it has returned.
|
||||
In this case, the error is saved and reraised at the first opportunity (the
|
||||
next primitive action).
|
||||
|
||||
The test engine keeps a buffer for one error, saving only the
|
||||
first error. Any subsequent errors are discarded.
|
||||
Reraising an error empties the buffer, allowing the next error
|
||||
to be saved.
|
||||
The test engine keeps a buffer for one error, saving only the first error. Any
|
||||
subsequent errors are discarded. Reraising an error empties the buffer,
|
||||
allowing the next error to be saved.
|
||||
|
||||
The function @scheme[test:reraise-error]
|
||||
reraises any pending errors.
|
||||
The function @racket[test:reraise-error] reraises any pending errors.
|
||||
|
||||
@section{Technical Issues}
|
||||
|
||||
@subsection{Active Frame}
|
||||
|
||||
The Self Test primitive actions all implicitly apply to the
|
||||
top-most (active) frame.
|
||||
The Self Test primitive actions all implicitly apply to the top-most (active)
|
||||
frame.
|
||||
|
||||
@subsection{Thread Issues}
|
||||
|
||||
The code started by the primitive actions must run in the handler
|
||||
thread of the eventspace where the event takes place. As a result,
|
||||
the test suite that invokes the primitive actions must @italic{not} run
|
||||
in that handler thread (or else some actions will deadlock). See
|
||||
@scheme[make-eventspace]
|
||||
for more info.
|
||||
The code started by the primitive actions must run in the handler thread of the
|
||||
eventspace where the event takes place. As a result, the test suite that
|
||||
invokes the primitive actions must @italic{not} run in that handler thread (or
|
||||
else some actions will deadlock). See @racket[make-eventspace] for more info.
|
||||
|
||||
@subsection{Window Manager (Unix only)}
|
||||
|
||||
In order for the Self Tester to work correctly, the window manager
|
||||
must set the keyboard focus to follow the active frame.
|
||||
This is the default behavior in Microsoft Windows and MacOS,
|
||||
but not in X windows.
|
||||
In order for the Self Tester to work correctly, the window manager must set the
|
||||
keyboard focus to follow the active frame. This is the default behavior in
|
||||
Microsoft Windows and MacOS, but not in X windows.
|
||||
|
||||
In X windows, you must explicitly tell your window manager to set the
|
||||
keyboard focus to the top-most frame, regardless of the position of the
|
||||
actual mouse.
|
||||
In X windows, you must explicitly tell your window manager to set the keyboard
|
||||
focus to the top-most frame, regardless of the position of the actual mouse.
|
||||
|
||||
@section{Test Functions}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -3,33 +3,27 @@
|
|||
|
||||
@definterface/title[add-color<%> ()]{
|
||||
|
||||
An @scheme[add-color<%>] object is used to additively change the RGB
|
||||
values of a @scheme[color%] object. An @scheme[add-color<%>] object
|
||||
only exists within a @scheme[style-delta%] object.
|
||||
|
||||
See also @method[style-delta% get-foreground-add] and
|
||||
@method[style-delta% get-background-add].
|
||||
|
||||
An @racket[add-color<%>] object is used to additively change the RGB values of
|
||||
a @racket[color%] object. An @racket[add-color<%>] object only exists within a
|
||||
@racket[style-delta%] object.
|
||||
|
||||
See also @method[style-delta% get-foreground-add] and @method[style-delta%
|
||||
get-background-add].
|
||||
|
||||
@defmethod[(get [r (box/c (integer-in -1000 1000))]
|
||||
[g (box/c (integer-in -1000 1000))]
|
||||
[b (box/c (integer-in -1000 1000))])
|
||||
void?]{
|
||||
Gets all of the additive values.
|
||||
|
||||
Gets all of the additive values.
|
||||
|
||||
@boxisfill[(scheme r) @elem{the additive value for the red component of the color}]
|
||||
@boxisfill[(scheme g) @elem{the additive value for the green component of the color}]
|
||||
@boxisfill[(scheme b) @elem{the additive value for the blue component of the color}]
|
||||
|
||||
@boxisfill[(scheme r) @elem{the additive value for the red component of the color}]
|
||||
@boxisfill[(scheme g) @elem{the additive value for the green component of the color}]
|
||||
@boxisfill[(scheme b) @elem{the additive value for the blue component of the color}]
|
||||
}
|
||||
|
||||
@defmethod[(get-b)
|
||||
(integer-in -1000 1000)]{
|
||||
|
||||
Gets the additive value for the blue component of the color.
|
||||
|
||||
Gets the additive value for the blue component of the color.
|
||||
}
|
||||
|
||||
@defmethod[(get-g)
|
||||
|
@ -41,38 +35,28 @@ Gets the additive value for the green component of the color.
|
|||
|
||||
@defmethod[(get-r)
|
||||
(integer-in -1000 1000)]{
|
||||
|
||||
Gets the additive value for the red component of the color.
|
||||
|
||||
Gets the additive value for the red component of the color.
|
||||
}
|
||||
|
||||
@defmethod[(set [r (integer-in -1000 1000)]
|
||||
[g (integer-in -1000 1000)]
|
||||
[b (integer-in -1000 1000)])
|
||||
void?]{
|
||||
|
||||
Sets all of the additive values.
|
||||
|
||||
Sets all of the additive values.
|
||||
}
|
||||
|
||||
@defmethod[(set-b [v (integer-in -1000 1000)])
|
||||
void?]{
|
||||
|
||||
Sets the additive value for the blue component of the color.
|
||||
|
||||
Sets the additive value for the blue component of the color.
|
||||
}
|
||||
|
||||
@defmethod[(set-g [v (integer-in -1000 1000)])
|
||||
void?]{
|
||||
|
||||
Sets the additive value for the green component of the color.
|
||||
|
||||
Sets the additive value for the green component of the color.
|
||||
}
|
||||
|
||||
@defmethod[(set-r [v (integer-in -1000 1000)])
|
||||
void?]{
|
||||
|
||||
Sets the additive value for the red component of the color.
|
||||
|
||||
Sets the additive value for the red component of the color.
|
||||
}}
|
||||
|
||||
|
|
|
@ -3,18 +3,18 @@
|
|||
|
||||
@definterface/title[area-container<%> (area<%>)]{
|
||||
|
||||
An @scheme[area-container<%>] is a container @scheme[area<%>].
|
||||
An @racket[area-container<%>] is a container @racket[area<%>].
|
||||
|
||||
All @scheme[area-container<%>] classes accept the following named
|
||||
instantiation arguments:
|
||||
All @racket[area-container<%>] classes accept the following named
|
||||
instantiation arguments:
|
||||
@itemize[
|
||||
|
||||
@item{@indexed-scheme[border] --- default is @scheme[0]; passed to
|
||||
@item{@indexed-racket[border] --- default is @racket[0]; passed to
|
||||
@method[area-container<%> border]}
|
||||
@item{@indexed-scheme[spacing] --- default is @scheme[0]; passed to
|
||||
@item{@indexed-racket[spacing] --- default is @racket[0]; passed to
|
||||
@method[area-container<%> spacing]}
|
||||
@item{@indexed-scheme[alignment] --- default is class-specific, such as
|
||||
@scheme['(center top)] for @scheme[vertical-panel%]; the list
|
||||
@item{@indexed-racket[alignment] --- default is class-specific, such as
|
||||
@racket['(center top)] for @racket[vertical-panel%]; the list
|
||||
elements are passed to
|
||||
@method[area-container<%> set-alignment]}
|
||||
]
|
||||
|
@ -200,15 +200,15 @@ Sets the alignment specification for a container, which determines how
|
|||
it positions its children when the container has leftover space (when
|
||||
a child was not stretchable in a particular dimension).
|
||||
|
||||
When the container's horizontal alignment is @scheme['left], the
|
||||
When the container's horizontal alignment is @racket['left], the
|
||||
children are left-aligned in the container and whitespace is inserted
|
||||
to the right. When the container's horizontal alignment is
|
||||
@scheme['center], each child is horizontally centered in the
|
||||
@racket['center], each child is horizontally centered in the
|
||||
container. When the container's horizontal alignment is
|
||||
@scheme['right], leftover whitespace is inserted to the left.
|
||||
@racket['right], leftover whitespace is inserted to the left.
|
||||
|
||||
Similarly, a container's vertical alignment can be @scheme['top],
|
||||
@scheme['center], or @scheme['bottom].
|
||||
Similarly, a container's vertical alignment can be @racket['top],
|
||||
@racket['center], or @racket['bottom].
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -3,22 +3,22 @@
|
|||
|
||||
@definterface/title[area<%> ()]{
|
||||
|
||||
An @scheme[area<%>] object is either a window or a windowless
|
||||
An @racket[area<%>] object is either a window or a windowless
|
||||
container for managing the position and size of other areas. An
|
||||
@scheme[area<%>] can be a container, a containee, or both. The only
|
||||
@racket[area<%>] can be a container, a containee, or both. The only
|
||||
areas without a parent are top-level windows.
|
||||
|
||||
All @scheme[area<%>] classes accept the following named instantiation
|
||||
All @racket[area<%>] classes accept the following named instantiation
|
||||
arguments:
|
||||
@itemize[
|
||||
|
||||
@item{@indexed-scheme[min-width] --- default is the initial graphical minimum width; passed to
|
||||
@item{@indexed-racket[min-width] --- default is the initial graphical minimum width; passed to
|
||||
@method[area<%> min-width]}
|
||||
@item{@indexed-scheme[min-height] --- default is the initial graphical minimum height; passed to
|
||||
@item{@indexed-racket[min-height] --- default is the initial graphical minimum height; passed to
|
||||
@method[area<%> min-height]}
|
||||
@item{@indexed-scheme[stretchable-width] --- default is class-specific; passed to
|
||||
@item{@indexed-racket[stretchable-width] --- default is class-specific; passed to
|
||||
@method[area<%> stretchable-width]}
|
||||
@item{@indexed-scheme[stretchable-height] --- default is class-specific; passed to
|
||||
@item{@indexed-racket[stretchable-height] --- default is class-specific; passed to
|
||||
@method[area<%> stretchable-height]}
|
||||
]
|
||||
|
||||
|
@ -42,7 +42,7 @@ See @|geomdiscuss| for more information. Note that the return value
|
|||
(or/c (is-a?/c area-container<%>) false/c)]{
|
||||
|
||||
Returns the area's parent. A top-level window may have no parent (in
|
||||
which case @scheme[#f] is returned), or it may have another top-level
|
||||
which case @racket[#f] is returned), or it may have another top-level
|
||||
window as its parent.
|
||||
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ An area's initial minimum width is its graphical minimum width. See
|
|||
also
|
||||
@method[area<%> get-graphical-min-size] .
|
||||
|
||||
When setting the minimum width, if @scheme[w] is smaller than the
|
||||
When setting the minimum width, if @racket[w] is smaller than the
|
||||
internal hard minimum, @|MismatchExn|.
|
||||
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ An area's initial minimum height is its graphical minimum height. See
|
|||
also
|
||||
@method[area<%> get-graphical-min-size] .
|
||||
|
||||
When setting the minimum height (in pixels); if @scheme[h] is smaller
|
||||
When setting the minimum height (in pixels); if @racket[h] is smaller
|
||||
than the internal hard minimum, @|MismatchExn|.
|
||||
|
||||
}
|
||||
|
|
|
@ -35,8 +35,8 @@
|
|||
@method[top-level-window<%> on-traverse-char]).})
|
||||
|
||||
(define (labelstripped where detail what)
|
||||
@elem{If @litchar{&} occurs in @|where|@|detail|, it
|
||||
is specially parsed as for @scheme[button%].})
|
||||
@elem{If @litchar{&} occurs in @|where|@|detail|, it
|
||||
is specially parsed as for @racket[button%].})
|
||||
|
||||
(define (bitmapuseinfo pre what thing and the)
|
||||
@elem{@|pre| @|what| is @|thing|,@|and| if @|the|
|
||||
|
@ -62,7 +62,7 @@
|
|||
(define (popupmenuinfo what other more)
|
||||
(make-splice
|
||||
(list*
|
||||
@p{Pops up the given @scheme[popup-menu%] object at the specified
|
||||
@p{Pops up the given @racket[popup-menu%] object at the specified
|
||||
coordinates (in this window's coordinates), and returns after
|
||||
handling an unspecified number of events; the menu may still be
|
||||
popped up when this method returns. If a menu item is selected from
|
||||
|
@ -105,7 +105,7 @@ information@|details|, even if the editor currently has delayed refreshing (see
|
|||
|
||||
(define FCA (FCAX "C" ""))
|
||||
(define FCAMW (FCAX "C" " if a maximum width is set for the editor"))
|
||||
(define (FCAME) (FCAX @elem{For @scheme[text%] objects, c} " if a maximum width is set for the editor"))
|
||||
(define (FCAME) (FCAX @elem{For @racket[text%] objects, c} " if a maximum width is set for the editor"))
|
||||
|
||||
(define EVD
|
||||
@elem{If the editor is not displayed and the editor has a
|
||||
|
@ -158,20 +158,20 @@ information@|details|, even if the editor currently has delayed refreshing (see
|
|||
|
||||
(define DrawSizeNote "")
|
||||
|
||||
(define LineNumbering @elem{Lines are numbered starting with @scheme[0].})
|
||||
(define ParagraphNumbering @elem{Paragraphs are numbered starting with @scheme[0].})
|
||||
(define LineNumbering @elem{Lines are numbered starting with @racket[0].})
|
||||
(define ParagraphNumbering @elem{Paragraphs are numbered starting with @racket[0].})
|
||||
|
||||
(define (italicptyStyleNote style)
|
||||
@elem{The @|style| argument is provided for future extensions. Currently, @|style| must be the empty list.})
|
||||
|
||||
(define (HVLabelNote style what)
|
||||
@elem{If @|style| includes @scheme['vertical-label], then the @|what| is
|
||||
@elem{If @|style| includes @racket['vertical-label], then the @|what| is
|
||||
created with a label above the control; if @|style| does not include
|
||||
@scheme['vertical-label] (and optionally includes @scheme['horizontal-label]), then the
|
||||
@racket['vertical-label] (and optionally includes @racket['horizontal-label]), then the
|
||||
label is created to the left of the @|what|.})
|
||||
|
||||
(define (DeletedStyleNote style parent what)
|
||||
@elem{If @|style| includes @scheme['deleted], then the @|what| is created as hidden,
|
||||
@elem{If @|style| includes @racket['deleted], then the @|what| is created as hidden,
|
||||
and it does not affect its parent's geometry; the @|what| can be made active later by calling
|
||||
@|parent|'s @method[area-container<%> add-child] method.})
|
||||
|
||||
|
@ -183,18 +183,18 @@ information@|details|, even if the editor currently has delayed refreshing (see
|
|||
(define (FontLabelKWs font label-font) @elem{The @|font| argument determines the font for the control content,
|
||||
and @|label-font| determines the font for the control label.})
|
||||
|
||||
(define (WindowKWs enabled) @elem{For information about the @|enabled| argument, see @scheme[window<%>].})
|
||||
(define (WindowKWs enabled) @elem{For information about the @|enabled| argument, see @racket[window<%>].})
|
||||
(define-inline (SubareaKWs)
|
||||
@elem{For information about the @scheme[horiz-margin] and @scheme[vert-margin]
|
||||
arguments, see @scheme[subarea<%>].})
|
||||
@elem{For information about the @racket[horiz-margin] and @racket[vert-margin]
|
||||
arguments, see @racket[subarea<%>].})
|
||||
(define-inline (AreaContKWs)
|
||||
@elem{For information about the @scheme[border], @scheme[spacing], and @scheme[alignment]
|
||||
arguments, see @scheme[area-container<%>].})
|
||||
@elem{For information about the @racket[border], @racket[spacing], and @racket[alignment]
|
||||
arguments, see @racket[area-container<%>].})
|
||||
|
||||
(define-inline (AreaKWs)
|
||||
@elem{For information about the
|
||||
@scheme[min-width], @scheme[min-height], @scheme[stretchable-width], and
|
||||
@scheme[stretchable-height] arguments, see @scheme[area<%>].})
|
||||
@racket[min-width], @racket[min-height], @racket[stretchable-width], and
|
||||
@racket[stretchable-height] arguments, see @racket[area<%>].})
|
||||
|
||||
(define AFM @elem{Adobe Font Metrics})
|
||||
|
||||
|
@ -246,7 +246,7 @@ information@|details|, even if the editor currently has delayed refreshing (see
|
|||
(bytes->string/latin-1 name))))
|
||||
|
||||
(define (edsnipsize a b c)
|
||||
@elem{An @scheme[editor-snip%] normally stretches to wrap around the size
|
||||
@elem{An @racket[editor-snip%] normally stretches to wrap around the size
|
||||
of the editor it contains. This method @|a| of the snip
|
||||
(and if the editor is @|b|, @|c|).})
|
||||
(define (edsnipmax n)
|
||||
|
|
|
@ -31,7 +31,7 @@ Creates a button with a string label, bitmap label, or both.
|
|||
symbol @racket['left], @racket['top], @racket['right], or @racket['bottom]
|
||||
specifies the location of the image relative to the text on the button.
|
||||
|
||||
If @litchar{&} occurs in @scheme[label] (when @scheme[label] includes a
|
||||
If @litchar{&} occurs in @racket[label] (when @racket[label] includes a
|
||||
string), it is specially parsed; on Windows and Unix, the character
|
||||
following @litchar{&} is underlined in the displayed control to
|
||||
indicate a keyboard mnemonic. (On Mac OS X, mnemonic underlines are
|
||||
|
@ -41,8 +41,8 @@ mnemonic when the control's top-level-window contains the keyboard
|
|||
focus. The user must also hold down the Meta or Alt key if the
|
||||
keyboard focus is currently in a control that handles normal
|
||||
alphanumeric input. The @litchar{&} itself is removed from
|
||||
@scheme[label] before it is displayed for the control; a @litchar{&&}
|
||||
in @scheme[label] is converted to @litchar{&} (with no mnemonic
|
||||
@racket[label] before it is displayed for the control; a @litchar{&&}
|
||||
in @racket[label] is converted to @litchar{&} (with no mnemonic
|
||||
underlining). On Mac OS X, a parenthesized mnemonic character is
|
||||
removed (along with any surrounding space) before the label is
|
||||
displayed, since a parenthesized mnemonic is often used for non-Roman
|
||||
|
@ -51,15 +51,15 @@ platforms. Mnemonic keyboard events are handled by
|
|||
@method[top-level-window<%> on-traverse-char] (but not on Mac OS
|
||||
X).
|
||||
|
||||
The @scheme[callback] procedure is called (with the event type
|
||||
@indexed-scheme['button]) whenever the user clicks the button.
|
||||
The @racket[callback] procedure is called (with the event type
|
||||
@indexed-racket['button]) whenever the user clicks the button.
|
||||
|
||||
If @scheme[style] includes @scheme['border], the button is drawn with
|
||||
If @racket[style] includes @racket['border], the button is drawn with
|
||||
a special border that indicates to the user that it is the default
|
||||
action button (see @method[top-level-window<%>
|
||||
on-traverse-char]). @DeletedStyleNote[@scheme[style] @scheme[parent]]{button}
|
||||
on-traverse-char]). @DeletedStyleNote[@racket[style] @racket[parent]]{button}
|
||||
|
||||
@FontKWs[@scheme[font]] @WindowKWs[@scheme[enabled]] @SubareaKWs[] @AreaKWs[]}
|
||||
@FontKWs[@racket[font]] @WindowKWs[@racket[enabled]] @SubareaKWs[] @AreaKWs[]}
|
||||
|
||||
|
||||
@defmethod[#:mode override
|
||||
|
@ -67,7 +67,7 @@ on-traverse-char]). @DeletedStyleNote[@scheme[style] @scheme[parent]]{button}
|
|||
(is-a?/c bitmap%))])
|
||||
void?]{
|
||||
|
||||
The same as @xmethod[window<%> set-label] when @scheme[label] is a
|
||||
The same as @xmethod[window<%> set-label] when @racket[label] is a
|
||||
string.
|
||||
|
||||
Otherwise, sets the bitmap label for a bitmap button. @bitmaplabeluseisbm[label]
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
@defclass/title[canvas% object% (canvas<%>)]{
|
||||
|
||||
A @scheme[canvas%] object is a general-purpose window for drawing and
|
||||
A @racket[canvas%] object is a general-purpose window for drawing and
|
||||
handling events. See @racket[canvas<%>] for information about drawing
|
||||
onto a canvas.
|
||||
|
||||
|
@ -25,77 +25,77 @@ A @scheme[canvas%] object is a general-purpose window for drawing and
|
|||
[stretchable-width any/c #t]
|
||||
[stretchable-height any/c #t])]{
|
||||
|
||||
The @scheme[style] argument indicates one or more of the following styles:
|
||||
The @racket[style] argument indicates one or more of the following styles:
|
||||
|
||||
@itemize[
|
||||
|
||||
@item{@scheme['border] --- gives the canvas a thin border}
|
||||
@item{@racket['border] --- gives the canvas a thin border}
|
||||
|
||||
@item{@scheme['control-border] --- gives the canvas a border that is
|
||||
like a @scheme[text-field%] control}
|
||||
@item{@racket['control-border] --- gives the canvas a border that is
|
||||
like a @racket[text-field%] control}
|
||||
|
||||
@item{@scheme['combo] --- gives the canvas a combo button that is like
|
||||
a @scheme[combo-field%] control; this style is intended for use
|
||||
with @scheme['control-border] and not with @scheme['hscroll] or
|
||||
@scheme['vscroll]}
|
||||
@item{@racket['combo] --- gives the canvas a combo button that is like
|
||||
a @racket[combo-field%] control; this style is intended for use
|
||||
with @racket['control-border] and not with @racket['hscroll] or
|
||||
@racket['vscroll]}
|
||||
|
||||
@item{@scheme['hscroll] --- enables horizontal scrolling (initially visible but inactive)}
|
||||
@item{@racket['hscroll] --- enables horizontal scrolling (initially visible but inactive)}
|
||||
|
||||
@item{@scheme['vscroll] --- enables vertical scrolling (initially visible but inactive)}
|
||||
@item{@racket['vscroll] --- enables vertical scrolling (initially visible but inactive)}
|
||||
|
||||
@item{@scheme['resize-corner] --- leaves room for a resize control at the canvas's
|
||||
@item{@racket['resize-corner] --- leaves room for a resize control at the canvas's
|
||||
bottom right when only one scrollbar is visible}
|
||||
|
||||
@item{@scheme['gl] --- creates a canvas for OpenGL drawing instead of
|
||||
@item{@racket['gl] --- creates a canvas for OpenGL drawing instead of
|
||||
normal @racket[dc<%>] drawing; call the @method[dc<%>
|
||||
get-gl-context] method on the result of @method[canvas<%>
|
||||
get-dc]; this style is usually combined with
|
||||
@racket['no-autoclear]}
|
||||
|
||||
@item{@scheme['no-autoclear] --- prevents automatic erasing of the
|
||||
@item{@racket['no-autoclear] --- prevents automatic erasing of the
|
||||
canvas by the windowing system; see @racket[canvas<%>] for
|
||||
information on canvas refresh}
|
||||
|
||||
@item{@scheme['transparent] --- the canvas is ``erased'' by the
|
||||
@item{@racket['transparent] --- the canvas is ``erased'' by the
|
||||
windowing system by letting its parent show through; see
|
||||
@racket[canvas<%>] for information on window refresh and on the
|
||||
interaction of @racket['transparent] and offscreen buffering; the
|
||||
result is undefined if this flag is combined with
|
||||
@scheme['no-autoclear]}
|
||||
@racket['no-autoclear]}
|
||||
|
||||
@item{@scheme['no-focus] --- prevents the canvas from accepting the
|
||||
@item{@racket['no-focus] --- prevents the canvas from accepting the
|
||||
keyboard focus when the canvas is clicked, or when the
|
||||
@method[window<%> focus] method is called}
|
||||
|
||||
@item{@scheme['deleted] --- creates the canvas as initially hidden and without affecting
|
||||
@scheme[parent]'s geometry; the canvas can be made active
|
||||
later by calling @scheme[parent]'s @method[area-container<%> add-child]
|
||||
@item{@racket['deleted] --- creates the canvas as initially hidden and without affecting
|
||||
@racket[parent]'s geometry; the canvas can be made active
|
||||
later by calling @racket[parent]'s @method[area-container<%> add-child]
|
||||
method}
|
||||
|
||||
]
|
||||
|
||||
The @scheme['hscroll] and @scheme['vscroll] styles create a
|
||||
The @racket['hscroll] and @racket['vscroll] styles create a
|
||||
canvas with an initially inactive scrollbar. The scrollbars are
|
||||
activated with either
|
||||
@method[canvas% init-manual-scrollbars] or
|
||||
@method[canvas% init-auto-scrollbars], and they can be hidden and re-shown with
|
||||
@method[canvas% show-scrollbars].
|
||||
|
||||
The @scheme[paint-callback] argument is called by the default
|
||||
The @racket[paint-callback] argument is called by the default
|
||||
@method[canvas% on-paint] method, using the canvas and the DC returned by
|
||||
@method[canvas<%> get-dc] as the argument.
|
||||
|
||||
The @scheme[label] argument names the canvas for
|
||||
The @racket[label] argument names the canvas for
|
||||
@method[window<%> get-label], but it is not displayed with the canvas.
|
||||
|
||||
The @scheme[gl-config] argument determines properties of an OpenGL
|
||||
The @racket[gl-config] argument determines properties of an OpenGL
|
||||
context for this canvas, as obtained through the canvas's drawing
|
||||
context. See also
|
||||
@method[canvas<%> get-dc] and
|
||||
@xmethod[dc<%> get-gl-context].
|
||||
|
||||
|
||||
@WindowKWs[@scheme[enabled]] @SubareaKWs[] @AreaKWs[]
|
||||
@WindowKWs[@racket[enabled]] @SubareaKWs[] @AreaKWs[]
|
||||
|
||||
}
|
||||
|
||||
|
@ -104,10 +104,10 @@ The @scheme[gl-config] argument determines properties of an OpenGL
|
|||
(integer-in 1 1000000)]{
|
||||
|
||||
Get the current page step size of a manual scrollbar. The result is
|
||||
@scheme[0] if the scrollbar is not active or it is automatic.
|
||||
@racket[0] if the scrollbar is not active or it is automatic.
|
||||
|
||||
The @scheme[which] argument is either @scheme['horizontal] or
|
||||
@scheme['vertical], indicating whether to get the page step size of
|
||||
The @racket[which] argument is either @racket['horizontal] or
|
||||
@racket['vertical], indicating whether to get the page step size of
|
||||
the horizontal or vertical scrollbar, respectively.
|
||||
|
||||
See also
|
||||
|
@ -119,10 +119,10 @@ See also
|
|||
(integer-in 0 1000000)]{
|
||||
|
||||
Gets the current value of a manual scrollbar. The result is always
|
||||
@scheme[0] if the scrollbar is not active or it is automatic.
|
||||
@racket[0] if the scrollbar is not active or it is automatic.
|
||||
|
||||
The @scheme[which] argument is either @scheme['horizontal] or
|
||||
@scheme['vertical], indicating that the value of the horizontal or
|
||||
The @racket[which] argument is either @racket['horizontal] or
|
||||
@racket['vertical], indicating that the value of the horizontal or
|
||||
vertical scrollbar should be returned, respectively.
|
||||
|
||||
See also
|
||||
|
@ -134,10 +134,10 @@ See also
|
|||
(integer-in 0 1000000)]{
|
||||
|
||||
Gets the current maximum value of a manual scrollbar. The result is
|
||||
always @scheme[0] if the scrollbar is not active or it is automatic.
|
||||
always @racket[0] if the scrollbar is not active or it is automatic.
|
||||
|
||||
The @scheme[which] argument is either @scheme['horizontal] or
|
||||
@scheme['vertical], indicating whether to get the maximum value of the
|
||||
The @racket[which] argument is either @racket['horizontal] or
|
||||
@racket['vertical], indicating whether to get the maximum value of the
|
||||
horizontal or vertical scrollbar, respectively.
|
||||
|
||||
See also
|
||||
|
@ -157,7 +157,7 @@ efficiently redraw only the visible portion of the canvas. The
|
|||
values are in pixels.
|
||||
|
||||
If the scrollbars are disabled or initialized as manual (see
|
||||
@method[canvas% init-manual-scrollbars]), the result is @scheme[(values 0 0)].
|
||||
@method[canvas% init-manual-scrollbars]), the result is @racket[(values 0 0)].
|
||||
|
||||
}
|
||||
|
||||
|
@ -181,8 +181,8 @@ Gets the size in device units of the scrollable canvas area (as
|
|||
|
||||
Enables and initializes automatic scrollbars for the canvas. A
|
||||
horizontal or vertical scrollbar can be activated only in a canvas
|
||||
that was created with the @indexed-scheme['hscroll] or
|
||||
@indexed-scheme['vscroll] style flag, respectively.
|
||||
that was created with the @indexed-racket['hscroll] or
|
||||
@indexed-racket['vscroll] style flag, respectively.
|
||||
|
||||
With automatic scrollbars, the programmer specifies the desired
|
||||
virtual size of the canvas, and the scrollbars are automatically
|
||||
|
@ -196,15 +196,15 @@ See also
|
|||
are independently enabled. Automatic scrollbars can be
|
||||
re-initialized as manual, and vice versa.
|
||||
|
||||
If either @scheme[horiz-pixels] or @scheme[vert-pixels] is
|
||||
@scheme[#f], the scrollbar is not enabled in the corresponding
|
||||
If either @racket[horiz-pixels] or @racket[vert-pixels] is
|
||||
@racket[#f], the scrollbar is not enabled in the corresponding
|
||||
direction, and the canvas's virtual size in that direction is the
|
||||
same as its client size.
|
||||
|
||||
The @scheme[h-value] and @scheme[v-value] arguments specify the initial
|
||||
The @racket[h-value] and @racket[v-value] arguments specify the initial
|
||||
values of the scrollbars as a fraction of the scrollbar's range. A
|
||||
@scheme[0.0] value initializes the scrollbar to its left/top, while a
|
||||
@scheme[1.0] value initializes the scrollbar to its right/bottom.
|
||||
@racket[0.0] value initializes the scrollbar to its left/top, while a
|
||||
@racket[1.0] value initializes the scrollbar to its right/bottom.
|
||||
|
||||
See also
|
||||
@method[canvas% on-scroll] and
|
||||
|
@ -222,8 +222,8 @@ See also
|
|||
|
||||
Enables and initializes manual scrollbars for the canvas. A
|
||||
horizontal or vertical scrollbar can be activated only in a canvas
|
||||
that was created with the @indexed-scheme['hscroll] or
|
||||
@indexed-scheme['vscroll] style flag, respectively.
|
||||
that was created with the @indexed-racket['hscroll] or
|
||||
@indexed-racket['vscroll] style flag, respectively.
|
||||
|
||||
With manual scrollbars, the programmer is responsible for managing all
|
||||
details of the scrollbars, and the scrollbar state has no effect on
|
||||
|
@ -236,20 +236,20 @@ See also
|
|||
are independently enabled. Automatic scrollbars can be re-initialized
|
||||
as manual, and vice versa.
|
||||
|
||||
The @scheme[h-length] and @scheme[v-length] arguments specify the length of
|
||||
The @racket[h-length] and @racket[v-length] arguments specify the length of
|
||||
each scrollbar in scroll steps (i.e., the maximum value of each
|
||||
scrollbar). If either is @scheme[#f], the scrollbar is disabled in the
|
||||
scrollbar). If either is @racket[#f], the scrollbar is disabled in the
|
||||
corresponding direction.
|
||||
|
||||
The @scheme[h-page] and @scheme[v-page] arguments set the number of
|
||||
The @racket[h-page] and @racket[v-page] arguments set the number of
|
||||
scrollbar steps in a page, i.e., the amount moved when pressing above
|
||||
or below the value indicator in the scrollbar control.
|
||||
|
||||
The @scheme[h-value] and @scheme[v-value] arguments specify the initial
|
||||
The @racket[h-value] and @racket[v-value] arguments specify the initial
|
||||
values of the scrollbars.
|
||||
|
||||
If @scheme[h-value] is greater than @scheme[h-length] or @scheme[v-value] is
|
||||
greater than @scheme[v-length], @|MismatchExn|. (The page step may be
|
||||
If @racket[h-value] is greater than @racket[h-length] or @racket[v-value] is
|
||||
greater than @racket[v-length], @|MismatchExn|. (The page step may be
|
||||
larger than the total size of a scrollbar.)
|
||||
|
||||
See also
|
||||
|
@ -270,16 +270,15 @@ canvas. See also @racket[make-screen-bitmap].}
|
|||
(on-paint)
|
||||
void?]{
|
||||
|
||||
Calls the procedure supplied as the @scheme[paint-callback] argument when
|
||||
the @scheme[canvas%] was created.
|
||||
|
||||
Calls the procedure supplied as the @racket[paint-callback] argument when
|
||||
the @racket[canvas%] was created.
|
||||
}
|
||||
|
||||
|
||||
@defmethod[(on-scroll [event (is-a?/c scroll-event%)])
|
||||
void?]{
|
||||
Called when the user changes one of the canvas's scrollbars. A
|
||||
@scheme[scroll-event%] argument provides information about the
|
||||
@racket[scroll-event%] argument provides information about the
|
||||
scroll action.
|
||||
|
||||
This method is called only when manual
|
||||
|
@ -313,16 +312,16 @@ flushing is enabled, and if @racket[flush?] is true, then
|
|||
Sets the values of automatic scrollbars. (This method has no effect on
|
||||
manual scrollbars.)
|
||||
|
||||
If either argument is @scheme[#f], the scrollbar value is not changed in
|
||||
If either argument is @racket[#f], the scrollbar value is not changed in
|
||||
the corresponding direction.
|
||||
|
||||
The @scheme[h-value] and @scheme[v-value] arguments each specify a fraction
|
||||
of the scrollbar's movement. A @scheme[0.0] value sets the scrollbar to
|
||||
its left/top, while a @scheme[1.0] value sets the scrollbar to its
|
||||
right/bottom. A @scheme[0.5] value sets the scrollbar to its middle. In
|
||||
general, if the canvas's virtual size is @scheme[_v], its client size is
|
||||
@scheme[_c], and @scheme[(> _v _c)], then scrolling to @scheme[_p]
|
||||
sets the view start to @scheme[(floor (* _p (- _v _c)))].
|
||||
The @racket[h-value] and @racket[v-value] arguments each specify a fraction
|
||||
of the scrollbar's movement. A @racket[0.0] value sets the scrollbar to
|
||||
its left/top, while a @racket[1.0] value sets the scrollbar to its
|
||||
right/bottom. A @racket[0.5] value sets the scrollbar to its middle. In
|
||||
general, if the canvas's virtual size is @racket[_v], its client size is
|
||||
@racket[_c], and @racket[(> _v _c)], then scrolling to @racket[_p]
|
||||
sets the view start to @racket[(floor (* _p (- _v _c)))].
|
||||
|
||||
See also
|
||||
@method[canvas% init-auto-scrollbars] and
|
||||
|
@ -338,8 +337,8 @@ See also
|
|||
Set the current page step size of a manual scrollbar. (This method has
|
||||
no effect on automatic scrollbars.)
|
||||
|
||||
The @scheme[which] argument is either @scheme['horizontal] or
|
||||
@scheme['vertical], indicating whether to set the page step size of
|
||||
The @racket[which] argument is either @racket['horizontal] or
|
||||
@racket['vertical], indicating whether to set the page step size of
|
||||
the horizontal or vertical scrollbar, respectively.
|
||||
|
||||
See also
|
||||
|
@ -355,8 +354,8 @@ See also
|
|||
Sets the current value of a manual scrollbar. (This method has no
|
||||
effect on automatic scrollbars.)
|
||||
|
||||
The @scheme[which] argument is either @scheme['horizontal] or
|
||||
@scheme['vertical], indicating whether to set the value of the
|
||||
The @racket[which] argument is either @racket['horizontal] or
|
||||
@racket['vertical], indicating whether to set the value of the
|
||||
horizontal or vertical scrollbar set, respectively.
|
||||
|
||||
@MonitorMethod[@elem{The value of the canvas's scrollbar} @elem{the user scrolling} @elem{@method[canvas% on-scroll]} @elem{scrollbar value}]
|
||||
|
@ -375,8 +374,8 @@ See also
|
|||
Sets the current maximum value of a manual scrollbar. (This method has
|
||||
no effect on automatic scrollbars.)
|
||||
|
||||
The @scheme[which] argument is either @scheme['horizontal] or
|
||||
@scheme['vertical], indicating whether to set the maximum value of the
|
||||
The @racket[which] argument is either @racket['horizontal] or
|
||||
@racket['vertical], indicating whether to set the maximum value of the
|
||||
horizontal or vertical scrollbar, respectively.
|
||||
|
||||
See also
|
||||
|
@ -389,17 +388,17 @@ See also
|
|||
void?]{
|
||||
|
||||
Shows or hides the scrollbars as indicated by
|
||||
@scheme[show-horiz?] and @scheme[show-vert?]. If
|
||||
@scheme[show-horiz?] is true and the canvas was not created with
|
||||
the @scheme['hscroll] style, @|MismatchExn|. Similarly, if
|
||||
@scheme[show-vert?] is true and the canvas was not created with
|
||||
the @scheme['vscroll] style, @|MismatchExn|.
|
||||
@racket[show-horiz?] and @racket[show-vert?]. If
|
||||
@racket[show-horiz?] is true and the canvas was not created with
|
||||
the @racket['hscroll] style, @|MismatchExn|. Similarly, if
|
||||
@racket[show-vert?] is true and the canvas was not created with
|
||||
the @racket['vscroll] style, @|MismatchExn|.
|
||||
|
||||
|
||||
The horizontal scrollbar can be shown only if the canvas was
|
||||
created with the @scheme['hscroll] style, and the vertical
|
||||
created with the @racket['hscroll] style, and the vertical
|
||||
scrollbar can be shown only if the canvas was created with the
|
||||
@scheme['vscroll] style. See also @method[canvas%
|
||||
@racket['vscroll] style. See also @method[canvas%
|
||||
init-auto-scrollbars] and @method[canvas%
|
||||
init-manual-scrollbars].
|
||||
|
||||
|
|
|
@ -6,14 +6,14 @@
|
|||
A canvas is a subwindow onto which graphics and text can be drawn. Canvases also
|
||||
receive mouse and keyboard events.
|
||||
|
||||
The @scheme[canvas<%>] interface is implemented by two classes:
|
||||
The @racket[canvas<%>] interface is implemented by two classes:
|
||||
@itemize[
|
||||
|
||||
@item{@scheme[canvas%] --- a canvas for arbitrary drawing and
|
||||
@item{@racket[canvas%] --- a canvas for arbitrary drawing and
|
||||
event handling; and}
|
||||
|
||||
@item{@scheme[editor-canvas%] --- a canvas for displaying
|
||||
@scheme[editor<%>] objects.}
|
||||
@item{@racket[editor-canvas%] --- a canvas for displaying
|
||||
@racket[editor<%>] objects.}
|
||||
|
||||
]
|
||||
|
||||
|
@ -92,19 +92,19 @@ recorded in the canvas's offscreen buffer, however.
|
|||
|
||||
@index['("keyboard focus" "navigation")]{Gets} or sets whether
|
||||
tab-focus is enabled for the canvas (assuming that the canvas is
|
||||
not created with the @scheme['no-focus] style for @scheme[canvas%]). When tab-focus is
|
||||
not created with the @racket['no-focus] style for @racket[canvas%]). When tab-focus is
|
||||
enabled, the canvas can receive the keyboard focus when the user
|
||||
navigates among a frame or dialog's controls with the Tab and
|
||||
arrow keys. By default, tab-focus is disabled.
|
||||
|
||||
When tab-focus is enabled for a @scheme[canvas%] object, Tab, arrow,
|
||||
When tab-focus is enabled for a @racket[canvas%] object, Tab, arrow,
|
||||
Enter, and Escape keyboard events are consumed by a frame's default
|
||||
@method[top-level-window<%> on-traverse-char] method. (In addition, a
|
||||
dialog's default method consumes Escape key events.) Otherwise,
|
||||
@method[top-level-window<%> on-traverse-char] allows the keyboard
|
||||
events to be propagated to the canvas.
|
||||
|
||||
For an @scheme[editor-canvas%] object, handling of Tab, arrow, Enter,
|
||||
For an @racket[editor-canvas%] object, handling of Tab, arrow, Enter,
|
||||
and Escape keyboard events is determined by the
|
||||
@method[editor-canvas% allow-tab-exit] method.
|
||||
|
||||
|
@ -123,17 +123,17 @@ Returns the color currently used to ``erase'' the canvas content before
|
|||
@method[canvas<%> on-paint] is called. See also
|
||||
@method[canvas<%> set-canvas-background].
|
||||
|
||||
The result is @scheme[#f] if the canvas was created with the
|
||||
@indexed-scheme['transparent] style, otherwise it is always a
|
||||
@scheme[color%] object.
|
||||
The result is @racket[#f] if the canvas was created with the
|
||||
@indexed-racket['transparent] style, otherwise it is always a
|
||||
@racket[color%] object.
|
||||
|
||||
}
|
||||
|
||||
|
||||
@defmethod[(get-dc)
|
||||
(is-a?/c dc<%>)]{
|
||||
Gets the canvas's device context. See
|
||||
@scheme[dc<%>] for more information about drawing.
|
||||
Gets the canvas's device context. See @racket[dc<%>] for more information about
|
||||
drawing.
|
||||
|
||||
}
|
||||
|
||||
|
@ -267,7 +267,7 @@ Sets the color used to ``erase'' the canvas content before
|
|||
low level, so that it is used even when a complete refresh of the
|
||||
canvas is delayed by other activity.)
|
||||
|
||||
If the canvas was created with the @indexed-scheme['transparent] style,
|
||||
If the canvas was created with the @indexed-racket['transparent] style,
|
||||
@|MismatchExn|.
|
||||
|
||||
}
|
||||
|
@ -280,7 +280,7 @@ On Mac OS X, enables or disables space for a resize tab at the
|
|||
method has no effect on Windows or Unix, and it has no effect when
|
||||
both or no scrollbars are visible. The resize corner is disabled by
|
||||
default, but it can be enabled when a canvas is created with the
|
||||
@scheme['resize-corner] style.
|
||||
@racket['resize-corner] style.
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -30,17 +30,17 @@ Whenever a check box is clicked by the user, the check box's value is
|
|||
|
||||
Creates a check box with a string or bitmap label. @bitmaplabeluse[label]
|
||||
|
||||
@labelstripped[(scheme label) @elem{ (when @scheme[label] is a string)} @elem{effectively click the check box}]
|
||||
@labelstripped[(scheme label) @elem{ (when @racket[label] is a string)} @elem{effectively click the check box}]
|
||||
|
||||
The @scheme[callback] procedure is called (with the event type
|
||||
@indexed-scheme['check-box]) whenever the user clicks the check box.
|
||||
The @racket[callback] procedure is called (with the event type
|
||||
@indexed-racket['check-box]) whenever the user clicks the check box.
|
||||
|
||||
@DeletedStyleNote[@scheme[style] @scheme[parent]]{check box}
|
||||
@DeletedStyleNote[@racket[style] @racket[parent]]{check box}
|
||||
|
||||
If @scheme[value] is true, it is passed to
|
||||
If @racket[value] is true, it is passed to
|
||||
@method[check-box% set-value] so that the box is initially checked.
|
||||
|
||||
@FontKWs[@scheme[font]] @WindowKWs[@scheme[enabled]] @SubareaKWs[] @AreaKWs[]
|
||||
@FontKWs[@racket[font]] @WindowKWs[@racket[enabled]] @SubareaKWs[] @AreaKWs[]
|
||||
|
||||
|
||||
|
||||
|
@ -48,7 +48,7 @@ If @scheme[value] is true, it is passed to
|
|||
|
||||
@defmethod[(get-value)
|
||||
boolean?]{
|
||||
Gets the state of the check box: @scheme[#t] if it is checked, @scheme[#f]
|
||||
Gets the state of the check box: @racket[#t] if it is checked, @racket[#f]
|
||||
otherwise.
|
||||
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ Gets the state of the check box: @scheme[#t] if it is checked, @scheme[#f]
|
|||
(set-label [label (or/c label-string? (is-a?/c bitmap%))])
|
||||
void?]{
|
||||
|
||||
The same as @xmethod[window<%> set-label] when @scheme[label] is a
|
||||
The same as @xmethod[window<%> set-label] when @racket[label] is a
|
||||
string.
|
||||
|
||||
Otherwise, sets the bitmap label for a bitmap check box.
|
||||
|
@ -74,7 +74,7 @@ Sets the check box's state. (The control's callback procedure is
|
|||
@MonitorCallback[@elem{The check box's state} @elem{the user clicking the control} @elem{state}]
|
||||
|
||||
|
||||
If @scheme[state] is @scheme[#f], the box is
|
||||
If @racket[state] is @racket[#f], the box is
|
||||
unchecked, otherwise it is checked.
|
||||
|
||||
}}
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|
||||
@defclass/title[checkable-menu-item% object% (selectable-menu-item<%>)]{
|
||||
|
||||
A @scheme[checkable-menu-item%] is a string-labelled menu item that
|
||||
maintains a check mark. Its parent must be a @scheme[menu%] or
|
||||
@scheme[popup-menu%]. When the user selects the menu item, the
|
||||
A @racket[checkable-menu-item%] is a string-labelled menu item that
|
||||
maintains a check mark. Its parent must be a @racket[menu%] or
|
||||
@racket[popup-menu%]. When the user selects the menu item, the
|
||||
item's check mark is toggled and its callback procedure is called.
|
||||
|
||||
|
||||
|
@ -22,29 +22,29 @@ A @scheme[checkable-menu-item%] is a string-labelled menu item that
|
|||
'shift 'option))
|
||||
(get-default-shortcut-prefix)])]{
|
||||
|
||||
Creates a new menu item in @scheme[parent]. The item is initially
|
||||
Creates a new menu item in @racket[parent]. The item is initially
|
||||
shown, appended to the end of its parent, and unchecked. The
|
||||
@scheme[callback] procedure is called (with the event type
|
||||
@indexed-scheme['menu]) when the menu item is selected (either via a
|
||||
@racket[callback] procedure is called (with the event type
|
||||
@indexed-racket['menu]) when the menu item is selected (either via a
|
||||
menu bar, @xmethod[window<%> popup-menu], or @xmethod[editor-admin%
|
||||
popup-menu]).
|
||||
|
||||
See @method[labelled-menu-item<%> set-label] for information about
|
||||
mnemonic @litchar{&}s in @scheme[label].
|
||||
mnemonic @litchar{&}s in @racket[label].
|
||||
|
||||
If @scheme[shortcut] is not @scheme[#f], the item has a shortcut. See
|
||||
If @racket[shortcut] is not @racket[#f], the item has a shortcut. See
|
||||
@method[selectable-menu-item<%> get-shortcut] for more information.
|
||||
The @scheme[shortcut-prefix] argument determines the set of modifier
|
||||
The @racket[shortcut-prefix] argument determines the set of modifier
|
||||
keys for the shortcut; see @method[selectable-menu-item<%>
|
||||
get-shortcut-prefix].
|
||||
|
||||
If @scheme[help] is not @scheme[#f], the item has a help string. See
|
||||
If @racket[help] is not @racket[#f], the item has a help string. See
|
||||
@method[labelled-menu-item<%> get-help-string] for more information.
|
||||
|
||||
The @scheme[demand-callback] procedure is called by the default
|
||||
The @racket[demand-callback] procedure is called by the default
|
||||
@method[labelled-menu-item<%> on-demand] method with the object itself.
|
||||
|
||||
By default, the menu item is initially unchecked. If @scheme[checked]
|
||||
By default, the menu item is initially unchecked. If @racket[checked]
|
||||
is true, then @method[checkable-menu-item% check] is called so that
|
||||
the menu item is initially checked.
|
||||
|
||||
|
@ -62,7 +62,7 @@ Checks or unchecks the menu item.
|
|||
@defmethod[(is-checked?)
|
||||
boolean?]{
|
||||
|
||||
Returns @scheme[#t] if the item is checked, @scheme[#f] otherwise.
|
||||
Returns @racket[#t] if the item is checked, @racket[#f] otherwise.
|
||||
|
||||
}}
|
||||
|
||||
|
|
|
@ -12,8 +12,7 @@ Whenever the selection of a choice item is changed by the user, the
|
|||
provided as an initialization argument when each choice item is
|
||||
created.
|
||||
|
||||
See also
|
||||
@scheme[list-box%].
|
||||
See also @racket[list-box%].
|
||||
|
||||
|
||||
@defconstructor[([label (or/c label-string? false/c)]
|
||||
|
@ -35,29 +34,30 @@ See also
|
|||
[stretchable-width any/c #f]
|
||||
[stretchable-height any/c #f])]{
|
||||
|
||||
Creates a choice item. If @scheme[label] is a string, it is used as the
|
||||
label for the choice item.
|
||||
Creates a choice item. If @racket[label] is a string, it is used as the
|
||||
label for the choice item.
|
||||
|
||||
@labelstripped[(scheme label) @elem{} @elem{move the keyboard focus to the choice item}]
|
||||
|
||||
The @scheme[choices] list specifies the initial list of user-selectable
|
||||
The @racket[choices] list specifies the initial list of user-selectable
|
||||
items for the control. The initial set of choices determines the
|
||||
control's minimum graphical width (see @|geomdiscuss| for more
|
||||
information).
|
||||
|
||||
The @scheme[callback] procedure is called (with the event type
|
||||
@indexed-scheme['choice]) when the user selects a choice item (or
|
||||
The @racket[callback] procedure is called (with the event type
|
||||
@indexed-racket['choice]) when the user selects a choice item (or
|
||||
re-selects the currently selected item).
|
||||
|
||||
@HVLabelNote[@scheme[style]]{choice item} @DeletedStyleNote[@scheme[style] @scheme[parent]]{choice item}
|
||||
@HVLabelNote[@racket[style]]{choice item}
|
||||
@DeletedStyleNote[@racket[style] @racket[parent]]{choice item}
|
||||
|
||||
By default, the first choice (if any) is initially selected. If
|
||||
@scheme[selection] is positive, it is passed to
|
||||
@method[list-control<%> set-selection] to set the initial choice selection. Although @scheme[selection] normally
|
||||
must be less than the length of @scheme[choices], it can be @scheme[0]
|
||||
when @scheme[choices] is empty.
|
||||
@racket[selection] is positive, it is passed to
|
||||
@method[list-control<%> set-selection] to set the initial choice selection. Although @racket[selection] normally
|
||||
must be less than the length of @racket[choices], it can be @racket[0]
|
||||
when @racket[choices] is empty.
|
||||
|
||||
@FontKWs[@scheme[font]] @WindowKWs[@scheme[enabled]] @SubareaKWs[] @AreaKWs[]
|
||||
@FontKWs[@racket[font]] @WindowKWs[@racket[enabled]] @SubareaKWs[] @AreaKWs[]
|
||||
|
||||
}}
|
||||
|
||||
|
|
|
@ -3,11 +3,11 @@
|
|||
|
||||
@defclass/title[clipboard-client% object% ()]{
|
||||
|
||||
A @scheme[clipboard-client%] object allows a program to take over
|
||||
A @racket[clipboard-client%] object allows a program to take over
|
||||
the clipboard and service requests for clipboard data. See
|
||||
@scheme[clipboard<%>] for more information.
|
||||
@racket[clipboard<%>] for more information.
|
||||
|
||||
A @scheme[clipboard-client%] object is associated to an eventspace
|
||||
A @racket[clipboard-client%] object is associated to an eventspace
|
||||
when it becomes the current client; see
|
||||
@method[clipboard<%> set-clipboard-client] for more information.
|
||||
|
||||
|
@ -24,9 +24,9 @@ Creates a clipboard client that supports no data formats.
|
|||
Adds a new data format name to the list supported by the clipboard
|
||||
client.
|
||||
|
||||
The @scheme[format] string is typically four capital letters. (On
|
||||
Mac OS X, only four characters for @scheme[format] are ever used.)
|
||||
For example, @scheme["TEXT"] is the name of the UTF-8-encoded string
|
||||
The @racket[format] string is typically four capital letters. (On
|
||||
Mac OS X, only four characters for @racket[format] are ever used.)
|
||||
For example, @racket["TEXT"] is the name of the UTF-8-encoded string
|
||||
format. New format names can be used to communicate application- and
|
||||
platform-specific data formats.
|
||||
|
||||
|
@ -38,7 +38,7 @@ The @scheme[format] string is typically four capital letters. (On
|
|||
Called when a process requests clipboard data while this client is the
|
||||
current one for the clipboard. The requested format is passed to the
|
||||
method, and the result should be a byte string matching the requested
|
||||
format, or @scheme[#f] if the request cannot be fulfilled.
|
||||
format, or @racket[#f] if the request cannot be fulfilled.
|
||||
|
||||
Only data format names in the client's list will be passed to this
|
||||
method; see @method[clipboard-client% add-type].
|
||||
|
|
|
@ -3,23 +3,23 @@
|
|||
|
||||
@definterface/title[clipboard<%> ()]{
|
||||
|
||||
A single @scheme[clipboard<%>] object, @indexed-scheme[the-clipboard],
|
||||
A single @racket[clipboard<%>] object, @indexed-racket[the-clipboard],
|
||||
manages the content of the system-wide clipboard for cut and paste.
|
||||
|
||||
On Unix, a second @scheme[clipboard<%>] object,
|
||||
@indexed-scheme[the-x-selection-clipboard], manages the content of the
|
||||
On Unix, a second @racket[clipboard<%>] object,
|
||||
@indexed-racket[the-x-selection-clipboard], manages the content of the
|
||||
system-wide X11 selection. If the @ResourceFirst{selectionAsClipboard}
|
||||
preference (see @|mrprefsdiscuss|) is set to a non-zero true value,
|
||||
however, then @scheme[the-clipboard] is always the same as
|
||||
@scheme[the-x-selection-clipboard], and the system-wide X11 clipboard
|
||||
however, then @racket[the-clipboard] is always the same as
|
||||
@racket[the-x-selection-clipboard], and the system-wide X11 clipboard
|
||||
is not used.
|
||||
|
||||
On Windows and Mac OS X, @scheme[the-x-selection-clipboard] is
|
||||
always the same as @scheme[the-clipboard].
|
||||
On Windows and Mac OS X, @racket[the-x-selection-clipboard] is
|
||||
always the same as @racket[the-clipboard].
|
||||
|
||||
Data can be entered into a clipboard in one of two ways: by setting
|
||||
the current clipboard string or byte string, or by installing a
|
||||
@scheme[clipboard-client%] object. When a client is installed,
|
||||
@racket[clipboard-client%] object. When a client is installed,
|
||||
requests for clipboard data are directed to the client.
|
||||
|
||||
Generic data is always retrieved from the clipboard as a byte
|
||||
|
@ -32,13 +32,13 @@ Generic data is always retrieved from the clipboard as a byte
|
|||
(or/c (is-a?/c bitmap%) false/c)]{
|
||||
|
||||
Gets the current clipboard contents as a bitmap (Windows, Mac OS X),
|
||||
returning @scheme[#f] if the clipboard does not contain a bitmap.
|
||||
returning @racket[#f] if the clipboard does not contain a bitmap.
|
||||
|
||||
See
|
||||
@method[clipboard<%> get-clipboard-data] for information on eventspaces and the current clipboard client.
|
||||
|
||||
See @|timediscuss| for a discussion of the @scheme[time] argument. If
|
||||
@scheme[time] is outside the platform-specific range of times,
|
||||
See @|timediscuss| for a discussion of the @racket[time] argument. If
|
||||
@racket[time] is outside the platform-specific range of times,
|
||||
@|MismatchExn|.
|
||||
|
||||
}
|
||||
|
@ -48,19 +48,19 @@ See @|timediscuss| for a discussion of the @scheme[time] argument. If
|
|||
(or/c bytes? string? false/c)]{
|
||||
|
||||
Gets the current clipboard contents in a specific format, returning
|
||||
@scheme[#f] if the clipboard does not contain data in the requested
|
||||
@racket[#f] if the clipboard does not contain data in the requested
|
||||
format.
|
||||
|
||||
If the clipboard client is associated to an eventspace that is not the
|
||||
current one, the data is retrieved through a callback event in the
|
||||
client's eventspace. If no result is available within one second, the
|
||||
request is abandoned and @scheme[#f] is returned.
|
||||
request is abandoned and @racket[#f] is returned.
|
||||
|
||||
See @xmethod[clipboard-client% add-type] for information on
|
||||
@scheme[format].
|
||||
@racket[format].
|
||||
|
||||
See @|timediscuss| for a discussion of the @scheme[time] argument. If
|
||||
@scheme[time] is outside the platform-specific range of times,
|
||||
See @|timediscuss| for a discussion of the @racket[time] argument. If
|
||||
@racket[time] is outside the platform-specific range of times,
|
||||
@|MismatchExn|.
|
||||
|
||||
}
|
||||
|
@ -69,13 +69,13 @@ See @|timediscuss| for a discussion of the @scheme[time] argument. If
|
|||
(or/c string false/c)]{
|
||||
|
||||
Gets the current clipboard contents as simple text, returning
|
||||
@scheme[#f] if the clipboard does not contain any text.
|
||||
@racket[#f] if the clipboard does not contain any text.
|
||||
|
||||
See @method[clipboard<%> get-clipboard-data] for information on
|
||||
eventspaces and the current clipboard client.
|
||||
|
||||
See @|timediscuss| for a discussion of the @scheme[time] argument. If
|
||||
@scheme[time] is outside the platform-specific range of times,
|
||||
See @|timediscuss| for a discussion of the @racket[time] argument. If
|
||||
@racket[time] is outside the platform-specific range of times,
|
||||
@|MismatchExn|.
|
||||
|
||||
}
|
||||
|
@ -84,19 +84,19 @@ See @|timediscuss| for a discussion of the @scheme[time] argument. If
|
|||
@defmethod[(same-clipboard-client? [owner (is-a?/c clipboard-client%)])
|
||||
boolean?]{
|
||||
|
||||
Returns @scheme[#t] if @scheme[owner] currently owns the clipboard,
|
||||
@scheme[#f] otherwise.}
|
||||
Returns @racket[#t] if @racket[owner] currently owns the clipboard,
|
||||
@racket[#f] otherwise.}
|
||||
|
||||
|
||||
@defmethod[(set-clipboard-bitmap [new-bitmap (is-a?/c bitmap%)]
|
||||
[time exact-integer?])
|
||||
void?]{
|
||||
|
||||
Changes the current clipboard contents to @scheme[new-bitmap] (Windows, Mac OS X)
|
||||
Changes the current clipboard contents to @racket[new-bitmap] (Windows, Mac OS X)
|
||||
and releases the current clipboard client (if any).
|
||||
|
||||
See @|timediscuss| for
|
||||
a discussion of the @scheme[time] argument. If @scheme[time] is outside
|
||||
a discussion of the @racket[time] argument. If @racket[time] is outside
|
||||
the platform-specific range of times, @|MismatchExn|.
|
||||
|
||||
}
|
||||
|
@ -106,13 +106,13 @@ See @|timediscuss| for
|
|||
void?]{
|
||||
|
||||
Changes the clipboard-owning client: sets the client to
|
||||
@scheme[new-owner] and associates @scheme[new-owner] with the current
|
||||
eventspace (as determined by @scheme[current-eventspace]). The
|
||||
@racket[new-owner] and associates @racket[new-owner] with the current
|
||||
eventspace (as determined by @racket[current-eventspace]). The
|
||||
eventspace association is removed when the client is no longer the
|
||||
current one.
|
||||
|
||||
See @|timediscuss| for a discussion of the @scheme[time] argument. If
|
||||
@scheme[time] is outside the platform-specific range of times,
|
||||
See @|timediscuss| for a discussion of the @racket[time] argument. If
|
||||
@racket[time] is outside the platform-specific range of times,
|
||||
@|MismatchExn|.
|
||||
|
||||
}
|
||||
|
@ -121,11 +121,11 @@ See @|timediscuss| for a discussion of the @scheme[time] argument. If
|
|||
[time exact-integer?])
|
||||
void?]{
|
||||
|
||||
Changes the current clipboard contents to @scheme[new-text],
|
||||
Changes the current clipboard contents to @racket[new-text],
|
||||
and releases the current clipboard client (if any).
|
||||
|
||||
See @|timediscuss| for
|
||||
a discussion of the @scheme[time] argument. If @scheme[time] is outside
|
||||
a discussion of the @racket[time] argument. If @racket[time] is outside
|
||||
the platform-specific range of times, @|MismatchExn|.
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
@defclass/title[column-control-event% control-event% ()]{
|
||||
|
||||
A @scheme[column-control-event%] object contains information about a
|
||||
A @racket[column-control-event%] object contains information about a
|
||||
event on an @racket[list-box%] column header.
|
||||
|
||||
@defconstructor[([column exact-nonnegative-integer?]
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
@defclass/title[combo-field% text-field% ()]{
|
||||
|
||||
A @scheme[combo-field%] object is a @scheme[text-field%]
|
||||
object that also resembles a @scheme[choice%] object, because it
|
||||
A @racket[combo-field%] object is a @racket[text-field%]
|
||||
object that also resembles a @racket[choice%] object, because it
|
||||
has a small popup button to the right of the text field. Clicking
|
||||
the button pops up a menu, and selecting a menu item typically copies
|
||||
the item into the text field.
|
||||
|
@ -31,32 +31,32 @@ A @scheme[combo-field%] object is a @scheme[text-field%]
|
|||
[stretchable-width any/c #t]
|
||||
[stretchable-height any/c #f])]{
|
||||
|
||||
If @scheme[label] is not @scheme[#f], it is used as the combo label.
|
||||
If @racket[label] is not @racket[#f], it is used as the combo label.
|
||||
Otherwise, the combo does not display its label.
|
||||
|
||||
@labelstripped[(scheme label) @elem{} @elem{move the keyboard focus to the combo}]
|
||||
|
||||
The @scheme[choices] list specifies the initial list of items for the
|
||||
The @racket[choices] list specifies the initial list of items for the
|
||||
combo's popup menu. The
|
||||
@method[combo-field% append] method adds a new item to the menu with a callback to install the
|
||||
appended item into the combo's text field. The
|
||||
@method[combo-field% get-menu] method returns a menu that can be changed to
|
||||
adjust the content and actions of the combo's menu.
|
||||
|
||||
The @scheme[callback] procedure is called when the user changes the text
|
||||
The @racket[callback] procedure is called when the user changes the text
|
||||
in the combo or presses the Enter key (and Enter is not handled by
|
||||
the combo's frame or dialog; see
|
||||
@xmethod[top-level-window<%> on-traverse-char] ). If the user presses Enter, the type of event passed to the callback
|
||||
is @indexed-scheme['text-field-enter], otherwise it is
|
||||
@indexed-scheme['text-field].
|
||||
is @indexed-racket['text-field-enter], otherwise it is
|
||||
@indexed-racket['text-field].
|
||||
|
||||
If @scheme[init-value] is not @scheme[""], the minimum width of the text item
|
||||
is made wide enough to show @scheme[init-value]. Otherwise, a built-in
|
||||
If @racket[init-value] is not @racket[""], the minimum width of the text item
|
||||
is made wide enough to show @racket[init-value]. Otherwise, a built-in
|
||||
default width is selected.
|
||||
|
||||
@HVLabelNote[@scheme[style]]{combo} @DeletedStyleNote[@scheme[style] @scheme[parent]]{combo}.
|
||||
@HVLabelNote[@racket[style]]{combo} @DeletedStyleNote[@racket[style] @racket[parent]]{combo}.
|
||||
|
||||
@FontKWs[@scheme[font]] @WindowKWs[@scheme[enabled]] @SubareaKWs[] @AreaKWs[]
|
||||
@FontKWs[@racket[font]] @WindowKWs[@racket[enabled]] @SubareaKWs[] @AreaKWs[]
|
||||
|
||||
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ Adds a new item to the combo's popup menu. The given label is used for
|
|||
|
||||
@defmethod[(get-menu)
|
||||
(is-a?/c popup-menu%)]{
|
||||
Returns a @scheme[popup-menu%] that is effectively copied into the
|
||||
Returns a @racket[popup-menu%] that is effectively copied into the
|
||||
combo's popup menu when the combo is clicked. Only the labels can
|
||||
callbacks of the menu's items are used; the enable state, submenus,
|
||||
or separators are ignored.
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
@defclass/title[control-event% event% ()]{
|
||||
|
||||
A @scheme[control-event%] object contains information about a
|
||||
control event. An instance of @scheme[control-event%] is always
|
||||
A @racket[control-event%] object contains information about a
|
||||
control event. An instance of @racket[control-event%] is always
|
||||
provided to a control or menu item callback procedure.
|
||||
|
||||
@defconstructor[([event-type (one-of/c 'button 'check-box 'choice
|
||||
|
@ -14,31 +14,31 @@ A @scheme[control-event%] object contains information about a
|
|||
'menu-popdown 'menu-popdown-none)]
|
||||
[time-stamp exact-integer? 0])]{
|
||||
|
||||
The @scheme[event-type] argument is one of the following:
|
||||
The @racket[event-type] argument is one of the following:
|
||||
@itemize[
|
||||
@item{@scheme['button] --- for @scheme[button%] clicks}
|
||||
@item{@scheme['check-box] --- for @scheme[check-box%] toggles}
|
||||
@item{@scheme['choice] --- for @scheme[choice%] item selections}
|
||||
@item{@scheme['list-box] --- for @scheme[list-box%] selections and deselections}
|
||||
@item{@scheme['list-box-dclick] --- for @scheme[list-box%] double-clicks}
|
||||
@item{@scheme['list-box-column] --- for @scheme[list-box%] column clicks in
|
||||
@item{@racket['button] --- for @racket[button%] clicks}
|
||||
@item{@racket['check-box] --- for @racket[check-box%] toggles}
|
||||
@item{@racket['choice] --- for @racket[choice%] item selections}
|
||||
@item{@racket['list-box] --- for @racket[list-box%] selections and deselections}
|
||||
@item{@racket['list-box-dclick] --- for @racket[list-box%] double-clicks}
|
||||
@item{@racket['list-box-column] --- for @racket[list-box%] column clicks in
|
||||
a @racket[column-control-event%] instance}
|
||||
@item{@scheme['text-field] --- for @scheme[text-field%] changes}
|
||||
@item{@scheme['text-field-enter] --- for single-line @scheme[text-field%] Enter event}
|
||||
@item{@scheme['menu] --- for @scheme[selectable-menu-item<%>] callbacks}
|
||||
@item{@scheme['slider] --- for @scheme[slider%] changes}
|
||||
@item{@scheme['radio-box] --- for @scheme[radio-box%] selection changes}
|
||||
@item{@scheme['tab-panel] --- for @scheme[tab-panel%] tab changes}
|
||||
@item{@scheme['menu-popdown] --- for @scheme[popup-menu%] callbacks (item selected)}
|
||||
@item{@scheme['menu-popdown-none] --- for @scheme[popup-menu%] callbacks (no item selected)}
|
||||
@item{@racket['text-field] --- for @racket[text-field%] changes}
|
||||
@item{@racket['text-field-enter] --- for single-line @racket[text-field%] Enter event}
|
||||
@item{@racket['menu] --- for @racket[selectable-menu-item<%>] callbacks}
|
||||
@item{@racket['slider] --- for @racket[slider%] changes}
|
||||
@item{@racket['radio-box] --- for @racket[radio-box%] selection changes}
|
||||
@item{@racket['tab-panel] --- for @racket[tab-panel%] tab changes}
|
||||
@item{@racket['menu-popdown] --- for @racket[popup-menu%] callbacks (item selected)}
|
||||
@item{@racket['menu-popdown-none] --- for @racket[popup-menu%] callbacks (no item selected)}
|
||||
]
|
||||
|
||||
This value is extracted out of a @scheme[control-event%] object with
|
||||
This value is extracted out of a @racket[control-event%] object with
|
||||
the
|
||||
@method[control-event% get-event-type] method.
|
||||
|
||||
See @method[event% get-time-stamp] for information about
|
||||
@scheme[time-stamp].
|
||||
@racket[time-stamp].
|
||||
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,7 @@ See @method[event% get-time-stamp] for information about
|
|||
'text-field-enter 'menu 'slider 'radio-box
|
||||
'menu-popdown 'menu-popdown-none 'tab-panel)]{
|
||||
Returns the type of the control event. See
|
||||
@scheme[control-event%] for information about each event type symbol.
|
||||
@racket[control-event%] for information about each event type symbol.
|
||||
|
||||
}
|
||||
|
||||
|
@ -60,6 +60,6 @@ Returns the type of the control event. See
|
|||
void?]{
|
||||
|
||||
Sets the type of the event. See
|
||||
@scheme[control-event%] for information about each event type symbol.
|
||||
@racket[control-event%] for information about each event type symbol.
|
||||
|
||||
}}
|
||||
|
|
|
@ -3,18 +3,18 @@
|
|||
|
||||
@definterface/title[control<%> (subwindow<%>)]{
|
||||
|
||||
The @scheme[control<%>] interface is implemented by the built-in
|
||||
The @racket[control<%>] interface is implemented by the built-in
|
||||
control window classes:
|
||||
@itemize[
|
||||
@item{@scheme[message%]}
|
||||
@item{@scheme[button%]}
|
||||
@item{@scheme[check-box%]}
|
||||
@item{@scheme[slider%]}
|
||||
@item{@scheme[gauge%]}
|
||||
@item{@scheme[text-field%]}
|
||||
@item{@scheme[radio-box%]}
|
||||
@item{@scheme[choice%]}
|
||||
@item{@scheme[list-box%]}
|
||||
@item{@racket[message%]}
|
||||
@item{@racket[button%]}
|
||||
@item{@racket[check-box%]}
|
||||
@item{@racket[slider%]}
|
||||
@item{@racket[gauge%]}
|
||||
@item{@racket[text-field%]}
|
||||
@item{@racket[radio-box%]}
|
||||
@item{@racket[choice%]}
|
||||
@item{@racket[list-box%]}
|
||||
]
|
||||
|
||||
|
||||
|
@ -23,7 +23,7 @@ The @scheme[control<%>] interface is implemented by the built-in
|
|||
void?]{
|
||||
|
||||
Calls the control's callback function, passing on the given
|
||||
@scheme[control-event%] object.
|
||||
@racket[control-event%] object.
|
||||
|
||||
}}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ A cursor is assigned to each window (or the window may use its
|
|||
|
||||
The first case creates a cursor using an image bitmap and a mask
|
||||
bitmap. Both bitmaps must have depth 1 and size 16 by 16
|
||||
pixels. The @scheme[hot-spot-x] and @scheme[hot-spot-y] arguments
|
||||
pixels. The @racket[hot-spot-x] and @racket[hot-spot-y] arguments
|
||||
determine the focus point of the cursor within the cursor image,
|
||||
relative to its top-left corner.
|
||||
|
||||
|
@ -32,38 +32,38 @@ as one of the following:
|
|||
|
||||
@itemize[
|
||||
|
||||
@item{@scheme['arrow] --- the default cursor}
|
||||
@item{@racket['arrow] --- the default cursor}
|
||||
|
||||
@item{@scheme['bullseye] --- concentric circles}
|
||||
@item{@racket['bullseye] --- concentric circles}
|
||||
|
||||
@item{@scheme['cross] --- a crosshair}
|
||||
@item{@racket['cross] --- a crosshair}
|
||||
|
||||
@item{@scheme['hand] --- an open hand}
|
||||
@item{@racket['hand] --- an open hand}
|
||||
|
||||
@item{@scheme['ibeam] --- a vertical line, indicating that clicks
|
||||
@item{@racket['ibeam] --- a vertical line, indicating that clicks
|
||||
control a text-selection caret}
|
||||
|
||||
@item{@scheme['watch] --- a watch or hourglass, indicating that
|
||||
@item{@racket['watch] --- a watch or hourglass, indicating that
|
||||
the user must wait for a computation to complete}
|
||||
|
||||
@item{@scheme['arrow+watch] --- the default cursor with a watch or
|
||||
@item{@racket['arrow+watch] --- the default cursor with a watch or
|
||||
hourglass, indicating that some computation is in progress, but the
|
||||
cursor can still be used}
|
||||
|
||||
@item{@scheme['blank] --- invisible}
|
||||
@item{@racket['blank] --- invisible}
|
||||
|
||||
@item{@scheme['size-e/w] --- arrows left and right}
|
||||
@item{@racket['size-e/w] --- arrows left and right}
|
||||
|
||||
@item{@scheme['size-n/s] --- arrows up and down}
|
||||
@item{@racket['size-n/s] --- arrows up and down}
|
||||
|
||||
@item{@scheme['size-ne/sw] --- arrows up-right and down-left}
|
||||
@item{@racket['size-ne/sw] --- arrows up-right and down-left}
|
||||
|
||||
@item{@scheme['size-nw/se] --- arrows up-left and down-right}
|
||||
@item{@racket['size-nw/se] --- arrows up-left and down-right}
|
||||
|
||||
]
|
||||
|
||||
If the cursor is created successfully, @method[cursor% ok?]
|
||||
returns @scheme[#t], otherwise the cursor object cannot be
|
||||
returns @racket[#t], otherwise the cursor object cannot be
|
||||
assigned to a window.
|
||||
|
||||
}
|
||||
|
@ -71,8 +71,8 @@ assigned to a window.
|
|||
@defmethod[(ok?)
|
||||
boolean?]{
|
||||
|
||||
Returns @scheme[#t] if the cursor is can be assigned to a window,
|
||||
@scheme[#f] otherwise.
|
||||
Returns @racket[#t] if the cursor is can be assigned to a window,
|
||||
@racket[#f] otherwise.
|
||||
|
||||
}}
|
||||
|
||||
|
|
|
@ -27,47 +27,47 @@ A dialog is a top-level window that is @defterm{modal}: while the
|
|||
[stretchable-width any/c #t]
|
||||
[stretchable-height any/c #t])]{
|
||||
|
||||
The @scheme[label] string is used as the dialog's title in its
|
||||
The @racket[label] string is used as the dialog's title in its
|
||||
title bar. If the dialog's label is changed (see
|
||||
@method[window<%> set-label]), the title bar is updated.
|
||||
|
||||
The @scheme[parent] argument can be @scheme[#f] or an existing
|
||||
frame. On Windows, if @scheme[parent] is an existing frame, the
|
||||
The @racket[parent] argument can be @racket[#f] or an existing
|
||||
frame. On Windows, if @racket[parent] is an existing frame, the
|
||||
new dialog is always on top of its parent. On Windows and Unix, a
|
||||
dialog is iconized when its parent is iconized.
|
||||
|
||||
If @scheme[parent] is @scheme[#f], then the eventspace for the new
|
||||
If @racket[parent] is @racket[#f], then the eventspace for the new
|
||||
dialog is the current eventspace, as determined by
|
||||
@scheme[current-eventspace]. Otherwise, @scheme[parent]'s eventspace
|
||||
@racket[current-eventspace]. Otherwise, @racket[parent]'s eventspace
|
||||
is the new dialog's eventspace.
|
||||
|
||||
If the @scheme[width] or @scheme[height] argument is not @scheme[#f],
|
||||
If the @racket[width] or @racket[height] argument is not @racket[#f],
|
||||
it specifies an initial size for the dialog (in pixels) assuming that
|
||||
it is larger than the minimum size, otherwise the minimum size is
|
||||
used. On Windows and Mac OS X (and with some Unix window managers)
|
||||
dialogs are not resizeable.
|
||||
|
||||
If the @scheme[x] or @scheme[y] argument is not @scheme[#f], it
|
||||
If the @racket[x] or @racket[y] argument is not @racket[#f], it
|
||||
specifies an initial location for the dialog. Otherwise, if no
|
||||
location is set before the dialog is shown, it is centered (with
|
||||
respect @scheme[parent] if not @scheme[#f], the screen otherwise).
|
||||
respect @racket[parent] if not @racket[#f], the screen otherwise).
|
||||
|
||||
The @scheme[style] flags adjust the appearance of the dialog on some
|
||||
The @racket[style] flags adjust the appearance of the dialog on some
|
||||
platforms:
|
||||
|
||||
@itemize[
|
||||
|
||||
@item{@scheme['no-caption] --- omits the title bar for the dialog
|
||||
@item{@racket['no-caption] --- omits the title bar for the dialog
|
||||
(Windows)}
|
||||
|
||||
@item{@scheme['resize-border] --- adds a resizeable border
|
||||
@item{@racket['resize-border] --- adds a resizeable border
|
||||
around the window (Windows) or grow box in the bottom right corner
|
||||
(Mac OS X)}
|
||||
|
||||
@item{@scheme['no-sheet] --- uses a movable window for the dialog,
|
||||
@item{@racket['no-sheet] --- uses a movable window for the dialog,
|
||||
even if a parent window is provided (Mac OS X)}
|
||||
|
||||
@item{@scheme['close-button] --- include a close button in the
|
||||
@item{@racket['close-button] --- include a close button in the
|
||||
dialog's title bar, which would not normally be included (Mac OS X)}
|
||||
|
||||
]
|
||||
|
@ -77,7 +77,7 @@ Even if the dialog is not shown, a few notification events may be
|
|||
resources (e.g., memory) cannot be reclaimed until some events are
|
||||
handled, or the dialog's eventspace is shut down.
|
||||
|
||||
@WindowKWs[@scheme[enabled]] @AreaContKWs[] @AreaKWs[]
|
||||
@WindowKWs[@racket[enabled]] @AreaContKWs[] @AreaKWs[]
|
||||
}
|
||||
|
||||
@defmethod[#:mode override
|
||||
|
@ -87,7 +87,7 @@ Even if the dialog is not shown, a few notification events may be
|
|||
|
||||
Returns the result of
|
||||
|
||||
@schemeblock[
|
||||
@racketblock[
|
||||
(or (send this #,(:: top-level-window<%> on-system-menu-char) event)
|
||||
(send this #,(:: top-level-window<%> on-traverse-char) event))
|
||||
]
|
||||
|
@ -98,16 +98,16 @@ Returns the result of
|
|||
(show [show? any/c])
|
||||
void?]{
|
||||
|
||||
If @scheme[show?] is true, the dialog is shown and all frames (and other
|
||||
If @racket[show?] is true, the dialog is shown and all frames (and other
|
||||
dialogs) in the eventspace become disabled until the dialog is
|
||||
closed. If @scheme[show?] is false, the dialog is hidden and other
|
||||
closed. If @racket[show?] is false, the dialog is hidden and other
|
||||
frames and dialogs are re-enabled (unless a different, pre-existing
|
||||
dialog is still shown).
|
||||
|
||||
If @scheme[show?] is true, the method does not immediately return. Instead,
|
||||
it loops with @scheme[yield] until the dialog is found to be hidden
|
||||
between calls to @scheme[yield]. An internal semaphore is used with
|
||||
@scheme[yield] to avoid a busy-wait, and to ensure that the @scheme[show]
|
||||
If @racket[show?] is true, the method does not immediately return. Instead,
|
||||
it loops with @racket[yield] until the dialog is found to be hidden
|
||||
between calls to @racket[yield]. An internal semaphore is used with
|
||||
@racket[yield] to avoid a busy-wait, and to ensure that the @racket[show]
|
||||
method returns as soon as possible after the dialog is hidden.
|
||||
|
||||
}
|
||||
|
|
|
@ -19,42 +19,42 @@ These functions get input from the user and/or display
|
|||
(or/c path? #f)]{
|
||||
|
||||
Obtains a file pathname from the user via the platform-specific
|
||||
standard (modal) dialog, using @scheme[parent] as the parent window if
|
||||
it is specified, and using @scheme[message] as a message at the top of
|
||||
the dialog if it is not @scheme[#f].
|
||||
standard (modal) dialog, using @racket[parent] as the parent window if
|
||||
it is specified, and using @racket[message] as a message at the top of
|
||||
the dialog if it is not @racket[#f].
|
||||
|
||||
The result is @scheme[#f] if the user cancels the dialog, the selected
|
||||
The result is @racket[#f] if the user cancels the dialog, the selected
|
||||
pathname otherwise. The returned pathname may or may not exist,
|
||||
although the style of the dialog is directed towards selecting
|
||||
existing files.
|
||||
|
||||
If @scheme[directory] is not @scheme[#f], it is used as the starting
|
||||
If @racket[directory] is not @racket[#f], it is used as the starting
|
||||
directory for the file selector (otherwise the starting directory is
|
||||
chosen automatically in a platform-specific manner, usually based on
|
||||
the current directory and the user's interactions in previous calls
|
||||
to @scheme[get-file], @scheme[put-file], etc.). If
|
||||
@scheme[filename] is not @scheme[#f], it is used as the default filename
|
||||
to @racket[get-file], @racket[put-file], etc.). If
|
||||
@racket[filename] is not @racket[#f], it is used as the default filename
|
||||
when appropriate, and it should @italic{not} contain a directory path
|
||||
prefix.
|
||||
|
||||
Under Windows, if @scheme[extension] is not @scheme[#f], the returned path
|
||||
Under Windows, if @racket[extension] is not @racket[#f], the returned path
|
||||
will use the extension if the user does not supply one; the
|
||||
@scheme[extension] string should not contain a period. The extension is
|
||||
@racket[extension] string should not contain a period. The extension is
|
||||
ignored on other platforms.
|
||||
|
||||
The @scheme[style] list can contain @scheme['common], a
|
||||
The @racket[style] list can contain @racket['common], a
|
||||
platform-independent version of the dialog is used instead of a
|
||||
native dialog. On Mac OS X, if the @scheme[style] list
|
||||
contains @scheme['packages], a user is allowed to select a package
|
||||
native dialog. On Mac OS X, if the @racket[style] list
|
||||
contains @racket['packages], a user is allowed to select a package
|
||||
directory, which is a directory with a special suffix (e.g.,
|
||||
``.app'') that the Finder normally displays like a file. If the list
|
||||
contains @scheme['enter-packages], a user is allowed to select a file
|
||||
contains @racket['enter-packages], a user is allowed to select a file
|
||||
within a package directory. If the list contains both
|
||||
@scheme['packages] and @scheme['enter-packages], the former is ignored.
|
||||
@racket['packages] and @racket['enter-packages], the former is ignored.
|
||||
|
||||
On Windows and Unix, @scheme[filters] determines a set of filters from
|
||||
On Windows and Unix, @racket[filters] determines a set of filters from
|
||||
which the user can choose in the dialog. Each element of the
|
||||
@scheme[filters] list contains two strings: a description of the filter
|
||||
@racket[filters] list contains two strings: a description of the filter
|
||||
as seen by the user, and a filter pattern matched against file names.
|
||||
Pattern strings can be a simple ``glob'' pattern, or a number of glob
|
||||
patterns separated by a @litchar[";"] character.
|
||||
|
@ -65,7 +65,7 @@ On Windows and Unix, @scheme[filters] determines a set of filters from
|
|||
that have any of these suffixes in any filter are selectable; a
|
||||
@racket["*.*"] glob makes all files available for selection.
|
||||
|
||||
See also @scheme[path-dialog%].
|
||||
See also @racket[path-dialog%].
|
||||
|
||||
|
||||
}
|
||||
|
@ -79,8 +79,8 @@ See also @scheme[path-dialog%].
|
|||
[filters (listof (list/c string? string?)) '(("Any" "*.*"))])
|
||||
(or/c (listof path?) #f)]{
|
||||
Like
|
||||
@scheme[get-file], except that the user can select multiple files, and the
|
||||
result is either a list of file paths of @scheme[#f].
|
||||
@racket[get-file], except that the user can select multiple files, and the
|
||||
result is either a list of file paths of @racket[#f].
|
||||
|
||||
}
|
||||
|
||||
|
@ -94,62 +94,62 @@ Like
|
|||
(or/c path? #f)]{
|
||||
|
||||
Obtains a file pathname from the user via the platform-specific
|
||||
standard (modal) dialog, using @scheme[parent] as the parent window if
|
||||
it is specified, and using @scheme[message] as a message at the top of
|
||||
the dialog if it is not @scheme[#f].
|
||||
standard (modal) dialog, using @racket[parent] as the parent window if
|
||||
it is specified, and using @racket[message] as a message at the top of
|
||||
the dialog if it is not @racket[#f].
|
||||
|
||||
The result is @scheme[#f] if the user cancels the dialog, the selected
|
||||
The result is @racket[#f] if the user cancels the dialog, the selected
|
||||
pathname otherwise. The returned pathname may or may not exist,
|
||||
although the style of the dialog is directed towards creating a new
|
||||
file.
|
||||
|
||||
If @scheme[directory] is not @scheme[#f], it is used as the starting
|
||||
If @racket[directory] is not @racket[#f], it is used as the starting
|
||||
directory for the file selector (otherwise the starting directory is
|
||||
chosen automatically in a platform-specific manner, usually based on
|
||||
the current directory and the user's interactions in previous calls
|
||||
to @scheme[get-file], @scheme[put-file], etc.). If
|
||||
@scheme[filename] is not @scheme[#f], it is used as the default filename
|
||||
to @racket[get-file], @racket[put-file], etc.). If
|
||||
@racket[filename] is not @racket[#f], it is used as the default filename
|
||||
when appropriate, and it should @italic{not} contain a directory path
|
||||
prefix.
|
||||
|
||||
On Windows, if @scheme[extension] is not @scheme[#f], the returned path
|
||||
On Windows, if @racket[extension] is not @racket[#f], the returned path
|
||||
will get a default extension if the user does not supply one. If
|
||||
@scheme[extension] is the empty string, then the extension is derived
|
||||
from the user's @scheme[filters] choice if the corresponding pattern is
|
||||
of the form @scheme[(string-append "*." extension)]; if the pattern is
|
||||
@scheme["*.*"], then no default extension is added. Finally, if
|
||||
@scheme[extension] is any string other than the empty string,
|
||||
@scheme[extension] is used as the default extension when the user's
|
||||
@scheme[filters] choice has the pattern @scheme["*.*"]. Meanwhile, the
|
||||
@scheme[filters] argument has the same format and auxiliary role as for
|
||||
@scheme[get-file]. In particular, if the only pattern in @scheme[filters]
|
||||
is @scheme[(string-append "*." extension)], then the result pathname is guaranteed
|
||||
to have an extension mapping @scheme[extension].
|
||||
@racket[extension] is the empty string, then the extension is derived
|
||||
from the user's @racket[filters] choice if the corresponding pattern is
|
||||
of the form @racket[(string-append "*." extension)]; if the pattern is
|
||||
@racket["*.*"], then no default extension is added. Finally, if
|
||||
@racket[extension] is any string other than the empty string,
|
||||
@racket[extension] is used as the default extension when the user's
|
||||
@racket[filters] choice has the pattern @racket["*.*"]. Meanwhile, the
|
||||
@racket[filters] argument has the same format and auxiliary role as for
|
||||
@racket[get-file]. In particular, if the only pattern in @racket[filters]
|
||||
is @racket[(string-append "*." extension)], then the result pathname is guaranteed
|
||||
to have an extension mapping @racket[extension].
|
||||
|
||||
On Mac OS X 10.5 and later, if @scheme[extension] is not
|
||||
@scheme[#f] or @racket[""], the returned path will get a default extension if the
|
||||
user does not supply one. If @scheme[filters] contains as
|
||||
@scheme["*.*"] pattern, then the user can supply any extension that
|
||||
On Mac OS X 10.5 and later, if @racket[extension] is not
|
||||
@racket[#f] or @racket[""], the returned path will get a default extension if the
|
||||
user does not supply one. If @racket[filters] contains as
|
||||
@racket["*.*"] pattern, then the user can supply any extension that
|
||||
is recognized by the system; otherwise, the extension on the returned
|
||||
path will be either @scheme[extension] or @scheme[_other-extension]
|
||||
for any @scheme[(string-append "*." _other-extension)] pattern in
|
||||
@scheme[filters]. In particular, if the only pattern in
|
||||
@scheme[filters] is empty or contains only @scheme[(string-append
|
||||
path will be either @racket[extension] or @racket[_other-extension]
|
||||
for any @racket[(string-append "*." _other-extension)] pattern in
|
||||
@racket[filters]. In particular, if the only pattern in
|
||||
@racket[filters] is empty or contains only @racket[(string-append
|
||||
"*." extension)], then the result pathname is guaranteed to have an
|
||||
extension mapping @scheme[extension].
|
||||
extension mapping @racket[extension].
|
||||
|
||||
On Mac OS X versions before 10.5, the returned path will get a
|
||||
default extension only if @scheme[extension] is not @scheme[#f],
|
||||
@scheme[extension] is not @racket[""], and
|
||||
@scheme[filters] contains only @scheme[(string-append "*."
|
||||
default extension only if @racket[extension] is not @racket[#f],
|
||||
@racket[extension] is not @racket[""], and
|
||||
@racket[filters] contains only @racket[(string-append "*."
|
||||
extension)].
|
||||
|
||||
On Unix, @racket[extension] is ignored, and @racket[filters] is used
|
||||
to filter the visible list of files as in @racket[get-file].
|
||||
|
||||
The @scheme[style] list is treated as for @scheme[get-file].
|
||||
The @racket[style] list is treated as for @racket[get-file].
|
||||
|
||||
See also @scheme[path-dialog%].
|
||||
See also @racket[path-dialog%].
|
||||
|
||||
}
|
||||
|
||||
|
@ -160,25 +160,25 @@ See also @scheme[path-dialog%].
|
|||
(or/c path #f)]{
|
||||
|
||||
Obtains a directory pathname from the user via the platform-specific
|
||||
standard (modal) dialog, using @scheme[parent] as the parent window if
|
||||
standard (modal) dialog, using @racket[parent] as the parent window if
|
||||
it is specified.
|
||||
|
||||
If @scheme[directory] is not @scheme[#f], it is used on some platforms as
|
||||
If @racket[directory] is not @racket[#f], it is used on some platforms as
|
||||
the starting directory for the directory selector (otherwise the
|
||||
starting directory is chosen automatically in a platform-specific
|
||||
manner, usually based on the current directory and the user's
|
||||
interactions in previous calls to @scheme[get-file],
|
||||
@scheme[put-file], etc.).
|
||||
interactions in previous calls to @racket[get-file],
|
||||
@racket[put-file], etc.).
|
||||
|
||||
The @scheme[style] argument is treated as for
|
||||
@scheme[get-file], except that only @scheme['common] or @scheme['enter-packages] can be
|
||||
The @racket[style] argument is treated as for
|
||||
@racket[get-file], except that only @racket['common] or @racket['enter-packages] can be
|
||||
specified. The latter
|
||||
matters only on Mac OS X, where @scheme['enter-packages]
|
||||
matters only on Mac OS X, where @racket['enter-packages]
|
||||
enables the user to select package directory or a directory within a
|
||||
package. A package is a directory with a special suffix (e.g.,
|
||||
``.app'') that the Finder normally displays like a file.
|
||||
|
||||
See also @scheme[path-dialog%].
|
||||
See also @racket[path-dialog%].
|
||||
}
|
||||
|
||||
@defproc[(message-box [title label-string?]
|
||||
|
@ -187,45 +187,45 @@ See also @scheme[path-dialog%].
|
|||
[style (listof (or/c 'ok 'ok-cancel 'yes-no 'caution 'stop)) '(ok)])
|
||||
(or/c 'ok 'cancel 'yes 'no)]{
|
||||
|
||||
See also @scheme[message-box/custom].
|
||||
See also @racket[message-box/custom].
|
||||
|
||||
Displays a message to the user in a (modal) dialog, using
|
||||
@scheme[parent] as the parent window if it is specified. The dialog's
|
||||
title is @scheme[title]. The @scheme[message] string can be arbitrarily
|
||||
@racket[parent] as the parent window if it is specified. The dialog's
|
||||
title is @racket[title]. The @racket[message] string can be arbitrarily
|
||||
long, and can contain explicit linefeeds or carriage returns for
|
||||
breaking lines.
|
||||
|
||||
The style must include exactly one of the following:
|
||||
@itemize[
|
||||
|
||||
@item{@scheme['ok] --- the dialog only has an @onscreen{OK} button
|
||||
and always returns @scheme['ok].}
|
||||
@item{@racket['ok] --- the dialog only has an @onscreen{OK} button
|
||||
and always returns @racket['ok].}
|
||||
|
||||
@item{@scheme['ok-cancel] --- the message dialog has
|
||||
@item{@racket['ok-cancel] --- the message dialog has
|
||||
@onscreen{Cancel} and @onscreen{OK} buttons. If the user clicks
|
||||
@onscreen{Cancel}, the result is @scheme['cancel], otherwise the
|
||||
result is @scheme['ok].}
|
||||
@onscreen{Cancel}, the result is @racket['cancel], otherwise the
|
||||
result is @racket['ok].}
|
||||
|
||||
@item{@scheme['yes-no] --- the message dialog has @onscreen{Yes} and
|
||||
@item{@racket['yes-no] --- the message dialog has @onscreen{Yes} and
|
||||
@onscreen{No} buttons. If the user clicks @onscreen{Yes}, the result
|
||||
is @scheme['yes], otherwise the result is @scheme['no]. Note: instead
|
||||
is @racket['yes], otherwise the result is @racket['no]. Note: instead
|
||||
of a @onscreen{Yes}/@onscreen{No} dialog, best-practice GUI design is
|
||||
to use @scheme[message-box/custom] and give the buttons meaningful
|
||||
to use @racket[message-box/custom] and give the buttons meaningful
|
||||
labels, so that the user does not have to read the message text
|
||||
carefully to make a selection.}
|
||||
|
||||
]
|
||||
|
||||
In addition, @scheme[style] can contain @scheme['caution] to make the
|
||||
In addition, @racket[style] can contain @racket['caution] to make the
|
||||
dialog use a caution icon instead of the application (or generic
|
||||
``info'') icon. Alternately, it can contain @scheme['stop] to make the
|
||||
dialog use a stop icon. If @scheme[style] contains both @scheme['caution]
|
||||
and @scheme['stop], then @scheme['caution] is ignored.
|
||||
``info'') icon. Alternately, it can contain @racket['stop] to make the
|
||||
dialog use a stop icon. If @racket[style] contains both @racket['caution]
|
||||
and @racket['stop], then @racket['caution] is ignored.
|
||||
|
||||
The class that implements the dialog provides a @scheme[get-message]
|
||||
The class that implements the dialog provides a @racket[get-message]
|
||||
method that takes no arguments and returns the text of the message as
|
||||
a string. (The dialog is accessible through the
|
||||
@scheme[get-top-level-windows] function.)
|
||||
@racket[get-top-level-windows] function.)
|
||||
|
||||
The @racket[message-box] function can be called int a thread other
|
||||
than the handler thread of the relevant eventspace (i.e., the eventspace of
|
||||
|
@ -246,26 +246,26 @@ The @racket[message-box] function can be called int a thread other
|
|||
(or/c 1 2 3 close-result)]{
|
||||
|
||||
Displays a message to the user in a (modal) dialog, using
|
||||
@scheme[parent] as the parent window if it is specified. The dialog's
|
||||
title is @scheme[title]. The @scheme[message] string can be arbitrarily
|
||||
@racket[parent] as the parent window if it is specified. The dialog's
|
||||
title is @racket[title]. The @racket[message] string can be arbitrarily
|
||||
long, and can contain explicit linefeeds or carriage returns for
|
||||
breaking lines.
|
||||
|
||||
The dialog contains up to three buttons for the user to click. The
|
||||
buttons have the labels @scheme[button1-label],
|
||||
@scheme[button2-label], and @scheme[button3-label], where @scheme[#f] for a
|
||||
buttons have the labels @racket[button1-label],
|
||||
@racket[button2-label], and @racket[button3-label], where @racket[#f] for a
|
||||
label indicates that the button should be hidden.
|
||||
|
||||
If the user clicks the button labelled @scheme[button1-label], a @scheme[1]
|
||||
is returned, and so on for @scheme[2] and @scheme[3]. If the user closes
|
||||
the dialog some other way---which is only allowed when @scheme[style]
|
||||
does not contain @scheme['disallow-close]---then the result is the
|
||||
value of @scheme[close-result]. For example, the user can usually close
|
||||
a dialog by typing an Escape. Often, @scheme[2] is an appropriate value
|
||||
for @scheme[close-result], especially when Button 2 is a @onscreen{Cancel}
|
||||
If the user clicks the button labelled @racket[button1-label], a @racket[1]
|
||||
is returned, and so on for @racket[2] and @racket[3]. If the user closes
|
||||
the dialog some other way---which is only allowed when @racket[style]
|
||||
does not contain @racket['disallow-close]---then the result is the
|
||||
value of @racket[close-result]. For example, the user can usually close
|
||||
a dialog by typing an Escape. Often, @racket[2] is an appropriate value
|
||||
for @racket[close-result], especially when Button 2 is a @onscreen{Cancel}
|
||||
button.
|
||||
|
||||
If @scheme[style] does not include @scheme['number-order], the order of
|
||||
If @racket[style] does not include @racket['number-order], the order of
|
||||
the buttons is platform-specific, and labels should be assigned to
|
||||
the buttons based on their role:
|
||||
@itemize[
|
||||
|
@ -274,7 +274,7 @@ If @scheme[style] does not include @scheme['number-order], the order of
|
|||
button. For example, if the dialog has an @onscreen{OK} button, it is
|
||||
this one. On Windows, this button is leftmost; on Unix and Mac OS
|
||||
X, it is rightmost. (See also
|
||||
@scheme[system-position-ok-before-cancel?].) Use this button for
|
||||
@racket[system-position-ok-before-cancel?].) Use this button for
|
||||
dialogs that contain only one button.}
|
||||
|
||||
@item{Button 2 is next to Button 1, and it often plays the role of
|
||||
|
@ -289,28 +289,28 @@ If @scheme[style] does not include @scheme['number-order], the order of
|
|||
Despite the above guidelines, any combination of visible buttons is
|
||||
allowed in the dialog.
|
||||
|
||||
If @scheme[style] includes @scheme['number-order], then the buttons are
|
||||
If @racket[style] includes @racket['number-order], then the buttons are
|
||||
displayed in the dialog left-to-right with equal spacing between all
|
||||
buttons, though aligned within the dialog (centered or right-aligned)
|
||||
in a platform-specific manner. Use @scheme['number-order] sparingly.
|
||||
in a platform-specific manner. Use @racket['number-order] sparingly.
|
||||
|
||||
The @scheme[style] list must contain exactly one of @scheme['default=1],
|
||||
@scheme['default=2], @scheme['default=3], and @scheme['no-default] to
|
||||
The @racket[style] list must contain exactly one of @racket['default=1],
|
||||
@racket['default=2], @racket['default=3], and @racket['no-default] to
|
||||
determine which button (if any) is the default. The default button is
|
||||
``clicked'' when the user types Return. If @scheme['default=]@scheme[n]
|
||||
is supplied but button @scheme[n] has no label, then it is equivalent to
|
||||
@scheme['no-default].
|
||||
``clicked'' when the user types Return. If @racket['default=]@racket[n]
|
||||
is supplied but button @racket[n] has no label, then it is equivalent to
|
||||
@racket['no-default].
|
||||
|
||||
In addition, @scheme[style] can contain @scheme['caution] to make the
|
||||
In addition, @racket[style] can contain @racket['caution] to make the
|
||||
dialog use a caution icon instead of the application (or generic
|
||||
``info'') icon. Alternately, it can contain @scheme['stop] to make the
|
||||
dialog use a stop icon. If @scheme[style] contains both @scheme['caution]
|
||||
and @scheme['stop], then @scheme['caution] is ignored.
|
||||
``info'') icon. Alternately, it can contain @racket['stop] to make the
|
||||
dialog use a stop icon. If @racket[style] contains both @racket['caution]
|
||||
and @racket['stop], then @racket['caution] is ignored.
|
||||
|
||||
The class that implements the dialog provides a @scheme[get-message]
|
||||
The class that implements the dialog provides a @racket[get-message]
|
||||
method that takes no arguments and returns the text of the message as
|
||||
a string. (The dialog is accessible through the
|
||||
@scheme[get-top-level-windows] function.)
|
||||
@racket[get-top-level-windows] function.)
|
||||
|
||||
The @racket[message-box/custom] function can be called int a thread
|
||||
other than the handler thread of the relevant eventspace (i.e., the eventspace of
|
||||
|
@ -326,15 +326,15 @@ The @racket[message-box/custom] function can be called int a thread
|
|||
'(ok)])
|
||||
(values (or/c 'ok 'cancel 'yes 'no) boolean?)]{
|
||||
|
||||
See also @scheme[message+check-box/custom].
|
||||
See also @racket[message+check-box/custom].
|
||||
|
||||
Like @scheme[message-box], except that
|
||||
Like @racket[message-box], except that
|
||||
|
||||
@itemize[
|
||||
@item{the dialog contains a check box whose label is @scheme[check-label];}
|
||||
@item{the result is two values: the @scheme[message-box] result, and a
|
||||
@item{the dialog contains a check box whose label is @racket[check-label];}
|
||||
@item{the result is two values: the @racket[message-box] result, and a
|
||||
boolean indicating whether the box was checked; and}
|
||||
@item{@scheme[style] can contain @scheme['checked] to indicate that the check box
|
||||
@item{@racket[style] can contain @racket['checked] to indicate that the check box
|
||||
should be initially checked.}
|
||||
]}
|
||||
|
||||
|
@ -352,12 +352,12 @@ Like @scheme[message-box], except that
|
|||
[close-result any/c #f])
|
||||
(or/c 1 2 3 (λ (x) (eq? x close-result)))]{
|
||||
|
||||
Like @scheme[message-box/custom], except that
|
||||
Like @racket[message-box/custom], except that
|
||||
@itemize[
|
||||
@item{the dialog contains a check box whose label is @scheme[check-label];}
|
||||
@item{the result is two values: the @scheme[message-box] result, and a
|
||||
@item{the dialog contains a check box whose label is @racket[check-label];}
|
||||
@item{the result is two values: the @racket[message-box] result, and a
|
||||
boolean indicating whether the box was checked; and}
|
||||
@item{@scheme[style] can contain @scheme['checked] to indicate that the check box
|
||||
@item{@racket[style] can contain @racket['checked] to indicate that the check box
|
||||
should be initially checked.}
|
||||
]
|
||||
|
||||
|
@ -374,15 +374,15 @@ Like @scheme[message-box/custom], except that
|
|||
(or/c string? #f)]{
|
||||
|
||||
Gets a text string from the user via a modal dialog, using
|
||||
@scheme[parent] as the parent window if it is specified. The dialog's
|
||||
title is @scheme[title]. The dialog's text field is labelled with
|
||||
@scheme[message] and initialized to @scheme[init-val] (but @scheme[init-val]
|
||||
@racket[parent] as the parent window if it is specified. The dialog's
|
||||
title is @racket[title]. The dialog's text field is labelled with
|
||||
@racket[message] and initialized to @racket[init-val] (but @racket[init-val]
|
||||
does not determine the size of the dialog).
|
||||
|
||||
The result is @scheme[#f] if the user cancels the dialog, the
|
||||
The result is @racket[#f] if the user cancels the dialog, the
|
||||
user-provided string otherwise.
|
||||
|
||||
If @scheme[style] includes @scheme['password], the dialog's text field
|
||||
If @racket[style] includes @racket['password], the dialog's text field
|
||||
draws each character of its content using a generic symbol, instead
|
||||
of the actual character.
|
||||
|
||||
|
@ -399,18 +399,18 @@ If @scheme[style] includes @scheme['password], the dialog's text field
|
|||
(or/c (listof exact-nonnegative-integer?) #f)]{
|
||||
|
||||
Gets a list box selection from the user via a modal dialog, using
|
||||
@scheme[parent] as the parent window if it is specified. The dialog's
|
||||
title is @scheme[title]. The dialog's list box is labelled with
|
||||
@scheme[message] and initialized by selecting the items in
|
||||
@scheme[init-choices].
|
||||
@racket[parent] as the parent window if it is specified. The dialog's
|
||||
title is @racket[title]. The dialog's list box is labelled with
|
||||
@racket[message] and initialized by selecting the items in
|
||||
@racket[init-choices].
|
||||
|
||||
The style must contain exactly one of @indexed-scheme['single],
|
||||
@indexed-scheme['multiple], or @indexed-scheme['extended]. The styles have
|
||||
the same meaning as for creating a @scheme[list-box%] object. (For
|
||||
The style must contain exactly one of @indexed-racket['single],
|
||||
@indexed-racket['multiple], or @indexed-racket['extended]. The styles have
|
||||
the same meaning as for creating a @racket[list-box%] object. (For
|
||||
the single-selection style, only the last selection in
|
||||
@scheme[init-choices] matters.)
|
||||
@racket[init-choices] matters.)
|
||||
|
||||
The result is @scheme[#f] if the user cancels the dialog, the
|
||||
The result is @racket[#f] if the user cancels the dialog, the
|
||||
list of selections otherwise.
|
||||
|
||||
|
||||
|
@ -424,14 +424,14 @@ The result is @scheme[#f] if the user cancels the dialog, the
|
|||
(or/c (is-a?/c color%) #f)]{
|
||||
|
||||
Lets the user select a color though the platform-specific
|
||||
(modal) dialog, using @scheme[parent] as the parent window if it is
|
||||
specified. The @scheme[message] string is displayed as a prompt in the
|
||||
dialog if possible. If @scheme[init-color] is provided, the dialog is
|
||||
(modal) dialog, using @racket[parent] as the parent window if it is
|
||||
specified. The @racket[message] string is displayed as a prompt in the
|
||||
dialog if possible. If @racket[init-color] is provided, the dialog is
|
||||
initialized to the given color.
|
||||
|
||||
@italicptyStyleNote[@scheme[style]]
|
||||
@italicptyStyleNote[@racket[style]]
|
||||
|
||||
The result is @scheme[#f] if the user cancels the dialog, the selected
|
||||
The result is @racket[#f] if the user cancels the dialog, the selected
|
||||
color otherwise.
|
||||
|
||||
|
||||
|
@ -445,14 +445,14 @@ The result is @scheme[#f] if the user cancels the dialog, the selected
|
|||
(or/c (is-a?/c font%) #f)]{
|
||||
|
||||
Lets the user select a font though the platform-specific
|
||||
(modal) dialog, using @scheme[parent] as the parent window if it is
|
||||
specified. The @scheme[message] string is displayed as a prompt in the
|
||||
dialog if possible. If @scheme[init-font] is provided, the dialog is
|
||||
(modal) dialog, using @racket[parent] as the parent window if it is
|
||||
specified. The @racket[message] string is displayed as a prompt in the
|
||||
dialog if possible. If @racket[init-font] is provided, the dialog is
|
||||
initialized to the given font.
|
||||
|
||||
@italicptyStyleNote[@scheme[style]]
|
||||
@italicptyStyleNote[@racket[style]]
|
||||
|
||||
The result is @scheme[#f] if the user cancels the dialog, the selected
|
||||
The result is @racket[#f] if the user cancels the dialog, the selected
|
||||
font otherwise.
|
||||
|
||||
|
||||
|
@ -466,16 +466,16 @@ The result is @scheme[#f] if the user cancels the dialog, the selected
|
|||
(or/c (is-a?/c ps-setup%) #f)]{
|
||||
|
||||
Lets the user select a PostScript configuration though a (modal)
|
||||
dialog, using @scheme[parent] as the parent window if it is
|
||||
specified. The @scheme[message] string is displayed as a prompt in the
|
||||
dialog. If @scheme[init-setup] is provided, the dialog is initialized to
|
||||
dialog, using @racket[parent] as the parent window if it is
|
||||
specified. The @racket[message] string is displayed as a prompt in the
|
||||
dialog. If @racket[init-setup] is provided, the dialog is initialized to
|
||||
the given configuration, otherwise the current configuration from
|
||||
@scheme[current-ps-setup] is used.
|
||||
@racket[current-ps-setup] is used.
|
||||
|
||||
@italicptyStyleNote[@scheme[style]]
|
||||
@italicptyStyleNote[@racket[style]]
|
||||
|
||||
The result is @scheme[#f] if the user cancels the dialog, , a
|
||||
@scheme[ps-setup%] object that encapsulates the selected PostScript
|
||||
The result is @racket[#f] if the user cancels the dialog, , a
|
||||
@racket[ps-setup%] object that encapsulates the selected PostScript
|
||||
configuration otherwise.
|
||||
|
||||
|
||||
|
@ -489,22 +489,22 @@ The result is @scheme[#f] if the user cancels the dialog, , a
|
|||
(or/c (is-a?/c ps-setup%) #f)]{
|
||||
|
||||
Like
|
||||
@scheme[get-ps-setup-from-user], but the dialog configures page layout for native printing
|
||||
with @scheme[printer-dc%]. A dialog is shown only if
|
||||
@scheme[can-get-page-setup-from-user?] returns @scheme[#t], otherwise no dialog is shown and the result
|
||||
is @scheme[#f].
|
||||
@racket[get-ps-setup-from-user], but the dialog configures page layout for native printing
|
||||
with @racket[printer-dc%]. A dialog is shown only if
|
||||
@racket[can-get-page-setup-from-user?] returns @racket[#t], otherwise no dialog is shown and the result
|
||||
is @racket[#f].
|
||||
|
||||
The @scheme[parent] argument is used as the parent window for a dialog if
|
||||
it is specified. The @scheme[message] string might be displayed as a
|
||||
prompt in the dialog. If @scheme[init-setup] is provided, the dialog is
|
||||
The @racket[parent] argument is used as the parent window for a dialog if
|
||||
it is specified. The @racket[message] string might be displayed as a
|
||||
prompt in the dialog. If @racket[init-setup] is provided, the dialog is
|
||||
initialized to the given configuration, otherwise the current
|
||||
configuration from
|
||||
@scheme[current-ps-setup] is used.
|
||||
@racket[current-ps-setup] is used.
|
||||
|
||||
@italicptyStyleNote[@scheme[style]]
|
||||
@italicptyStyleNote[@racket[style]]
|
||||
|
||||
The result is @scheme[#f] if the user cancels the dialog, a
|
||||
@scheme[ps-setup%] object that encapsulates the selected
|
||||
The result is @racket[#f] if the user cancels the dialog, a
|
||||
@racket[ps-setup%] object that encapsulates the selected
|
||||
configuration otherwise.
|
||||
|
||||
|
||||
|
@ -513,11 +513,11 @@ The result is @scheme[#f] if the user cancels the dialog, a
|
|||
|
||||
@defproc[(can-get-page-setup-from-user?)
|
||||
boolean?]{
|
||||
Returns @scheme[#t] if the current platform (Mac OS X) supports a
|
||||
page-layout dialog for use with @scheme[printer-dc%] printing, and
|
||||
Returns @racket[#t] if the current platform (Mac OS X) supports a
|
||||
page-layout dialog for use with @racket[printer-dc%] printing, and
|
||||
if the page-layout dialog is different from the print-job dialog that
|
||||
is automatically shown when a @scheme[printer-dc%] is
|
||||
created. Returns @scheme[#f] if no separate page-layout dialog is
|
||||
is automatically shown when a @racket[printer-dc%] is
|
||||
created. Returns @racket[#f] if no separate page-layout dialog is
|
||||
needed (Windows and Unix).
|
||||
|
||||
}
|
||||
|
|
|
@ -4,20 +4,18 @@
|
|||
@defclass/title[editor-admin% object% ()]{
|
||||
|
||||
See @|admindiscuss| for information about the role of administrators.
|
||||
The @scheme[editor-admin%] class is never instantiated directly. It
|
||||
The @racket[editor-admin%] class is never instantiated directly. It
|
||||
is not even instantiated through derived classes by most programmers;
|
||||
each @scheme[editor-canvas%] and @scheme[editor-snip%] object
|
||||
each @racket[editor-canvas%] and @racket[editor-snip%] object
|
||||
creates its own administrator. However, it may be useful to derive a
|
||||
new instance of this class to display editors in a new context. Also,
|
||||
it may be useful to call the methods of an existing administrator
|
||||
from an owned editor.
|
||||
|
||||
To create a new @scheme[editor-admin%] class, all methods described
|
||||
To create a new @racket[editor-admin%] class, all methods described
|
||||
here must be overridden. They are all invoked by the administrator's
|
||||
editor.
|
||||
|
||||
|
||||
|
||||
@defconstructor[()]{
|
||||
|
||||
Creates a (useless) editor administrator.
|
||||
|
@ -34,7 +32,7 @@ Returns either the drawing context into which the editor is displayed,
|
|||
or the context into which it is currently being drawn. When the
|
||||
editor is not embedded, the returned context is always the drawing
|
||||
content into which the editor is displayed. If the editor is not
|
||||
displayed, @scheme[#f] is returned.
|
||||
displayed, @racket[#f] is returned.
|
||||
|
||||
The origin of the drawing context is also returned, translated into
|
||||
the local coordinates of the editor. For an embedded editor, the
|
||||
|
@ -50,11 +48,10 @@ See also @xmethod[editor<%> editor-location-to-dc-location] and
|
|||
}
|
||||
@methimpl{
|
||||
|
||||
Fills all boxes with @scheme[0.0] and returns @scheme[#f].
|
||||
Fills all boxes with @racket[0.0] and returns @racket[#f].
|
||||
|
||||
}}
|
||||
|
||||
|
||||
@defmethod[(get-max-view [x (or/c (box/c real?) false/c)]
|
||||
[y (or/c (box/c real?) false/c)]
|
||||
[w (or/c (box/c (and/c real? (not/c negative?))) false/c)]
|
||||
|
@ -73,7 +70,7 @@ See @method[editor-admin% get-view].
|
|||
}
|
||||
@methimpl{
|
||||
|
||||
Fills all boxes with @scheme[0.0].
|
||||
Fills all boxes with @racket[0.0].
|
||||
|
||||
}}
|
||||
|
||||
|
@ -108,20 +105,20 @@ The calculation of the editor's visible region is based on the current
|
|||
@boxisfillnull[(scheme w) @elem{the width of the visible region, which may be larger than the editor itself}]
|
||||
@boxisfillnull[(scheme h) @elem{the height of the visible region, which may be larger than the editor itself}]
|
||||
|
||||
If an editor is fully visible and @scheme[full?] is @scheme[#f], then
|
||||
@scheme[x] and @scheme[y] will both be filled with @scheme[0].
|
||||
If an editor is fully visible and @racket[full?] is @racket[#f], then
|
||||
@racket[x] and @racket[y] will both be filled with @racket[0].
|
||||
|
||||
If @scheme[full?] is a true value, then the returned area is the view
|
||||
If @racket[full?] is a true value, then the returned area is the view
|
||||
area of the top-level @techlink{display} for the editor. This result
|
||||
is different only when the editor is embedded in another editor; in
|
||||
that case, the @scheme[x] and @scheme[y] values may be meaningless,
|
||||
that case, the @racket[x] and @racket[y] values may be meaningless,
|
||||
because they are in the coordinate system of the immediate editor
|
||||
within the top-level @techlink{display}.
|
||||
|
||||
}
|
||||
@methimpl{
|
||||
|
||||
Fills all boxes with @scheme[0.0].
|
||||
Fills all boxes with @racket[0.0].
|
||||
|
||||
}}
|
||||
|
||||
|
@ -134,7 +131,7 @@ Called by the editor to request the keyboard focus. If the request is
|
|||
method will be called.
|
||||
|
||||
See @method[editor<%> set-caret-owner] for information about the
|
||||
possible values of @scheme[domain].
|
||||
possible values of @racket[domain].
|
||||
|
||||
}
|
||||
@methimpl{
|
||||
|
@ -172,7 +169,7 @@ Called by the editor to request a refresh to its displayed
|
|||
should be refreshed, it calls the editor's @method[editor<%> refresh]
|
||||
method.
|
||||
|
||||
The @scheme[localx], @scheme[localy], @scheme[w], and @scheme[h]
|
||||
The @racket[localx], @racket[localy], @racket[w], and @racket[h]
|
||||
arguments specify a region of the editor to be updated (in editor
|
||||
coordinates).
|
||||
|
||||
|
@ -192,16 +189,16 @@ Does nothing.
|
|||
|
||||
@popupmenuinfo[@elem{administrator's @techlink{display}}
|
||||
@elem{top-level editor in this administrator's @techlink{display}}
|
||||
@elem{The result is @scheme[#t] if the popup succeeds,
|
||||
@scheme[#f] otherwise (independent of whether the
|
||||
@elem{The result is @racket[#t] if the popup succeeds,
|
||||
@racket[#f] otherwise (independent of whether the
|
||||
user selects an item in the popup menu).}]
|
||||
|
||||
The menu is displayed at @scheme[x] and @scheme[y] in editor coordinates.
|
||||
The menu is displayed at @racket[x] and @racket[y] in editor coordinates.
|
||||
|
||||
}
|
||||
@methimpl{
|
||||
|
||||
Returns @scheme[#f].
|
||||
Returns @racket[#f].
|
||||
|
||||
}}
|
||||
|
||||
|
@ -211,14 +208,14 @@ Returns @scheme[#f].
|
|||
|
||||
@methspec{
|
||||
|
||||
Returns @scheme[#t] if updating on this administrator's
|
||||
Returns @racket[#t] if updating on this administrator's
|
||||
@techlink{display} is currently delayed (usually by
|
||||
@xmethod[editor<%> begin-edit-sequence] in an enclosing editor).
|
||||
|
||||
}
|
||||
@methimpl{
|
||||
|
||||
Returns @scheme[#f].
|
||||
Returns @racket[#f].
|
||||
|
||||
}}
|
||||
|
||||
|
@ -232,7 +229,7 @@ Called by the editor to notify its @techlink{display} that the
|
|||
editor's size or scroll count has changed, so the scrollbars need to
|
||||
be adjusted to reflect the new size. The editor generally needs to be
|
||||
updated after a resize, but the editor decides whether the update
|
||||
should occur immediately. If @scheme[refresh?] is not @scheme[#f],
|
||||
should occur immediately. If @racket[refresh?] is not @racket[#f],
|
||||
then the editor is requesting to be updated immediately.
|
||||
|
||||
}
|
||||
|
@ -256,22 +253,22 @@ Called by the editor to request scrolling so that the given region is
|
|||
visible. The editor generally needs to be updated after a scroll, but
|
||||
the editor decides whether the update should occur immediately.
|
||||
|
||||
The @scheme[localx], @scheme[localy], @scheme[w], and @scheme[h]
|
||||
The @racket[localx], @racket[localy], @racket[w], and @racket[h]
|
||||
arguments specify a region of the editor to be made visible by the
|
||||
scroll (in editor coordinates).
|
||||
|
||||
If @scheme[refresh?] is not @scheme[#f], then the editor is requesting
|
||||
If @racket[refresh?] is not @racket[#f], then the editor is requesting
|
||||
to be updated immediately.
|
||||
|
||||
The @scheme[bias] argument is one of:
|
||||
The @racket[bias] argument is one of:
|
||||
@itemize[
|
||||
@item{@scheme['start] --- if the range doesn't fit in the visible area, show the top-left region}
|
||||
@item{@scheme['none] --- no special scrolling instructions}
|
||||
@item{@scheme['end] --- if the range doesn't fit in the visible area, show the bottom-right region}
|
||||
@item{@racket['start] --- if the range doesn't fit in the visible area, show the top-left region}
|
||||
@item{@racket['none] --- no special scrolling instructions}
|
||||
@item{@racket['end] --- if the range doesn't fit in the visible area, show the bottom-right region}
|
||||
]
|
||||
|
||||
The return value is @scheme[#t] if the @techlink{display} is scrolled,
|
||||
@scheme[#f] if not (either because the requested region is already
|
||||
The return value is @racket[#t] if the @techlink{display} is scrolled,
|
||||
@racket[#f] if not (either because the requested region is already
|
||||
visible, because the @techlink{display} has zero size, or because the
|
||||
editor is currently printing).
|
||||
|
||||
|
@ -283,7 +280,7 @@ If an editor has multiple @techlink{displays}, then if any display
|
|||
}
|
||||
@methimpl{
|
||||
|
||||
Return @scheme[#f]
|
||||
Return @racket[#f]
|
||||
|
||||
}}
|
||||
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
@defclass/title[editor-canvas% object% (canvas<%>)]{
|
||||
|
||||
An @scheme[editor-canvas%] object manages and displays a
|
||||
@scheme[text%] or @scheme[pasteboard%] object.
|
||||
An @racket[editor-canvas%] object manages and displays a
|
||||
@racket[text%] or @racket[pasteboard%] object.
|
||||
|
||||
|
||||
@defconstructor[([parent (or/c (is-a?/c frame%) (is-a?/c dialog%)
|
||||
|
@ -29,48 +29,48 @@ An @scheme[editor-canvas%] object manages and displays a
|
|||
[stretchable-width any/c #t]
|
||||
[stretchable-height any/c #t])]{
|
||||
|
||||
If a canvas is initialized with @scheme[#f] for @scheme[editor],
|
||||
If a canvas is initialized with @racket[#f] for @racket[editor],
|
||||
install an editor later with @method[editor-canvas% set-editor].
|
||||
|
||||
The @scheme[style] list can contain the following flags:
|
||||
The @racket[style] list can contain the following flags:
|
||||
|
||||
@itemize[
|
||||
|
||||
@item{@scheme['no-border] --- omits a border around the canvas}
|
||||
@item{@racket['no-border] --- omits a border around the canvas}
|
||||
|
||||
@item{@scheme['control-border] --- gives the canvas a border that is
|
||||
like a @scheme[text-field%] control}
|
||||
@item{@racket['control-border] --- gives the canvas a border that is
|
||||
like a @racket[text-field%] control}
|
||||
|
||||
@item{@scheme['combo] --- gives the canvas a combo button that is like
|
||||
a @scheme[combo-field%] control; this
|
||||
@item{@racket['combo] --- gives the canvas a combo button that is like
|
||||
a @racket[combo-field%] control; this
|
||||
style is intended for use with
|
||||
@scheme['control-border],
|
||||
@scheme['hide-hscroll], and
|
||||
@scheme['hide-vscroll]}
|
||||
@racket['control-border],
|
||||
@racket['hide-hscroll], and
|
||||
@racket['hide-vscroll]}
|
||||
|
||||
@item{@scheme['no-hscroll] --- disallows horizontal scrolling and hides the horizontal scrollbar}
|
||||
@item{@racket['no-hscroll] --- disallows horizontal scrolling and hides the horizontal scrollbar}
|
||||
|
||||
@item{@scheme['no-vscroll] --- disallows vertical scrolling and hides the vertical scrollbar}
|
||||
@item{@racket['no-vscroll] --- disallows vertical scrolling and hides the vertical scrollbar}
|
||||
|
||||
@item{@scheme['hide-hscroll] --- allows horizontal scrolling, but hides the horizontal scrollbar}
|
||||
@item{@racket['hide-hscroll] --- allows horizontal scrolling, but hides the horizontal scrollbar}
|
||||
|
||||
@item{@scheme['hide-vscroll] --- allows vertical scrolling, but hides the vertical scrollbar}
|
||||
@item{@racket['hide-vscroll] --- allows vertical scrolling, but hides the vertical scrollbar}
|
||||
|
||||
@item{@scheme['auto-hscroll] --- automatically hides the horizontal scrollbar when unneeded
|
||||
(unless @scheme['no-hscroll] or @scheme['hide-hscroll] is specified)}
|
||||
@item{@racket['auto-hscroll] --- automatically hides the horizontal scrollbar when unneeded
|
||||
(unless @racket['no-hscroll] or @racket['hide-hscroll] is specified)}
|
||||
|
||||
@item{@scheme['auto-vscroll] --- automatically hides the vertical scrollbar when unneeded
|
||||
(unless @scheme['no-vscroll] or @scheme['hide-vscroll] is specified)}
|
||||
@item{@racket['auto-vscroll] --- automatically hides the vertical scrollbar when unneeded
|
||||
(unless @racket['no-vscroll] or @racket['hide-vscroll] is specified)}
|
||||
|
||||
@item{@scheme['resize-corner] --- leaves room for a resize control at the canvas's
|
||||
@item{@racket['resize-corner] --- leaves room for a resize control at the canvas's
|
||||
bottom right when only one scrollbar is visible}
|
||||
|
||||
@item{@scheme['deleted] --- creates the canvas as initially hidden and without affecting
|
||||
@scheme[parent]'s geometry; the canvas can be made active
|
||||
later by calling @scheme[parent]'s @method[area-container<%> add-child]
|
||||
@item{@racket['deleted] --- creates the canvas as initially hidden and without affecting
|
||||
@racket[parent]'s geometry; the canvas can be made active
|
||||
later by calling @racket[parent]'s @method[area-container<%> add-child]
|
||||
method}
|
||||
|
||||
@item{@scheme['transparent] --- the canvas is ``erased'' before an
|
||||
@item{@racket['transparent] --- the canvas is ``erased'' before an
|
||||
update using its parent window's background; see @racket[canvas<%>]
|
||||
for information on the interaction of @racket['transparent] and
|
||||
offscreen buffering}
|
||||
|
@ -79,23 +79,23 @@ The @scheme[style] list can contain the following flags:
|
|||
|
||||
While vertical scrolling of text editors is based on lines,
|
||||
horizontal scrolling and pasteboard vertical scrolling is based on a
|
||||
fixed number of steps per horizontal page. The @scheme[scrolls-per-page]
|
||||
fixed number of steps per horizontal page. The @racket[scrolls-per-page]
|
||||
argument sets this value.
|
||||
|
||||
@index["wheel on mouse"]{If} provided, the @scheme[wheel-step]
|
||||
@index["wheel on mouse"]{If} provided, the @racket[wheel-step]
|
||||
argument is passed on to the @method[editor-canvas% wheel-step]
|
||||
method. The default wheel step can be overridden globally though the
|
||||
@ResourceFirst{wheelStep}; see @|mrprefsdiscuss|.
|
||||
|
||||
If @scheme[line-count] is not @scheme[#f], it is passed on to the
|
||||
If @racket[line-count] is not @racket[#f], it is passed on to the
|
||||
@method[editor-canvas% set-line-count] method.
|
||||
|
||||
If @scheme[horizontal-inset] is not @scheme[5], it is passed on to the
|
||||
If @racket[horizontal-inset] is not @racket[5], it is passed on to the
|
||||
@method[editor-canvas% horizontal-inset] method. Similarly, if
|
||||
@scheme[vertical-inset] is not @scheme[5], it is passed on to the
|
||||
@racket[vertical-inset] is not @racket[5], it is passed on to the
|
||||
@method[editor-canvas% vertical-inset] method.
|
||||
|
||||
@WindowKWs[@scheme[enabled]] @SubareaKWs[] @AreaKWs[]
|
||||
@WindowKWs[@racket[enabled]] @SubareaKWs[] @AreaKWs[]
|
||||
|
||||
}
|
||||
|
||||
|
@ -162,7 +162,7 @@ Enables or disables force-focus mode. In force-focus mode, the caret
|
|||
@defmethod[(get-editor)
|
||||
(or/c (or/c (is-a?/c text%) (is-a?/c pasteboard%)) false/c)]{
|
||||
|
||||
Returns the editor currently displayed by this canvas, or @scheme[#f]
|
||||
Returns the editor currently displayed by this canvas, or @racket[#f]
|
||||
if the canvas does not have an editor.
|
||||
|
||||
}
|
||||
|
@ -172,7 +172,7 @@ Returns the editor currently displayed by this canvas, or @scheme[#f]
|
|||
(or/c (integer-in 1 1000) false/c)]{
|
||||
|
||||
Returns a line count installed with @method[editor-canvas%
|
||||
set-line-count], or @scheme[#f] if no minimum line count is set.
|
||||
set-line-count], or @racket[#f] if no minimum line count is set.
|
||||
|
||||
}
|
||||
|
||||
|
@ -182,7 +182,7 @@ Returns a line count installed with @method[editor-canvas%
|
|||
void?])]{
|
||||
|
||||
Gets or sets the number of pixels within the canvas reserved to
|
||||
the left and right of editor content. The default is @scheme[5].
|
||||
the left and right of editor content. The default is @racket[5].
|
||||
|
||||
}
|
||||
|
||||
|
@ -196,7 +196,7 @@ Enables or disables lazy-refresh mode, or gets the current enable
|
|||
state. In lazy-refresh mode, the canvas's @method[window<%> refresh]
|
||||
method is called when the window needs to be updated, rather than
|
||||
@method[editor-canvas% on-paint]. By default, an
|
||||
@scheme[editor-canvas%] object is @italic{not} in lazy-refresh mode.
|
||||
@racket[editor-canvas%] object is @italic{not} in lazy-refresh mode.
|
||||
|
||||
}
|
||||
|
||||
|
@ -205,7 +205,7 @@ Enables or disables lazy-refresh mode, or gets the current enable
|
|||
(on-char [event (is-a?/c key-event%)])
|
||||
void?]{
|
||||
|
||||
Handles @scheme['wheel-up] and @scheme['wheel-down] events by
|
||||
Handles @racket['wheel-up] and @racket['wheel-down] events by
|
||||
scrolling vertically. Otherwise, passes the event to the canvas's
|
||||
editor, if any, by calling its @method[editor<%> on-char] method.
|
||||
|
||||
|
@ -242,10 +242,10 @@ Repaints the editor, or clears the canvas if no editor is being
|
|||
displayed.
|
||||
|
||||
This method is called after clearing the margin around the editor,
|
||||
unless the canvas is created with the @scheme['transparent] style, but
|
||||
unless the canvas is created with the @racket['transparent] style, but
|
||||
the editor area is not automatically cleared. In other words,
|
||||
@scheme[editor-canvas%] update by default is like @scheme[canvas%]
|
||||
update with the @scheme['no-autoclear] style, except that the margin
|
||||
@racket[editor-canvas%] update by default is like @racket[canvas%]
|
||||
update with the @racket['no-autoclear] style, except that the margin
|
||||
around the editor area is always cleared.
|
||||
|
||||
}
|
||||
|
@ -271,27 +271,27 @@ on-display-size] method is called.
|
|||
Requests scrolling so that the given region in the currently displayed
|
||||
editor is made visible.
|
||||
|
||||
The @scheme[localx], @scheme[localy], @scheme[w], and @scheme[h] arguments specify
|
||||
The @racket[localx], @racket[localy], @racket[w], and @racket[h] arguments specify
|
||||
a region of the editor to be made visible by the scroll (in editor
|
||||
coordinates).
|
||||
|
||||
If @scheme[refresh?] is not @scheme[#f], then the editor is updated
|
||||
If @racket[refresh?] is not @racket[#f], then the editor is updated
|
||||
immediately after a successful scroll.
|
||||
|
||||
The @scheme[bias] argument is one of:
|
||||
The @racket[bias] argument is one of:
|
||||
@itemize[
|
||||
|
||||
@item{@scheme['start] --- if the range doesn't fit in the visible
|
||||
@item{@racket['start] --- if the range doesn't fit in the visible
|
||||
area, show the top-left region}
|
||||
|
||||
@item{@scheme['none] --- no special scrolling instructions}
|
||||
@item{@racket['none] --- no special scrolling instructions}
|
||||
|
||||
@item{@scheme['end] --- if the range doesn't fit in the visible area,
|
||||
@item{@racket['end] --- if the range doesn't fit in the visible area,
|
||||
show the bottom-right region}
|
||||
|
||||
]
|
||||
|
||||
The return value is @scheme[#t] if the @techlink{display} is scrolled, @scheme[#f]
|
||||
The return value is @racket[#t] if the @techlink{display} is scrolled, @racket[#f]
|
||||
if not (either because the requested region is already visible,
|
||||
because the @techlink{display} has zero size, or because the editor is currently
|
||||
printing).
|
||||
|
@ -324,10 +324,10 @@ Enables or disables bottom-base scrolling, or gets the current enable
|
|||
|
||||
Sets the editor that is displayed by the canvas, releasing the current
|
||||
editor (if any). If the new editor already has an administrator that
|
||||
is not associated with an @scheme[editor-canvas%], then the new
|
||||
is not associated with an @racket[editor-canvas%], then the new
|
||||
editor is @italic{not} installed into the canvas.
|
||||
|
||||
If @scheme[redraw?] is @scheme[#f], then the editor is not immediately
|
||||
If @racket[redraw?] is @racket[#f], then the editor is not immediately
|
||||
drawn; in this case, something must force a redraw later (e.g., a
|
||||
call to the @method[editor-canvas% on-paint] method).
|
||||
|
||||
|
@ -347,7 +347,7 @@ Sets the canvas's graphical minimum height to display a particular
|
|||
an editor. When the canvas's editor is changed, the minimum height is
|
||||
recalculated.
|
||||
|
||||
If the line count is set to @scheme[#f], then the canvas's graphical
|
||||
If the line count is set to @racket[#f], then the canvas's graphical
|
||||
minimum height is restored to its original value.
|
||||
|
||||
}
|
||||
|
@ -359,7 +359,7 @@ If the line count is set to @scheme[#f], then the canvas's graphical
|
|||
void?])]{
|
||||
|
||||
Gets or sets the number of pixels within the canvas reserved above
|
||||
and below editor content. The default is @scheme[5].
|
||||
and below editor content. The default is @racket[5].
|
||||
|
||||
}
|
||||
|
||||
|
@ -370,8 +370,8 @@ Gets or sets the number of pixels within the canvas reserved above
|
|||
void?])]{
|
||||
|
||||
Gets or sets the number of vertical scroll steps taken for one click
|
||||
of the mouse wheel via a @scheme['wheel-up] or @scheme['wheel-down]
|
||||
@scheme[key-event%]. A @scheme[#f] value disables special handling
|
||||
of the mouse wheel via a @racket['wheel-up] or @racket['wheel-down]
|
||||
@racket[key-event%]. A @racket[#f] value disables special handling
|
||||
for wheel events (i.e., wheel events are passed on to the canvas's
|
||||
editor).
|
||||
|
||||
|
|
|
@ -3,9 +3,8 @@
|
|||
|
||||
@defclass/title[editor-data-class% object% ()]{
|
||||
|
||||
An @scheme[editor-data-class%] object defines a type for
|
||||
@scheme[editor-data%] objects. See also @|editordatadiscuss|.
|
||||
|
||||
An @racket[editor-data-class%] object defines a type for
|
||||
@racket[editor-data%] objects. See also @|editordatadiscuss|.
|
||||
|
||||
|
||||
@defconstructor[()]{
|
||||
|
@ -25,7 +24,7 @@ internal use.
|
|||
@defmethod[(read [f (is-a?/c editor-stream-in%)])
|
||||
(or/c (is-a?/c editor-data%) false/c)]{
|
||||
|
||||
Reads a new data object from the given stream, returning @scheme[#f] if
|
||||
Reads a new data object from the given stream, returning @racket[#f] if
|
||||
there is an error.
|
||||
|
||||
}
|
||||
|
@ -36,7 +35,7 @@ Reads a new data object from the given stream, returning @scheme[#f] if
|
|||
Sets the name of the class. Names starting with @litchar{wx} are
|
||||
reserved for internal use.
|
||||
|
||||
An editor data class name should usually have the form @scheme["(lib
|
||||
An editor data class name should usually have the form @racket["(lib
|
||||
...)"] to enable on-demand loading of the class; see
|
||||
@|editordatadiscuss| for details.
|
||||
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
@definterface/title[editor-data-class-list<%> ()]{
|
||||
|
||||
Each eventspace has an instance of @scheme[editor-data-class-list<%>],
|
||||
obtained with @scheme[(get-the-editor-data-class-list)]. New
|
||||
Each eventspace has an instance of @racket[editor-data-class-list<%>],
|
||||
obtained with @racket[(get-the-editor-data-class-list)]. New
|
||||
instances cannot be created directly. This list keeps a list of
|
||||
editor data classes; this list is needed for loading snips from a
|
||||
file. See also @|editordatadiscuss|.
|
||||
|
@ -20,7 +20,7 @@ exists in the list, this one will not be added.
|
|||
@defmethod[(find [name string?])
|
||||
(or/c (is-a?/c snip-class%) false/c)]{
|
||||
Finds a snip data class from the list with the given name, returning
|
||||
@scheme[#f] if none can be found.
|
||||
@racket[#f] if none can be found.
|
||||
|
||||
}
|
||||
|
||||
|
@ -32,8 +32,8 @@ Returns an index into the list for the specified class.
|
|||
|
||||
@defmethod[(nth [n exact-nonnegative-integer?])
|
||||
(or/c (is-a?/c editor-data-class%) false/c)]{
|
||||
Returns the @scheme[n]th class in the list (counting from 0), returning
|
||||
@scheme[#f] if the list has @scheme[n] or less classes.
|
||||
Returns the @racket[n]th class in the list (counting from 0), returning
|
||||
@racket[#f] if the list has @racket[n] or less classes.
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
@defclass/title[editor-data% object% ()]{
|
||||
|
||||
An @scheme[editor-data%] object contains extra data associated to a
|
||||
An @racket[editor-data%] object contains extra data associated to a
|
||||
snip or region in an editor. See also @|editordatadiscuss|.
|
||||
|
||||
|
||||
|
@ -11,7 +11,7 @@ snip or region in an editor. See also @|editordatadiscuss|.
|
|||
@defconstructor[()]{
|
||||
|
||||
The element returned by @method[editor-data% get-next] is initialized
|
||||
to @scheme[#f].
|
||||
to @racket[#f].
|
||||
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ Gets the class for this data.
|
|||
@defmethod[(get-next)
|
||||
(or/c (is-a?/c editor-data%) false/c)]{
|
||||
Gets the next editor data element in a list of editor data elements.
|
||||
A @scheme[#f] terminates the list.
|
||||
A @racket[#f] terminates the list.
|
||||
}
|
||||
|
||||
@defmethod[(set-dataclass [v (is-a?/c editor-data-class%)])
|
||||
|
@ -32,20 +32,20 @@ A @scheme[#f] terminates the list.
|
|||
|
||||
@defmethod[(set-next [v (or/c (is-a?/c editor-data%) false/c)])
|
||||
void?]{Sets the next editor data element in a list of editor data elements.
|
||||
A @scheme[#f] terminates the list.
|
||||
A @racket[#f] terminates the list.
|
||||
}
|
||||
|
||||
@defmethod[(write [f (is-a?/c editor-stream-out%)])
|
||||
boolean?]{
|
||||
@methspec{
|
||||
|
||||
Writes the data to the specified stream, returning @scheme[#t] if data
|
||||
is written successfully or @scheme[#f] otherwise.
|
||||
Writes the data to the specified stream, returning @racket[#t] if data
|
||||
is written successfully or @racket[#f] otherwise.
|
||||
|
||||
}
|
||||
@methimpl{
|
||||
|
||||
Returns @scheme[#f].
|
||||
Returns @racket[#f].
|
||||
|
||||
}}}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -28,10 +28,10 @@ Both kinds of applications need an extensible editor that can handle
|
|||
|
||||
@itemize[
|
||||
|
||||
@item{@scheme[text%] --- in a @deftech{text editor}, items are
|
||||
@item{@racket[text%] --- in a @deftech{text editor}, items are
|
||||
automatically positioned in a paragraph flow.}
|
||||
|
||||
@item{@scheme[pasteboard%] --- in a @deftech{pasteboard editor},
|
||||
@item{@racket[pasteboard%] --- in a @deftech{pasteboard editor},
|
||||
items are explicitly positioned and dragable.}
|
||||
|
||||
]
|
||||
|
@ -47,10 +47,10 @@ This editor architecture addresses the full range of real-world
|
|||
and the learning investment required to use it.
|
||||
|
||||
A brief example illustrates how editors work. To start, an editor
|
||||
needs an @scheme[editor-canvas%] to display its contents. Then, we
|
||||
needs an @racket[editor-canvas%] to display its contents. Then, we
|
||||
can create a text editor and install it into the canvas:
|
||||
|
||||
@schemeblock[
|
||||
@racketblock[
|
||||
(define f (new frame% [label "Simple Edit"]
|
||||
[width 200]
|
||||
[height 200]))
|
||||
|
@ -65,7 +65,7 @@ At this point, the editor is fully functional: the user can type text
|
|||
can support all of the standard operations on an editor via the
|
||||
menu bar:
|
||||
|
||||
@schemeblock[
|
||||
@racketblock[
|
||||
(define mb (new menu-bar% [parent f]))
|
||||
(define m-edit (new menu% [label "Edit"] [parent mb]))
|
||||
(define m-font (new menu% [label "Font"] [parent mb]))
|
||||
|
@ -89,7 +89,7 @@ The content of an editor is made up of @defterm{@tech{snips}}. An
|
|||
on the same line. The @method[text% find-snip] method extracts a snip
|
||||
from a text editor:
|
||||
|
||||
@schemeblock[
|
||||
@racketblock[
|
||||
(send t #,(:: text% find-snip) 0 'after)
|
||||
]
|
||||
|
||||
|
@ -101,7 +101,7 @@ An editor is not permanently attached to any display. We can take the
|
|||
text editor out of our canvas and put a pasteboard editor in the
|
||||
canvas, instead:
|
||||
|
||||
@schemeblock[
|
||||
@racketblock[
|
||||
(define pb (new pasteboard%))
|
||||
(send c #,(:: editor-canvas% set-editor) pb)
|
||||
]
|
||||
|
@ -118,34 +118,34 @@ We can insert the old text editor (which we recently removed from the
|
|||
canvas) as an embedded editor in the pasteboard by explicitly
|
||||
creating an editor snip:
|
||||
|
||||
@schemeblock[
|
||||
(define s (make-object editor-snip% t)) (code:comment @#,t{@scheme[t] is the old text editor})
|
||||
@racketblock[
|
||||
(define s (make-object editor-snip% t)) (code:comment @#,t{@racket[t] is the old text editor})
|
||||
(send pb #,(:: editor<%> insert) s)
|
||||
]
|
||||
|
||||
An individual snip cannot be inserted into different editors at the
|
||||
same time, or inserted multiple times in the same editor:
|
||||
|
||||
@schemeblock[
|
||||
@racketblock[
|
||||
(send pb #,(:: editor<%> insert) s) (code:comment @#,t{no effect})
|
||||
]
|
||||
|
||||
However, we can make a deep copy of the snip and insert the copy into
|
||||
the pasteboard:
|
||||
|
||||
@schemeblock[
|
||||
@racketblock[
|
||||
(send pb #,(:: editor<%> insert) (send s #,(:: snip% copy)))
|
||||
]
|
||||
|
||||
Applications that use the editor classes typically derive new versions
|
||||
of the @scheme[text%] and @scheme[pasteboard%] classes. For
|
||||
of the @racket[text%] and @racket[pasteboard%] classes. For
|
||||
example, to implement an append-only editor (which allows insertions
|
||||
only at the end and never allows deletions), derive a new class from
|
||||
@scheme[text%] and override the
|
||||
@racket[text%] and override the
|
||||
@method[text% can-insert?] and
|
||||
@method[text% can-delete?] methods:
|
||||
|
||||
@schemeblock[
|
||||
@racketblock[
|
||||
(define append-only-text%
|
||||
(class text%
|
||||
(inherit #,(:: text% last-position))
|
||||
|
@ -163,23 +163,23 @@ The editor toolbox supports extensible and nestable editors by
|
|||
|
||||
@item{The @deftech{editor} itself stores the state of the text or
|
||||
pasteboard and handles most events and editing operations. The
|
||||
@scheme[editor<%>] interface defines the core editor functionality,
|
||||
but editors are created as instances of @scheme[text%] or
|
||||
@scheme[pasteboard%].}
|
||||
@racket[editor<%>] interface defines the core editor functionality,
|
||||
but editors are created as instances of @racket[text%] or
|
||||
@racket[pasteboard%].}
|
||||
|
||||
@item{A @deftech{snip} is a segment of information within the
|
||||
editor. Each snip can contain a sequence of characters, a picture,
|
||||
or an interactive object (such as an embedded editor). In a text
|
||||
editor, snips are constrained to fit on a single line and generally
|
||||
contain data of a single type. The @scheme[snip%] class implements a
|
||||
basic snip. Other snip classes include @scheme[string-snip%] for
|
||||
managing text, @scheme[image-snip%] for managing pictures, and
|
||||
@scheme[editor-snip%] for managing embedded editors.}
|
||||
contain data of a single type. The @racket[snip%] class implements a
|
||||
basic snip. Other snip classes include @racket[string-snip%] for
|
||||
managing text, @racket[image-snip%] for managing pictures, and
|
||||
@racket[editor-snip%] for managing embedded editors.}
|
||||
|
||||
@item{A @deftech{display} presents the editor on the screen. The
|
||||
display lets the user scroll around an editor or change editors. Most
|
||||
displays are instances of the @scheme[editor-canvas%] class, but the
|
||||
@scheme[editor-snip%] class also acts as a display for embedded
|
||||
displays are instances of the @racket[editor-canvas%] class, but the
|
||||
@racket[editor-snip%] class also acts as a display for embedded
|
||||
editors.}
|
||||
|
||||
]
|
||||
|
@ -226,16 +226,16 @@ When an editor is drawn into a display, each snip and position has a
|
|||
Two extra layers of administration manage the @techlink{display}-editor and
|
||||
editor-snip connections. An editor never communicates directly with
|
||||
a @techlink{display}; instead, it always communicates with an @deftech{editor
|
||||
administrator}, an instance of the @scheme[editor-admin%] class,
|
||||
administrator}, an instance of the @racket[editor-admin%] class,
|
||||
which relays information to the @techlink{display}. Similarly, a snip
|
||||
communicates with a @deftech{snip administrator}, an instance of the
|
||||
@scheme[snip-admin%] class.
|
||||
@racket[snip-admin%] class.
|
||||
|
||||
The administrative layers make the editor hierarchy flexible without
|
||||
forcing every part of an editor assembly to contain the functionality
|
||||
of several parts. For example, a text editor can be a single
|
||||
@techlink{item} within another editor; without administrators, the
|
||||
@scheme[text%] class would also have to contain all the functionality
|
||||
@racket[text%] class would also have to contain all the functionality
|
||||
of a @techlink{display} (for the containing editor) and a snip (for
|
||||
the embedded editor). Using administrators, an editor class can serve
|
||||
as both a containing and an embedded editor without directly
|
||||
|
@ -246,9 +246,9 @@ A snip belongs to at most one editor via a single administrator. An
|
|||
administrator that connects the an editor to the standard
|
||||
@techlink{display} (i.e., an editor canvas) can work with other such
|
||||
administrators. In particular, the administrator of an
|
||||
@scheme[editor-canvas%] (each one has its own administrator) can work
|
||||
with other @scheme[editor-canvas%] administrators, allowing an editor
|
||||
to be displayed in multiple @scheme[editor-canvas%] windows at the
|
||||
@racket[editor-canvas%] (each one has its own administrator) can work
|
||||
with other @racket[editor-canvas%] administrators, allowing an editor
|
||||
to be displayed in multiple @racket[editor-canvas%] windows at the
|
||||
same time.
|
||||
|
||||
When an editor is displayed by multiple canvases, one of the canvases'
|
||||
|
@ -261,15 +261,15 @@ When an editor is displayed by multiple canvases, one of the canvases'
|
|||
|
||||
@subsection[#:tag "editorstyles"]{Styles}
|
||||
|
||||
A @deftech{style}, an instance of the @scheme[style<%>] interface,
|
||||
A @deftech{style}, an instance of the @racket[style<%>] interface,
|
||||
parameterizes high-level display information that is common to all
|
||||
snip classes. This includes the font, color, and alignment for
|
||||
drawing the item. A single style is attached to each snip.
|
||||
|
||||
Styles are hierarchical: each style is defined in terms of another
|
||||
style. @index*['("Basic style") (list @elem{@scheme["Basic"]
|
||||
style. @index*['("Basic style") (list @elem{@racket["Basic"]
|
||||
style})]{There} is a single @deftech{root style}, named
|
||||
@scheme["Basic"], from which all other styles in an editor are
|
||||
@racket["Basic"], from which all other styles in an editor are
|
||||
derived. The difference between a base style and each of its derived
|
||||
style is encoded in a @deftech{style delta} (or simply
|
||||
@deftech{delta}). A delta encodes changes such as
|
||||
|
@ -288,10 +288,10 @@ Styles are hierarchical: each style is defined in terms of another
|
|||
|
||||
Style objects are never created separately; rather, they are always
|
||||
created through a @deftech{style list}, an instance of the
|
||||
@scheme[style-list%] class. A style list manages the styles,
|
||||
@racket[style-list%] class. A style list manages the styles,
|
||||
servicing external requests to find a particular style, and it
|
||||
manages the hierarchical relationship between styles. A global style
|
||||
list is available, @indexed-scheme[the-style-list], but new style
|
||||
list is available, @indexed-racket[the-style-list], but new style
|
||||
lists can be created for managing separate style hierarchies. For
|
||||
example, each editor will typically have its own style list.
|
||||
|
||||
|
@ -318,11 +318,11 @@ Each new style is defined in one of two ways:
|
|||
|
||||
]
|
||||
|
||||
@index*['("Standard style") (list @elem{@scheme["Standard"]
|
||||
@index*['("Standard style") (list @elem{@racket["Standard"]
|
||||
style})]{Usually}, when text is inserted into a text editor, it
|
||||
inherits the style of the preceding snip. If text is inserted into an
|
||||
empty editor, the text is usually assigned a style called
|
||||
@scheme["Standard"]. By default, the @scheme["Standard"] style is
|
||||
@racket["Standard"]. By default, the @racket["Standard"] style is
|
||||
unmodified from the root style. The default style name can be changed
|
||||
by overriding @method[editor<%> default-style-name].
|
||||
|
||||
|
@ -347,20 +347,20 @@ To allow editor content to be saved to a file, the editor classes
|
|||
define the format internally. The file format is the same for text
|
||||
and pasteboard editors. When a pasteboard saves its content to a
|
||||
file, it saves the snips from front to back, and also includes extra
|
||||
location information. The @schememodname[wxme] library provides
|
||||
location information. The @racketmodname[wxme] library provides
|
||||
utilities for manipulating WXME files.
|
||||
|
||||
Editor data is read and written using @scheme[editor-stream-in%] and
|
||||
@scheme[editor-stream-out%] objects. Editor information can only be
|
||||
Editor data is read and written using @racket[editor-stream-in%] and
|
||||
@racket[editor-stream-out%] objects. Editor information can only be
|
||||
read from or written to one stream at a time. To write one or more
|
||||
editors to a stream, first call the function
|
||||
@scheme[write-editor-global-header] to write initialization data into
|
||||
@racket[write-editor-global-header] to write initialization data into
|
||||
an output stream. When all editors are written to the stream, call
|
||||
@scheme[write-editor-global-footer]. Similarly, reading editors from
|
||||
a stream is initialized with @scheme[read-editor-global-header] and
|
||||
finalized with @scheme[read-editor-global-footer]. Optionally, to
|
||||
@racket[write-editor-global-footer]. Similarly, reading editors from
|
||||
a stream is initialized with @racket[read-editor-global-header] and
|
||||
finalized with @racket[read-editor-global-footer]. Optionally, to
|
||||
support streams that span versions of Racket, use
|
||||
@scheme[write-editor-version] and @scheme[read-editor-version] before
|
||||
@racket[write-editor-version] and @racket[read-editor-version] before
|
||||
the header operations.
|
||||
|
||||
The editor file data format can be embedded within another file, and
|
||||
|
@ -390,7 +390,7 @@ Graceful and extensible encoding of snips requires that
|
|||
provided for each type of snip. Furthermore, a list of such decoders
|
||||
must be available to the high-level decoding process. This decoding
|
||||
mapping is defined by associating a @deftech{snip class} object to
|
||||
every snip. A snip class is an instance of the @scheme[snip-class%]
|
||||
every snip. A snip class is an instance of the @racket[snip-class%]
|
||||
class.}
|
||||
|
||||
@item{Some editors may require additional information to be stored
|
||||
|
@ -402,9 +402,9 @@ Graceful and extensible encoding of snips requires that
|
|||
@techlink{location}s needs to be maintained, but this information
|
||||
should not inhibit pasting into an editor. Extra data is associated
|
||||
with a snip through @deftech{editor data} objects, which are
|
||||
instances of the @scheme[editor-data%] class; decoding requires that
|
||||
instances of the @racket[editor-data%] class; decoding requires that
|
||||
each editor data object has an @deftech{editor data class}, which is
|
||||
an instance of the @scheme[editor-data-class%] class.}
|
||||
an instance of the @racket[editor-data-class%] class.}
|
||||
|
||||
]
|
||||
|
||||
|
@ -422,7 +422,7 @@ Each snip can be associated to a @tech{snip class}. This ``class''
|
|||
|
||||
Snip class objects can be added to the eventspace-specific
|
||||
@deftech{snip class list}, which is returned by
|
||||
@scheme[get-the-snip-class-list]. When a snip is encoded, the snip's
|
||||
@racket[get-the-snip-class-list]. When a snip is encoded, the snip's
|
||||
class name is associated with the encoding; when the snip needs to be
|
||||
decoded, then the snip class list is searched by name to find the
|
||||
snip's class. The snip class will then provide a decoding function
|
||||
|
@ -430,24 +430,24 @@ Snip class objects can be added to the eventspace-specific
|
|||
|
||||
If a snip class's name is of the form
|
||||
@;-
|
||||
@scheme["((lib ...) (lib ...))"],
|
||||
@racket["((lib ...) (lib ...))"],
|
||||
@;-
|
||||
then the snip class implementation can be loaded on
|
||||
demand. The name is parsed using @scheme[read]; if the result has the
|
||||
form @scheme[((lib _string ...) (lib _string ...))], then the first
|
||||
element used with @scheme[dynamic-require] along with
|
||||
@scheme['snip-class]. If the @scheme[dynamic-require] result is a
|
||||
@scheme[snip-class%] object, then it is inserted into the current
|
||||
demand. The name is parsed using @racket[read]; if the result has the
|
||||
form @racket[((lib _string ...) (lib _string ...))], then the first
|
||||
element used with @racket[dynamic-require] along with
|
||||
@racket['snip-class]. If the @racket[dynamic-require] result is a
|
||||
@racket[snip-class%] object, then it is inserted into the current
|
||||
eventspace's snip class list, and loading or saving continues using
|
||||
the new class.
|
||||
|
||||
The second @scheme[lib] form in @scheme["((lib ...) (lib ...))"]
|
||||
The second @racket[lib] form in @racket["((lib ...) (lib ...))"]
|
||||
supplies a reader for a text-only version of the snip. See
|
||||
@schememodname[wxme] for more information.
|
||||
@racketmodname[wxme] for more information.
|
||||
|
||||
A snip class's name can also be just @scheme["(lib ...)"], which is
|
||||
used like the first part of the two-@scheme[lib] form. However, this
|
||||
form provides no information for the text-only @schememodname[wxme]
|
||||
A snip class's name can also be just @racket["(lib ...)"], which is
|
||||
used like the first part of the two-@racket[lib] form. However, this
|
||||
form provides no information for the text-only @racketmodname[wxme]
|
||||
reader.
|
||||
|
||||
@subsubsection[#:tag "editordata"]{Editor Data}
|
||||
|
@ -463,21 +463,21 @@ Just as a snip must be associated with a snip class to be decoded (see
|
|||
@|snipclassdiscuss|), an editor data object needs an @tech{editor
|
||||
data class} for decoding. Every editor data class object can be added
|
||||
to the eventspace-specific @deftech{editor data class list}, returned
|
||||
by @scheme[get-the-editor-data-class-list]. Alternatively, like snip
|
||||
by @racket[get-the-editor-data-class-list]. Alternatively, like snip
|
||||
classes (see @secref["editorsnipclasses"]), editor data class names
|
||||
can use the form @scheme["((lib ...) (lib ...))"] to enable
|
||||
can use the form @racket["((lib ...) (lib ...))"] to enable
|
||||
on-demand loading. The corresponding module should export an
|
||||
@scheme[editor-data-class%] object named @scheme['editor-data-class].
|
||||
@racket[editor-data-class%] object named @racket['editor-data-class].
|
||||
|
||||
To store and load information about a snip or region in an editor:
|
||||
|
||||
@itemize[
|
||||
|
||||
@item{derive new classes from @scheme[editor-data%] and
|
||||
@scheme[editor-data-class%].}
|
||||
@item{derive new classes from @racket[editor-data%] and
|
||||
@racket[editor-data-class%].}
|
||||
|
||||
@item{derive a new class from the @scheme[text%] or
|
||||
@scheme[pasteboard%] class, and override the @method[editor<%>
|
||||
@item{derive a new class from the @racket[text%] or
|
||||
@racket[pasteboard%] class, and override the @method[editor<%>
|
||||
get-snip-data] and @method[editor<%> set-snip-data] methods and/or the
|
||||
@method[text% get-region-data] and @method[text% set-region-data]
|
||||
methods.
|
||||
|
@ -487,7 +487,7 @@ To store and load information about a snip or region in an editor:
|
|||
not for file-saving encoding; see @|globaleditordatadiscuss| for
|
||||
information on extending the file format.}
|
||||
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
@subsection[#:tag "globaleditordata"]{Global Data: Headers and Footers}
|
||||
|
@ -505,8 +505,8 @@ The editor file format provides for adding extra global data in
|
|||
with a unique name, the file can be safely loaded in an installation that
|
||||
does not support the records.}
|
||||
|
||||
@item{Derive a new class from the @scheme[text%] or
|
||||
@scheme[pasteboard%] class, and override the @method[editor<%>
|
||||
@item{Derive a new class from the @racket[text%] or
|
||||
@racket[pasteboard%] class, and override the @method[editor<%>
|
||||
write-headers-to-file], @method[editor<%> write-footers-to-file],
|
||||
@method[editor<%> read-header-from-file] and/or @method[editor<%>
|
||||
read-footer-from-file] methods.}
|
||||
|
@ -515,8 +515,8 @@ The editor file format provides for adding extra global data in
|
|||
|
||||
When an editor is saved, the methods @method[editor<%>
|
||||
write-headers-to-file] and @method[editor<%> write-footers-to-file]
|
||||
are invoked; at this time, the derived @scheme[text%] or
|
||||
@scheme[pasteboard%] object has a chance to save records. To write a
|
||||
are invoked; at this time, the derived @racket[text%] or
|
||||
@racket[pasteboard%] object has a chance to save records. To write a
|
||||
header/footer record, first invoke the @method[editor<%>
|
||||
begin-write-header-footer-to-file] method, at which point the record
|
||||
name is provided. Once the record is written, call @method[editor<%>
|
||||
|
@ -548,16 +548,16 @@ For this reason, @techlink{position}-setting and
|
|||
the case of a @techlink{position}-setting method, the argument
|
||||
specifies whether the caret should be drawn at the left or right side
|
||||
of the page (in the event that the @techlink{location} is doubly
|
||||
defined); @scheme[#t] means that the caret should be drawn on the
|
||||
defined); @racket[#t] means that the caret should be drawn on the
|
||||
right side. Similarly, methods which calculate a @techlink{position}
|
||||
from a @techlink{location} will take an extra boxed boolean; the box
|
||||
is filled with @scheme[#t] if the position is ambiguous and it came
|
||||
from a right-side location, or @scheme[#f] otherwise.
|
||||
is filled with @racket[#t] if the position is ambiguous and it came
|
||||
from a right-side location, or @racket[#f] otherwise.
|
||||
|
||||
@section[#:tag "editorflattened"]{Flattened Text}
|
||||
|
||||
In plain text editors, there is a simple correlation between
|
||||
@techlink{position}s and characters. In an @scheme[editor<%>] object,
|
||||
@techlink{position}s and characters. In an @racket[editor<%>] object,
|
||||
this is not true much of the time, but it is still sometimes useful
|
||||
to just ``get the text'' of an editor.
|
||||
|
||||
|
@ -605,14 +605,14 @@ When an editor or snip is drawn, an argument to the drawing method
|
|||
|
||||
@itemize[
|
||||
|
||||
@item{@indexed-scheme['no-caret] --- The caret should not be drawn at
|
||||
@item{@indexed-racket['no-caret] --- The caret should not be drawn at
|
||||
all.}
|
||||
|
||||
@item{@indexed-scheme['show-inactive-caret] --- The caret should be drawn
|
||||
@item{@indexed-racket['show-inactive-caret] --- The caret should be drawn
|
||||
as inactive; items may be identified as the local current selection,
|
||||
but the keyboard focus is elsewhere.}
|
||||
|
||||
@item{@indexed-scheme['show-caret] --- The caret should be drawn to show
|
||||
@item{@indexed-racket['show-caret] --- The caret should be drawn to show
|
||||
keyboard focus ownership.}
|
||||
|
||||
@item{@racket[(cons _start _end)] --- The caret is owned by an
|
||||
|
@ -622,24 +622,24 @@ When an editor or snip is drawn, an argument to the drawing method
|
|||
|
||||
]
|
||||
|
||||
The @scheme['show-inactive-caret] display mode is useful for showing
|
||||
The @racket['show-inactive-caret] display mode is useful for showing
|
||||
selection ranges in text editors that do not have the focus. This
|
||||
@scheme['show-inactive-caret] mode is distinct from @scheme['no-caret]
|
||||
@racket['show-inactive-caret] mode is distinct from @racket['no-caret]
|
||||
mode; when editors are embedded, only the locally active editor shows
|
||||
its selection.
|
||||
|
||||
|
||||
@section[#:tag "editorcutandpastetime"]{Cut and Paste Time Stamps}
|
||||
|
||||
Methods of @scheme[editor<%>] that use the clipboard --- including
|
||||
Methods of @racket[editor<%>] that use the clipboard --- including
|
||||
@method[editor<%> copy], @method[editor<%> cut], @method[editor<%>
|
||||
paste], and @method[editor<%> do-edit-operation] --- consume a time
|
||||
stamp argument. This time stamp is generally extracted from the
|
||||
@scheme[mouse-event%] or @scheme[key-event%] object that triggered
|
||||
@racket[mouse-event%] or @racket[key-event%] object that triggered
|
||||
the clipboard action. Unix uses the time stamp to synchronize clipboard
|
||||
operations among the clipboard clients.
|
||||
|
||||
All instances of @scheme[event%] include a time stamp, which can be
|
||||
All instances of @racket[event%] include a time stamp, which can be
|
||||
obtained using @method[event% get-time-stamp].
|
||||
|
||||
If the time stamp is 0, it defaults to the current time. Using 0 as the
|
||||
|
@ -649,7 +649,7 @@ If the time stamp is 0, it defaults to the current time. Using 0 as the
|
|||
|
||||
@section[#:tag "editorclickback"]{Clickbacks}
|
||||
|
||||
@deftech{Clickbacks} in a @scheme[text%] editor facilitate the
|
||||
@deftech{Clickbacks} in a @racket[text%] editor facilitate the
|
||||
creation of simple interactive objects, such as hypertext. A
|
||||
clickback is defined by associating a callback function with a range
|
||||
of @techlink{item}s in the editor. When a user clicks on the
|
||||
|
@ -669,7 +669,7 @@ Note that there is no attempt to save clickback information when a
|
|||
|
||||
@section[#:tag "lockinfo"]{Internal Editor Locks}
|
||||
|
||||
Instances of @scheme[editor<%>] have three levels of internal
|
||||
Instances of @racket[editor<%>] have three levels of internal
|
||||
locking:
|
||||
|
||||
@itemize[
|
||||
|
@ -754,7 +754,7 @@ An editor supports certain concurrent patterns
|
|||
|
||||
]
|
||||
|
||||
Thus, disabling an @scheme[editor-canvas%] object (using
|
||||
Thus, disabling an @racket[editor-canvas%] object (using
|
||||
@method[window<%> enable]) is sufficient to ensure that a
|
||||
background thread can modify an editor displayed by the canvas, as
|
||||
long as all modifications are in edit sequences. The background
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
@defclass/title[editor-snip% snip% ()]{
|
||||
|
||||
An @scheme[editor-snip%] object is a @scheme[snip%] object that
|
||||
contains and displays an @scheme[editor<%>] object. This snip class
|
||||
An @racket[editor-snip%] object is a @racket[snip%] object that
|
||||
contains and displays an @racket[editor<%>] object. This snip class
|
||||
is used to insert an editor as a single @techlink{item} within
|
||||
another editor.
|
||||
|
||||
|
@ -24,14 +24,14 @@ An @scheme[editor-snip%] object is a @scheme[snip%] object that
|
|||
[min-height (or/c (and/c real? (not/c negative?)) (one-of/c 'none)) 'none]
|
||||
[max-height (or/c (and/c real? (not/c negative?)) (one-of/c 'none)) 'none])]{
|
||||
|
||||
If @scheme[editor] is non-@scheme[#f], then it will be used as the
|
||||
If @racket[editor] is non-@racket[#f], then it will be used as the
|
||||
editor contained by the snip. See also @method[editor-snip%
|
||||
set-editor].
|
||||
|
||||
If @scheme[with-border?] is not @scheme[#f], then a border will be drawn
|
||||
If @racket[with-border?] is not @racket[#f], then a border will be drawn
|
||||
around the snip. The editor display will be inset in the snip area by
|
||||
the amounts specified in the @scheme[-margin] arguments. The border
|
||||
will be drawn with an inset specified by the @scheme[-inset] arguments.
|
||||
the amounts specified in the @racket[-margin] arguments. The border
|
||||
will be drawn with an inset specified by the @racket[-inset] arguments.
|
||||
|
||||
See @method[editor-snip% get-inset] and @method[editor-snip%
|
||||
get-margin] for information about the inset and margin arguments.
|
||||
|
@ -57,8 +57,8 @@ Gets a cursor from the embedded editor by calling its
|
|||
@defmethod[(border-visible?)
|
||||
boolean?]{
|
||||
|
||||
Returns @scheme[#t] if the snip has a border draw around it,
|
||||
@scheme[#f] otherwise.
|
||||
Returns @racket[#t] if the snip has a border draw around it,
|
||||
@racket[#f] otherwise.
|
||||
|
||||
See also @method[editor-snip% show-border].
|
||||
|
||||
|
@ -79,7 +79,7 @@ See also @method[editor-snip% set-align-top-line].
|
|||
@defmethod[(get-editor)
|
||||
(or/c (or/c (is-a?/c text%) (is-a?/c pasteboard%)) false/c)]{
|
||||
|
||||
Returns the editor contained by the snip, or @scheme[#f] is there is
|
||||
Returns the editor contained by the snip, or @racket[#f] is there is
|
||||
no editor.
|
||||
|
||||
}
|
||||
|
@ -107,11 +107,11 @@ The top space always corresponds to the space of the editor's top
|
|||
the descent of the top line, plus the height rest of the editor's
|
||||
lines, plus the snip's bottom margin.
|
||||
|
||||
If the editor is a text editor, then @scheme[1] is normally subtracted
|
||||
If the editor is a text editor, then @racket[1] is normally subtracted
|
||||
from the editor's width as returned by @method[editor<%> get-extent],
|
||||
because the result looks better for editing. If the snip is in
|
||||
tight-text-fit mode (see @method[editor-snip% set-tight-text-fit])
|
||||
then @scheme[2] is subtracted from a text editor's width, eliminating
|
||||
then @racket[2] is subtracted from a text editor's width, eliminating
|
||||
the two pixels that the text editor reserves for the blinking
|
||||
caret. In addition, tight-text-fit mode subtracts an amount equal to
|
||||
the line spacing from the editor's height. By default, tight-text-fit
|
||||
|
@ -158,7 +158,7 @@ snip.
|
|||
@defmethod[(get-max-height)
|
||||
(or/c (and/c real? (not/c negative?)) (one-of/c 'none))]{
|
||||
|
||||
Gets the maximum display height of the snip; zero or @scheme['none]
|
||||
Gets the maximum display height of the snip; zero or @racket['none]
|
||||
indicates that there is no maximum.
|
||||
|
||||
}
|
||||
|
@ -167,7 +167,7 @@ Gets the maximum display height of the snip; zero or @scheme['none]
|
|||
@defmethod[(get-max-width)
|
||||
(or/c (and/c real? (not/c negative?)) (one-of/c 'none))]{
|
||||
|
||||
Gets the maximum display width of the snip; zero or @scheme['none]
|
||||
Gets the maximum display width of the snip; zero or @racket['none]
|
||||
indicates that there is no maximum.
|
||||
|
||||
}
|
||||
|
@ -175,7 +175,7 @@ Gets the maximum display width of the snip; zero or @scheme['none]
|
|||
@defmethod[(get-min-height)
|
||||
(or/c (and/c real? (not/c negative?)) (one-of/c 'none))]{
|
||||
|
||||
Gets the minimum display height of the snip; zero or @scheme['none]
|
||||
Gets the minimum display height of the snip; zero or @racket['none]
|
||||
indicates that there is no minimum.
|
||||
|
||||
}
|
||||
|
@ -183,7 +183,7 @@ Gets the minimum display height of the snip; zero or @scheme['none]
|
|||
@defmethod[(get-min-width)
|
||||
(or/c (and/c real? (not/c negative?)) (one-of/c 'none))]{
|
||||
|
||||
Gets the minimum display width of the snip; zero or @scheme['none]
|
||||
Gets the minimum display width of the snip; zero or @racket['none]
|
||||
indicates that there is no minimum.
|
||||
|
||||
}
|
||||
|
@ -233,14 +233,14 @@ Sets the editor contained by the snip, releasing the old editor in the
|
|||
snip (if any). If the new editor already has an administrator, then
|
||||
the new editor is @italic{not} installed into the snip.
|
||||
|
||||
When an @scheme[editor-snip%] object is not inserted in an editor, it
|
||||
When an @racket[editor-snip%] object is not inserted in an editor, it
|
||||
does not have an administrator. During this time, it does not give
|
||||
its contained editor an administrator, either. The administratorless
|
||||
contained editor can therefore ``defect'' to some other
|
||||
@techlink{display} with an administrator. When a contained editor
|
||||
defects and the snip is eventually inserted into a different editor,
|
||||
the snip drops the traitor contained editor, setting its contained
|
||||
editor to @scheme[#f].
|
||||
editor to @racket[#f].
|
||||
|
||||
}
|
||||
|
||||
|
@ -273,7 +273,7 @@ Sets the current margins for the snip. The margin sets how much space
|
|||
|
||||
@edsnipmax[(scheme height)]
|
||||
|
||||
Zero or @scheme['none] disables the limit.
|
||||
Zero or @racket['none] disables the limit.
|
||||
|
||||
}
|
||||
|
||||
|
@ -283,7 +283,7 @@ Zero or @scheme['none] disables the limit.
|
|||
@edsnipmax[(scheme width)] The contained editor's width limits are not
|
||||
changed by this method.
|
||||
|
||||
Zero or @scheme['none] disables the limit.
|
||||
Zero or @racket['none] disables the limit.
|
||||
|
||||
}
|
||||
|
||||
|
@ -292,7 +292,7 @@ Zero or @scheme['none] disables the limit.
|
|||
|
||||
@edsnipmin[(scheme height) @elem{top}]
|
||||
|
||||
Zero or @scheme['none] disables the limit.
|
||||
Zero or @racket['none] disables the limit.
|
||||
|
||||
}
|
||||
|
||||
|
@ -302,7 +302,7 @@ Zero or @scheme['none] disables the limit.
|
|||
@edsnipmin[(scheme width) @elem{left}] The contained editor's width
|
||||
limits are not changed by this method.
|
||||
|
||||
Zero or @scheme['none] disables the limit.
|
||||
Zero or @racket['none] disables the limit.
|
||||
|
||||
}
|
||||
|
||||
|
@ -327,8 +327,8 @@ Shows or hides the snip's border.
|
|||
@defmethod[(style-background-used?)
|
||||
boolean?]{
|
||||
|
||||
Returns @scheme[#t] if the snip uses its style's background and
|
||||
transparency information when drawing, @scheme[#f] otherwise.
|
||||
Returns @racket[#t] if the snip uses its style's background and
|
||||
transparency information when drawing, @racket[#f] otherwise.
|
||||
|
||||
See also @method[editor-snip% use-style-background].
|
||||
|
||||
|
@ -342,7 +342,7 @@ Causes the snip to use or not used (the default) its style's
|
|||
background and transparency information for drawing the background
|
||||
within the snip's border.
|
||||
|
||||
If @scheme[use?] is @scheme[#f], the style background and transparency
|
||||
If @racket[use?] is @racket[#f], the style background and transparency
|
||||
information is ignored, otherwise is it used.
|
||||
|
||||
}}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
@definterface/title[editor-snip-editor-admin<%> ()]{
|
||||
|
||||
An instance of this administrator interface is created with each
|
||||
@scheme[editor-snip%] object; new instances cannot be
|
||||
@racket[editor-snip%] object; new instances cannot be
|
||||
created directly.
|
||||
|
||||
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
|
||||
@defclass/title[editor-stream-in-base% object% ()]{
|
||||
|
||||
An @scheme[editor-stream-in-base%] object is used by an
|
||||
@scheme[editor-stream-in%] object to perform low-level reading of
|
||||
An @racket[editor-stream-in-base%] object is used by an
|
||||
@racket[editor-stream-in%] object to perform low-level reading of
|
||||
data.
|
||||
|
||||
The @scheme[editor-stream-in-base%] class is never instantiated
|
||||
directly, but the derived class @scheme[editor-stream-in-bytes-base%]
|
||||
The @racket[editor-stream-in-base%] class is never instantiated
|
||||
directly, but the derived class @racket[editor-stream-in-bytes-base%]
|
||||
can be instantiated. New derived classes must override all of the
|
||||
methods described in this section.
|
||||
|
||||
|
@ -16,8 +16,8 @@ The @scheme[editor-stream-in-base%] class is never instantiated
|
|||
@defmethod[(bad?)
|
||||
boolean?]{
|
||||
|
||||
Returns @scheme[#t] if there has been an error reading from the
|
||||
stream, @scheme[#f] otherwise.
|
||||
Returns @racket[#t] if there has been an error reading from the
|
||||
stream, @racket[#f] otherwise.
|
||||
|
||||
}
|
||||
|
||||
|
@ -35,11 +35,11 @@ Reads bytes to fill the supplied byte string. The return value is the
|
|||
number of bytes read, which may be less than the number
|
||||
requested if the stream is emptied. If the stream is emptied, the
|
||||
next call to @method[editor-stream-in-base% bad?] must return
|
||||
@scheme[#t].}
|
||||
@racket[#t].}
|
||||
|
||||
@defmethod[(read-byte) (or/c byte? #f)]{
|
||||
|
||||
Reads a single byte and return it, or returns @scheme[#f] if no more
|
||||
Reads a single byte and return it, or returns @racket[#f] if no more
|
||||
bytes are available. The default implementation of this method uses
|
||||
@method[editor-stream-in-base% read-bytes].
|
||||
|
||||
|
@ -55,7 +55,7 @@ Moves to the specified absolute position in the stream.
|
|||
@defmethod[(skip [n exact-nonnegative-integer?])
|
||||
void?]{
|
||||
|
||||
Skips past the next @scheme[n] characters in the stream.
|
||||
Skips past the next @racket[n] characters in the stream.
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
|
||||
@defclass/title[editor-stream-in-bytes-base% editor-stream-in-base% ()]{
|
||||
|
||||
An @scheme[editor-stream-in-bytes-base%] object can be used to
|
||||
An @racket[editor-stream-in-bytes-base%] object can be used to
|
||||
read editor data from a byte string.
|
||||
|
||||
|
||||
@defconstructor/make[([s bytes?])]{
|
||||
|
||||
Creates a stream base that reads from @scheme[s].
|
||||
Creates a stream base that reads from @racket[s].
|
||||
|
||||
}}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
@defclass/title[editor-stream-in% object% ()]{
|
||||
|
||||
An @scheme[editor-stream-in%] object is used to read editor
|
||||
An @racket[editor-stream-in%] object is used to read editor
|
||||
information from a file or other input stream (such as the
|
||||
clipboard).
|
||||
|
||||
|
@ -11,8 +11,8 @@ An @scheme[editor-stream-in%] object is used to read editor
|
|||
|
||||
@defconstructor/make[([base (is-a?/c editor-stream-in-base%)])]{
|
||||
|
||||
An in-stream base---possibly an @scheme[editor-stream-in-bytes-base%]
|
||||
object---must be supplied in @scheme[base].
|
||||
An in-stream base---possibly an @racket[editor-stream-in-bytes-base%]
|
||||
object---must be supplied in @racket[base].
|
||||
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ An in-stream base---possibly an @scheme[editor-stream-in-bytes-base%]
|
|||
(is-a?/c editor-stream-in%)])]{
|
||||
|
||||
Reads data from the stream, returning itself.
|
||||
Reading from a bad stream always gives @scheme[0].
|
||||
Reading from a bad stream always gives @racket[0].
|
||||
|
||||
@boxisfill[(scheme v) @elem{the next integer or floating-point value in the stream}]
|
||||
|
||||
|
@ -64,7 +64,7 @@ Returns the next integer value in the stream.
|
|||
|
||||
Gets a fixed-sized integer from the stream. See
|
||||
@method[editor-stream-out% put-fixed] for more information.
|
||||
Reading from a bad stream always gives @scheme[0].
|
||||
Reading from a bad stream always gives @racket[0].
|
||||
|
||||
}
|
||||
|
||||
|
@ -84,7 +84,7 @@ use @method[editor-stream-out% put] with two arguments
|
|||
(passing along the length of the bytes) to write out the bytes
|
||||
to match this method.
|
||||
|
||||
Reading from a bad stream returns @scheme[#f] or @scheme[#""].
|
||||
Reading from a bad stream returns @racket[#f] or @racket[#""].
|
||||
|
||||
Note that when @method[editor-stream-out% put] is not given a byte
|
||||
length, it includes an extra byte for a nul terminator; use
|
||||
|
@ -104,8 +104,8 @@ Jumps to a given position in the stream.
|
|||
@defmethod[(ok?)
|
||||
boolean?]{
|
||||
|
||||
Returns @scheme[#t] if the stream is ready for reading, @scheme[#f] otherwise.
|
||||
Reading from a bad stream always returns @scheme[0] or @scheme[""].
|
||||
Returns @racket[#t] if the stream is ready for reading, @racket[#f] otherwise.
|
||||
Reading from a bad stream always returns @racket[0] or @racket[""].
|
||||
|
||||
}
|
||||
|
||||
|
@ -119,7 +119,7 @@ See @method[editor-stream-in% set-boundary].
|
|||
@defmethod[(set-boundary [n exact-nonnegative-integer?])
|
||||
void?]{
|
||||
|
||||
Sets a file-reading boundary at @scheme[n] bytes past the current
|
||||
Sets a file-reading boundary at @racket[n] bytes past the current
|
||||
stream location. If there is an attempt to read past this boundary,
|
||||
an error is signaled. The boundary is removed with a call to
|
||||
@method[editor-stream-in% remove-boundary]. Every call to
|
||||
|
@ -136,7 +136,7 @@ Boundaries help keep a subroutine from reading too much data leading
|
|||
@defmethod[(skip [n exact-nonnegative-integer?])
|
||||
void?]{
|
||||
|
||||
Skips past the next @scheme[n] bytes in the stream.
|
||||
Skips past the next @racket[n] bytes in the stream.
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -3,13 +3,13 @@
|
|||
|
||||
@defclass/title[editor-stream-out-base% object% ()]{
|
||||
|
||||
An @scheme[editor-stream-out-base%] object is used by an
|
||||
@scheme[editor-stream-out%] object to perform low-level writing of
|
||||
An @racket[editor-stream-out-base%] object is used by an
|
||||
@racket[editor-stream-out%] object to perform low-level writing of
|
||||
data.
|
||||
|
||||
The @scheme[editor-stream-out-base%] class is never instantiated
|
||||
The @racket[editor-stream-out-base%] class is never instantiated
|
||||
directly, but the derived class
|
||||
@scheme[editor-stream-out-bytes-base%] can be instantiated. New
|
||||
@racket[editor-stream-out-bytes-base%] can be instantiated. New
|
||||
derived classes must override all of the methods described in this
|
||||
section.
|
||||
|
||||
|
@ -17,8 +17,8 @@ The @scheme[editor-stream-out-base%] class is never instantiated
|
|||
@defmethod[(bad?)
|
||||
boolean?]{
|
||||
|
||||
Returns @scheme[#t] if there has been an error writing to the stream,
|
||||
@scheme[#f] otherwise.
|
||||
Returns @racket[#t] if there has been an error writing to the stream,
|
||||
@racket[#f] otherwise.
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
@defclass/title[editor-stream-out-bytes-base% editor-stream-out-base% ()]{
|
||||
|
||||
An @scheme[editor-stream-out-bytes-base%] object can be used to write
|
||||
An @racket[editor-stream-out-bytes-base%] object can be used to write
|
||||
editor data into a byte string.
|
||||
|
||||
@defconstructor[()]{
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
@defclass/title[editor-stream-out% object% ()]{
|
||||
|
||||
An @scheme[editor-stream-out%] object is used to write editor
|
||||
An @racket[editor-stream-out%] object is used to write editor
|
||||
information to a file or other output stream (such as the
|
||||
clipboard).
|
||||
|
||||
|
@ -12,9 +12,8 @@ An @scheme[editor-stream-out%] object is used to write editor
|
|||
@defconstructor/make[([base (is-a?/c editor-stream-out-base%)])]{
|
||||
|
||||
An out-stream base---possibly an
|
||||
@scheme[editor-stream-out-bytes-base%] object---must be supplied in
|
||||
@scheme[base].
|
||||
|
||||
@racket[editor-stream-out-bytes-base%] object---must be supplied in
|
||||
@racket[base].
|
||||
|
||||
}
|
||||
|
||||
|
@ -26,7 +25,7 @@ Jumps to a given position in the stream.
|
|||
|
||||
@defmethod[(ok?)
|
||||
boolean?]{
|
||||
Returns @scheme[#t] if the stream is ready for writing, @scheme[#f] otherwise.
|
||||
Returns @racket[#t] if the stream is ready for writing, @racket[#f] otherwise.
|
||||
Writing to a bad stream has no effect.
|
||||
|
||||
}
|
||||
|
@ -36,7 +35,7 @@ Writing to a bad stream has no effect.
|
|||
|
||||
Ensures that the stream ends with a newline.
|
||||
This method is called by
|
||||
@scheme[write-editor-global-footer].
|
||||
@racket[write-editor-global-footer].
|
||||
|
||||
}
|
||||
|
||||
|
@ -45,7 +44,7 @@ This method is called by
|
|||
void?]{
|
||||
|
||||
Writes a ``comment'' into the stream that identifies the file format.
|
||||
This method is called by @scheme[write-editor-global-header].
|
||||
This method is called by @racket[write-editor-global-header].
|
||||
|
||||
}
|
||||
|
||||
|
@ -60,17 +59,17 @@ This method is called by @scheme[write-editor-global-header].
|
|||
(is-a?/c editor-stream-out%)])]{
|
||||
|
||||
|
||||
Writes @scheme[v], or @scheme[n] bytes of @scheme[v].
|
||||
Writes @racket[v], or @racket[n] bytes of @racket[v].
|
||||
|
||||
When @scheme[n] is supplied with a byte-string @scheme[v], use
|
||||
When @racket[n] is supplied with a byte-string @racket[v], use
|
||||
@method[editor-stream-in% get-unterminated-bytes] to read the bytes
|
||||
later. This is the recommended way to write out bytes to
|
||||
be easily read in later; use @method[editor-stream-in%
|
||||
get-unterminated-bytes] to read the bytes back in.
|
||||
|
||||
If @scheme[n] is not supplied and @scheme[v] is a byte string, then
|
||||
If @racket[n] is not supplied and @racket[v] is a byte string, then
|
||||
for historical reasons, the actual number of bytes written includes a
|
||||
@scheme[#\nul] terminator, so use @method[editor-stream-in%
|
||||
@racket[#\nul] terminator, so use @method[editor-stream-in%
|
||||
get-bytes] instead of @method[editor-stream-in%
|
||||
get-unterminated-bytes] to read the bytes later.
|
||||
|
||||
|
@ -83,8 +82,8 @@ If @scheme[n] is not supplied and @scheme[v] is a byte string, then
|
|||
Puts a fixed-sized integer into the stream. This method is needed
|
||||
because numbers are usually written in a way that takes varying
|
||||
numbers of bytes. In some cases it is useful to temporary write a
|
||||
@scheme[0] to a stream, write more data, and then go back and change
|
||||
the @scheme[0] to another number; such a process requires a
|
||||
@racket[0] to a stream, write more data, and then go back and change
|
||||
the @racket[0] to another number; such a process requires a
|
||||
fixed-size number.
|
||||
|
||||
Numbers written to a stream with @method[editor-stream-out% put-fixed]
|
||||
|
@ -95,7 +94,7 @@ Numbers written to a stream with @method[editor-stream-out% put-fixed]
|
|||
@defmethod[(put-unterminated [v bytes?]) (is-a?/c editor-stream-out%)]{
|
||||
|
||||
The same as calling @method[editor-stream-out% put] with
|
||||
@scheme[(bytes-length v)] and @scheme[v].}
|
||||
@racket[(bytes-length v)] and @racket[v].}
|
||||
|
||||
|
||||
@defmethod[(tell)
|
||||
|
|
|
@ -3,30 +3,30 @@
|
|||
|
||||
@defclass/title[editor-wordbreak-map% object% ()]{
|
||||
|
||||
An @scheme[editor-wordbreak-map%] objects is used with a
|
||||
@scheme[text%] objects to specify word-breaking criteria for the
|
||||
An @racket[editor-wordbreak-map%] objects is used with a
|
||||
@racket[text%] objects to specify word-breaking criteria for the
|
||||
default wordbreaking function. See also @method[text%
|
||||
set-wordbreak-map], @method[text% get-wordbreak-map], @method[text%
|
||||
find-wordbreak], and @method[text% set-wordbreak-func].
|
||||
|
||||
A global object @scheme[the-editor-wordbreak-map] is created
|
||||
automatically and used as the default map for all @scheme[text%]
|
||||
A global object @racket[the-editor-wordbreak-map] is created
|
||||
automatically and used as the default map for all @racket[text%]
|
||||
objects.
|
||||
|
||||
A wordbreak objects implements a mapping from each character to a list
|
||||
of symbols. The following symbols are legal elements of the list:
|
||||
|
||||
@itemize[
|
||||
@item{@indexed-scheme['caret]}
|
||||
@item{@indexed-scheme['line]}
|
||||
@item{@indexed-scheme['selection]}
|
||||
@item{@indexed-scheme['user1]}
|
||||
@item{@indexed-scheme['user2]}
|
||||
@item{@indexed-racket['caret]}
|
||||
@item{@indexed-racket['line]}
|
||||
@item{@indexed-racket['selection]}
|
||||
@item{@indexed-racket['user1]}
|
||||
@item{@indexed-racket['user2]}
|
||||
]
|
||||
|
||||
The presence of a flag in a character's value indicates that the
|
||||
character does not break a word when searching for breaks using the
|
||||
corresponding reason. For example, if @scheme['caret] is present,
|
||||
corresponding reason. For example, if @racket['caret] is present,
|
||||
then the character is a non-breaking character for caret-movement
|
||||
words. (Each stream of non-breaking characters is a single word.)
|
||||
|
||||
|
@ -35,18 +35,18 @@ The presence of a flag in a character's value indicates that the
|
|||
@defconstructor[()]{
|
||||
|
||||
All ASCII alpha-numeric characters are initialized with
|
||||
@scheme['(caret line selection)]. All other ASCII non-whitespace
|
||||
@racket['(caret line selection)]. All other ASCII non-whitespace
|
||||
characters except @litchar{-} are initialized with
|
||||
@scheme['(line)]. All ASCII whitespace characters and @litchar{-} are
|
||||
initialized with @scheme[null].
|
||||
@racket['(line)]. All ASCII whitespace characters and @litchar{-} are
|
||||
initialized with @racket[null].
|
||||
|
||||
}
|
||||
|
||||
@defmethod[(get-map [char char?])
|
||||
(listof (one-of/c 'caret 'line 'selection 'user1 'user2))]{
|
||||
|
||||
Gets the mapping value for @scheme[char]. See
|
||||
@scheme[editor-wordbreak-map%] for more information.
|
||||
Gets the mapping value for @racket[char]. See
|
||||
@racket[editor-wordbreak-map%] for more information.
|
||||
|
||||
}
|
||||
|
||||
|
@ -55,8 +55,8 @@ Gets the mapping value for @scheme[char]. See
|
|||
void?]{
|
||||
|
||||
|
||||
Sets the mapping value for @scheme[char] to @scheme[value]. See
|
||||
@scheme[editor-wordbreak-map%] for more information.
|
||||
Sets the mapping value for @racket[char] to @racket[value]. See
|
||||
@racket[editor-wordbreak-map%] for more information.
|
||||
|
||||
}}
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user