checkpoint GUI reference work

svn: r7086
This commit is contained in:
Matthew Flatt 2007-08-13 15:56:03 +00:00
parent 39f6a4bc3a
commit 0b29e215cb
39 changed files with 2109 additions and 2294 deletions

View File

@ -181,7 +181,7 @@
;; ----------------------------------------
(provide method xmethod)
(provide method xmethod (rename method ::))
(define-syntax method
(syntax-rules ()
@ -269,7 +269,7 @@
(make-element "schememeta" (list "...+")))
(define-syntax (arg-contract stx)
(syntax-case stx (... ...+)
(syntax-case stx (... ...+ _...superclass-args...)
[(_ [id contract])
(identifier? #'id)
#'(schemeblock0 contract)]
@ -288,6 +288,8 @@
#'#f]
[(_ (... ...+))
#'#f]
[(_ _...superclass-args...)
#'#f]
[(_ arg)
(raise-syntax-error
'defproc
@ -549,6 +551,11 @@
(list (scheme new)
(hspace 1)
(to-element within-id)))]
[(eq? mode 'make)
(make-element #f
(list (scheme make-object)
(hspace 1)
(to-element within-id)))]
[(eq? mode 'send)
(make-element #f
(list (scheme send)
@ -556,22 +563,30 @@
(to-element (string->symbol
(regexp-replace
#rx"(%|<%>|-mixin)$"
(format "a-~s" (syntax-e within-id))
(format "a~a-~s"
(if (member
(string-ref (symbol->string (syntax-e within-id)) 0)
'(#\a #\e #\i #\o #\u))
"n"
"")
(syntax-e within-id))
"")))
(hspace 1)
(let* ([mname (car prototype)]
[tag (format "~a::~a"
(register-scheme-definition within-id)
mname)]
[content (list (*method mname within-id))])
(make-toc-target-element
#f
(list (make-index-element #f
content
tag
(list (symbol->string mname))
content))
tag))))]
(if first?
(let* ([mname (car prototype)]
[tag (format "~a::~a"
(register-scheme-definition within-id)
mname)]
[content (list (*method mname within-id))])
(make-toc-target-element
#f
(list (make-index-element #f
content
tag
(list (symbol->string mname))
content))
tag))
(*method (car prototype) within-id))))]
[else
(if first?
(let ([tag (register-scheme-definition stx-id)]
@ -594,7 +609,8 @@
[(res) (result-contract)]
[(result-next-line?) ((+ (if short?
flat-size
(prototype-size prototype + max))
(+ (prototype-size (cdr prototype) max max)
(element-width tagged)))
(flow-element-width res))
. >= . (- max-proto-width 7))]
[(end) (list (to-flow spacer)
@ -1198,6 +1214,9 @@
(provide defclass
definterface
defconstructor
defconstructor/make
defconstructor*/make
defconstructor/auto-super
defmethod
defmethod*
methspec
@ -1312,12 +1331,12 @@
(list (quote-syntax intf) ...)))
(list body ...))))]))
(define-syntax (defconstructor stx)
(define-syntax (defconstructor*/* stx)
(syntax-case stx ()
[(_ ([id . arg-rest] ...) desc ...)
[(_ mode ((arg ...) ...) desc ...)
(let ([n (syntax-parameter-value #'current-class)])
(with-syntax ([name n]
[result (let ([s (quote-syntax (is-a/c n))])
[result (let ([s (quote-syntax (is-a/c nm))])
(datum->syntax-object s
(let ([l (syntax->list s)])
(cons (car l)
@ -1325,13 +1344,40 @@
(syntax-e n)
(cadr l)))))
s))]
[(kw ...) (map (lambda (id)
(string->keyword (symbol->string (syntax-e id))))
(syntax->list #'(id ...)))])
[(((kw ...) ...) ...) (map (lambda (ids)
(map (lambda (arg)
(if (and (pair? (syntax-e arg))
(eq? (syntax-e #'mode) 'new))
(list (string->keyword (symbol->string
(syntax-e
(car (syntax-e arg))))))
null))
(syntax->list ids)))
(syntax->list #'((arg ...) ...)))])
#'(make-constructor (lambda ()
(defproc* #:mode new #:within name [[(make [kw id . arg-rest] ...) result]]
(defproc* #:mode mode #:within name [[(make [kw ... . arg] ...) result] ...]
desc ...)))))]))
(define-syntax (defconstructor stx)
(syntax-case stx ()
[(_ ([id . arg-rest] ...) desc ...)
#'(defconstructor*/* new (([id . arg-rest] ...)) desc ...)]))
(define-syntax (defconstructor/make stx)
(syntax-case stx ()
[(_ ([id . arg-rest] ...) desc ...)
#'(defconstructor*/* make (([id . arg-rest] ...)) desc ...)]))
(define-syntax (defconstructor*/make stx)
(syntax-case stx ()
[(_ (([id . arg-rest] ...) ...) desc ...)
#'(defconstructor*/* make (([id . arg-rest] ...) ...) desc ...)]))
(define-syntax (defconstructor/auto-super stx)
(syntax-case stx ()
[(_ ([id . arg-rest] ...) desc ...)
#'(defconstructor*/* new (([id . arg-rest] ... _...superclass-args...)) desc ...)]))
(define-syntax (defmethod* stx)
(syntax-case stx ()
[(_ #:mode mode ([(name arg ...) result-type] ...) desc ...)

View File

@ -21,64 +21,6 @@ All @scheme[area-container<%>] classes accept the following named
@defmethod[(get-children)
(listof (is-a/c subarea<%>))]{
Returns a list of the container's non-deleted children. (The non-deleted
children are the ones currently managed by the container; deleted
children are generally hidden.) The order of the children in the list
is significant. For example, in a vertical panel, the first child in
the list is placed at the top of the panel.
}
@defmethod[(change-children [filter ((listof (is-a/c subarea<%>)) . -> . (listof (is-a/c subarea<%>)))])
void?]{
Takes a filter procedure and changes the container's list of
non-deleted children. The filter procedure takes a list of
children areas and returns a new list of children areas. The new
list must consist of children that were created as subareas of
this area (i.e., @method[area-container<%> change-children]
cannot be used to change the parent of a subarea).
After the set of non-deleted children is changed, the container computes
the sets of newly deleted and newly non-deleted children. Newly deleted
windows are hidden. Newly non-deleted windows are shown.
Since non-window areas cannot be hidden, non-window areas cannot be
deleted. If the filter procedure removes non-window subareas,
an exception is raised and the set of non-deleted children is not changed.
}
@defmethod[(place-children [info (listof (list/c (integer-in 0 10000)
(integer-in 0 10000)
any/c
any/c))]
[width (integer-in 0 10000)]
[height (integer-in 0 10000)])
(listof (list/c (integer-in 0 10000)
(integer-in 0 10000)
(integer-in 0 10000)
(integer-in 0 10000)))]{
Called to place the children of a container. See @|geomdiscuss|
for more information.
}
@defmethod[(container-size [info (listof (list/c (integer-in 0 10000)
(integer-in 0 10000)
any/c
any/c))])
(values (integer-in 0 10000) (integer-in 0 10000))]{
Called to determine the minimum size of a container. See
@|geomdiscuss| for more information.
}
@defmethod[(add-child [child (is-a/c subwindow<%>)])
void?]{
Add the given subwindow to the set of non-deleted children. See also
@ -86,13 +28,6 @@ Add the given subwindow to the set of non-deleted children. See also
}
@defmethod[(delete-child [child (is-a/c subwindow<%>)])
void?]{
Removes the given subwindow from the list of non-deleted children. See also
@method[area-container<%> change-children].
}
@defmethod[(after-new-child [child (is-a/c subarea<%>)])
void?]{
@methspec{
@ -110,6 +45,21 @@ Does nothing.
}}
@defmethod[(begin-container-sequence)
void?]{
Suspends geometry management in the container's top-level window
until
@method[area-container<%> end-container-sequence] is called. The
@method[area-container<%> begin-container-sequence] and
@method[area-container<%> end-container-sequence] methods are used to bracket a set of container modifications so that
the resulting geometry is computed only once. A container sequence also
delays show and hide actions by
@method[area-container<%> change-children], as well as the on-screen part of showing via
@method[window<%> show] until the sequence is complete. Sequence begin and end commands may
be nested arbitrarily deep.
}
@defmethod*[([(border)
(integer-in 0 1000)]
[(border [margin (integer-in 0 1000)])
@ -120,33 +70,62 @@ Gets or sets the border margin for the container in pixels. This
locations and sizes of the subareas are computed.
}
@defmethod*[([(spacing)
(integer-in 0 1000)]
[(spacing [spacing (integer-in 0 1000)])
void?])]{
Gets or sets the spacing, in pixels, used between subareas in the
container. For example, a vertical panel inserts this spacing between
each pair of vertically aligned subareas (with no extra space at the
top or bottom).
@defmethod[(change-children [filter ((listof (is-a/c subarea<%>)) . -> . (listof (is-a/c subarea<%>)))])
void?]{
Takes a filter procedure and changes the container's list of
non-deleted children. The filter procedure takes a list of
children areas and returns a new list of children areas. The new
list must consist of children that were created as subareas of
this area (i.e., @method[area-container<%> change-children]
cannot be used to change the parent of a subarea).
After the set of non-deleted children is changed, the container computes
the sets of newly deleted and newly non-deleted children. Newly deleted
windows are hidden. Newly non-deleted windows are shown.
Since non-window areas cannot be hidden, non-window areas cannot be
deleted. If the filter procedure removes non-window subareas,
an exception is raised and the set of non-deleted children is not changed.
}
@defmethod[(set-alignment [horiz-align (symbols/c right center left)]
[vert-align (symbols/c bottom center top)])
@defmethod[(container-flow-modified)
void?]{
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).
Call this method when the result changes for an overridden flow-defining method, such as
@method[area-container<%> place-children]. The call notifies the geometry manager that the placement of the
container's children needs to be recomputed.
When the container's horizontal alignment is @scheme['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
container. When the container's horizontal alignment is
@scheme['right], leftover whitespace is inserted to the left.
The
@method[area-container<%> reflow-container]method only recomputes child positions when the geometry manager
thinks that the placement has changed since the last computation.
Similarly, a container's vertical alignment can be @scheme['top],
@scheme['center], or @scheme['bottom].
}
@defmethod[(container-size [info (listof (list/c (integer-in 0 10000)
(integer-in 0 10000)
any/c
any/c))])
(values (integer-in 0 10000) (integer-in 0 10000))]{
Called to determine the minimum size of a container. See
@|geomdiscuss| for more information.
}
@defmethod[(delete-child [child (is-a/c subwindow<%>)])
void?]{
Removes the given subwindow from the list of non-deleted children. See also
@method[area-container<%> change-children].
}
@defmethod[(end-container-sequence)
void?]{
See
@method[area-container<%> begin-container-sequence].
}
@ -159,6 +138,33 @@ Returns the container's current alignment specification. See
}
@defmethod[(get-children)
(listof (is-a/c subarea<%>))]{
Returns a list of the container's non-deleted children. (The non-deleted
children are the ones currently managed by the container; deleted
children are generally hidden.) The order of the children in the list
is significant. For example, in a vertical panel, the first child in
the list is placed at the top of the panel.
}
@defmethod[(place-children [info (listof (list/c (integer-in 0 10000)
(integer-in 0 10000)
any/c
any/c))]
[width (integer-in 0 10000)]
[height (integer-in 0 10000)])
(listof (list/c (integer-in 0 10000)
(integer-in 0 10000)
(integer-in 0 10000)
(integer-in 0 10000)))]{
Called to place the children of a container. See @|geomdiscuss|
for more information.
}
@defmethod[(reflow-container)
void?]{
@ -186,38 +192,35 @@ See also @method[area-container<%> container-flow-modified].
}
@defmethod[(container-flow-modified)
@defmethod[(set-alignment [horiz-align (symbols/c right center left)]
[vert-align (symbols/c bottom center top)])
void?]{
Call this method when the result changes for an overridden flow-defining method, such as
@method[area-container<%> place-children]. The call notifies the geometry manager that the placement of the
container's children needs to be recomputed.
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).
The
@method[area-container<%> reflow-container]method only recomputes child positions when the geometry manager
thinks that the placement has changed since the last computation.
When the container's horizontal alignment is @scheme['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
container. When the container's horizontal alignment is
@scheme['right], leftover whitespace is inserted to the left.
Similarly, a container's vertical alignment can be @scheme['top],
@scheme['center], or @scheme['bottom].
}
@defmethod[(begin-container-sequence)
void?]{
Suspends geometry management in the container's top-level window
until
@method[area-container<%> end-container-sequence] is called. The
@method[area-container<%> begin-container-sequence] and
@method[area-container<%> end-container-sequence] methods are used to bracket a set of container modifications so that
the resulting geometry is computed only once. A container sequence also
delays show and hide actions by
@method[area-container<%> change-children], as well as the on-screen part of showing via
@method[window<%> show] until the sequence is complete. Sequence begin and end commands may
be nested arbitrarily deep.
@defmethod*[([(spacing)
(integer-in 0 1000)]
[(spacing [spacing (integer-in 0 1000)])
void?])]{
Gets or sets the spacing, in pixels, used between subareas in the
container. For example, a vertical panel inserts this spacing between
each pair of vertically aligned subareas (with no extra space at the
top or bottom).
}
}
@defmethod[(end-container-sequence)
void?]{
See
@method[area-container<%> begin-container-sequence].
}}

View File

@ -24,6 +24,20 @@ All @scheme[area<%>] classes accept the following named instantiation
@defmethod[(get-graphical-min-size)
(values (integer-in 0 10000)
(integer-in 0 10000))]{
Returns the area's graphical minimum size as two values: the minimum
width and the minimum height (in pixels).
See @|geomdiscuss| for more information. Note that the return value
@italic{does not} depend on the area's
@method[area<%> min-width] and
@method[area<%> min-height] settings.
}
@defmethod[(get-parent)
(or/c (is-a/c area-container<%>) false/c)]{
@ -84,17 +98,13 @@ When setting the minimum height (in pixels); if @scheme[h] is smaller
}
@defmethod[(get-graphical-min-size)
(values (integer-in 0 10000)
(integer-in 0 10000))]{
@defmethod*[([(stretchable-height)
boolean?]
[(stretchable-height [stretch? any/c])
void?])]{
Returns the area's graphical minimum size as two values: the minimum
width and the minimum height (in pixels).
See @|geomdiscuss| for more information. Note that the return value
@italic{does not} depend on the area's
@method[area<%> min-width] and
@method[area<%> min-height] settings.
Gets or sets the area's vertical stretchability for geometry
management. See @|geomdiscuss| for more information.
}
@ -106,14 +116,4 @@ See @|geomdiscuss| for more information. Note that the return value
Gets or sets the area's horizontal stretchability for geometry
management. See @|geomdiscuss| for more information.
}
@defmethod*[([(stretchable-height)
boolean?]
[(stretchable-height [stretch? any/c])
void?])]{
Gets or sets the area's vertical stretchability for geometry
management. See @|geomdiscuss| for more information.
}}

View File

@ -26,23 +26,7 @@
(define (labelstripped where detail what)
@elem{If @litchar{&} occurs in @|where|@|detail|, it
is specially parsed; under Windows and X, the character following
@litchar{&} is underlined in the displayed control to indicate a
keyboard mnemonic. (Under Mac OS X, mnemonic underlines are not shown.)
The underlined mnemonic character must be a letter or a digit. The
user can @|what| by typing the 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 ampersand itself
is removed from @|where| before it is displayed for the control; a
double-ampersand in @|where| is converted to a single ampersand
(with no mnemonic underlining). Under 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 languages. Finally, any text after a tab
character is removed on all platforms. Mnemonic keyboard events are handled
by @method[top-level-window<%> on-traverse-char] (but not under
Mac OS X).})
is specially parsed as for @scheme[button%].})
(define (bitmapuseinfo pre what thing then detail)
@elem{@|pre| @|what| is @|thing|, @|then| the bitmap@|detail|
@ -193,7 +177,7 @@ information@|details|, even if the editor currently has delayed refreshing (see
@elem{The @scheme[style] argument is provided for future extensions. Currently, @scheme[style] must be the empty list.})
(define (HVLabelNote what)
@elem{If @scheme[style] includes @scheme['vertical-label], then the #1 is
@elem{If @scheme[style] includes @scheme['vertical-label], then the @|what| is
created with a label above the control; if @scheme[style] does not include
@scheme['vertical-label] (and optionally includes @scheme['horizontal-label]), then the
label is created to the left of the @|what|.})

View File

@ -12,7 +12,7 @@ Whenever a button is clicked by the user, the buttons's callback
[parent (or/c (is-a/c frame%) (is-a/c dialog%)
(is-a/c panel%) (is-a/c pane%))]
[callback ((is-a/c button%) (is-a/c control-event%) . -> . any) (lambda (b e) (void))]
[style (symbols/c deleted border) null]
[style (one-of/c 'border 'deleted) null]
[font (is-a/c font%) @scheme[normal-control-font]]
[enabled any/c #t]
[vert-margin (integer-in 0 1000) 2]
@ -25,7 +25,25 @@ Whenever a button is clicked by the user, the buttons's callback
Creates a button with a string or bitmap label.
@bitmaplabeluse[label]
@labelstripped[(scheme label) @elem{ (when @scheme[label] is a string)} @elem{effectively click the button}]
If @litchar{&} occurs in @scheme[label] (when @scheme[label] is a
string), it is specially parsed; under Windows and X, the character
following @litchar{&} is underlined in the displayed control to
indicate a keyboard mnemonic. (Under Mac OS X, mnemonic underlines are
not shown.) The underlined mnemonic character must be a letter or a
digit. The user can effectively click the button by typing the
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
underlining). Under 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
languages. Finally, any text after a tab character is removed on all
platforms. Mnemonic keyboard events are handled by
@method[top-level-window<%> on-traverse-char] (but not under Mac OS
X).
The @scheme[callback] procedure is called (with the event type
@indexed-scheme['button]) whenever the user clicks the button.

View File

@ -9,9 +9,10 @@ A @scheme[canvas%] object is a general-purpose window for drawing
@defconstructor[([parent (or/c (is-a/c frame%) (is-a/c dialog%)
(is-a/c panel%) (is-a/c pane%))]
[style (listof (symbols/c no-focus transparent no-autoclear
deleted gl resize-corner hscroll vscroll
combo control-border border)) null]
[style (listof (one-of/c 'border 'control-border 'combo
'vscroll 'hscroll 'resize-corner
'gl 'no-autoclear 'transparent
'no-focus 'deleted)) null]
[paint-callback ((is-a/c button%) (is-a/c dc<%>) . -> . any) void]
[label (or/c label-string? false/c) #f]
[gl-config (or/c (is-a/c gl-config%) false/c) #f]
@ -46,11 +47,6 @@ The @scheme[style] argument indicates one or more of the following styles:
@item{@scheme['gl] --- {\em obsolete} (every canvas is an OpenGL context where supported)}
@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]
method}
@item{@scheme['no-autoclear] --- prevents automatic erasing of the
canvas before calls to
@method[canvas% on-paint]}
@ -62,6 +58,10 @@ The @scheme[style] argument indicates one or more of the following styles:
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]
method}
}
@ -90,116 +90,27 @@ The @scheme[gl-config] argument determines properties of an OpenGL
}
@defmethod[(with-gl-context [thunk (-> any)])
any]{
Passes the given thunk to
@method[gl-context<%> call-as-current]
of the result of
@method[dc<%> get-gl-context]
for this canvas's DC as returned by
@method[canvas<%> get-dc].
The
@method[gl-context<%> call-as-current]
method acquires a re-entrant lock, so nested calls to
@method[canvas% with-gl-context] on different threads or OpenGL contexts can block or deadlock.
@defmethod*[([(accept-tab-focus)
boolean?]
[(accept-tab-focus [on? any/c])
void?])]{
@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). 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 canvas, Tab, arrow, and Enter 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.
}
@defmethod[(swap-gl-buffers)
void?]{
Calls
@method[gl-context<%> swap-buffers]
on the result of
@method[dc<%> get-gl-context]
for this canvas's DC as returned by
@method[canvas<%> get-dc].
The
@method[gl-context<%> swap-buffers]
method acquires a re-entrant lock, so nested calls to
@method[canvas% with-gl-context] on different threads or OpenGL contexts can block or deadlock.
}
@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
scroll action.
This method is called only when manual
scrollbars are changed, not automatic scrollbars; for automatic scrollbars,
the
@method[canvas<%> on-paint] method is called, instead.
}
@defmethod[(get-scroll-pos [which (symbols/c vertical horizontal)])
(integer-in 0 10000)]{
Gets the current value of a manual scrollbar. The result is always
@scheme[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
vertical scrollbar should be returned, respectively.
See also
@method[canvas% init-manual-scrollbars].
}
@defmethod[(set-scroll-pos [which (symbols/c vertical horizontal)]
[value (integer-in 0 10000)])
void?]{
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
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}]
See also
@method[canvas% init-manual-scrollbars] and
@method[canvas% scroll].
}
@defmethod[(get-scroll-range [which (symbols/c vertical horizontal)])
(integer-in 0 10000)]{
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.
The @scheme[which] argument is either @scheme['horizontal] or
@scheme['vertical], indicating whether to get the maximum value of the
horizontal or vertical scrollbar, respectively.
See also
@method[canvas% init-manual-scrollbars].
}
@defmethod[(set-scroll-range [which (symbols/c vertical horizontal)]
[value (integer-in 0 10000)])
void?]{
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
horizontal or vertical scrollbar, respectively.
See also
@method[canvas% init-manual-scrollbars].
}
@defmethod[(get-scroll-page [which (symbols/c vertical horizontal)])
@defmethod[(get-scroll-page [which (one-of/c 'horizontal 'vertical)])
(integer-in 1 10000)]{
Get the current page step size of a manual scrollbar. The result is
@ -213,22 +124,54 @@ See also
@method[canvas% init-manual-scrollbars].
}
@defmethod[(set-scroll-page [which (symbols/c vertical horizontal)]
[value (integer-in 1 10000)])
void?]{
Set the current page step size of a manual scrollbar. (This method has
no effect on automatic scrollbars.)
@defmethod[(get-scroll-pos [which (one-of/c 'horizontal 'vertical)])
(integer-in 0 10000)]{
Gets the current value of a manual scrollbar. The result is always
@scheme[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 set the page step size of
the horizontal or vertical scrollbar, respectively.
@scheme['vertical], indicating that the value of the horizontal or
vertical scrollbar should be returned, respectively.
See also
@method[canvas% init-manual-scrollbars].
}
@defmethod[(get-scroll-range [which (one-of/c 'horizontal 'vertical)])
(integer-in 0 10000)]{
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.
The @scheme[which] argument is either @scheme['horizontal] or
@scheme['vertical], indicating whether to get the maximum value of the
horizontal or vertical scrollbar, respectively.
See also
@method[canvas% init-manual-scrollbars].
}
@defmethod[(get-view-start)
(values (integer-in 0 10000) (integer-in 0 10000))]{
Get the location at which the visible portion of the canvas
starts, based on the current values of the horizontal and
vertical scrollbars if they are initialized as automatic (see
@method[canvas% init-auto-scrollbars]). Combined with
@method[window<%> get-client-size], an application can
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)].
}
@defmethod[(get-virtual-size)
(value (integer-in 0 10000) (integer-in 0 10000))]{
Gets the size in device units of the scrollable canvas area (as
@ -239,29 +182,6 @@ Gets the size in device units of the scrollable canvas area (as
}
@defmethod[(scroll [h-value (or/c (real-in 0.0 1.0) false/c)]
[v-value (or/c (real-in 0.0 1.0) false/c)])
void?]{
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
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)))].
See also
@method[canvas% init-auto-scrollbars] and
@method[canvas% get-view-start].
}
@defmethod[(init-auto-scrollbars [horiz-pixels (or/c (integer-in 1 10000) false/c)]
[vert-pixels (or/c (integer-in 1 10000) false/c)]
@ -348,6 +268,109 @@ See also
}
@defmethod[#:mode 'override
(on-paint)
void?]{
Calls the procedure supplied as the @scheme[paint-callback] argument when
the @scheme[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
scroll action.
This method is called only when manual
scrollbars are changed, not automatic scrollbars; for automatic scrollbars,
the
@method[canvas<%> on-paint] method is called, instead.
}
@defmethod[(scroll [h-value (or/c (real-in 0.0 1.0) false/c)]
[v-value (or/c (real-in 0.0 1.0) false/c)])
void?]{
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
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)))].
See also
@method[canvas% init-auto-scrollbars] and
@method[canvas% get-view-start].
}
@defmethod[(set-scroll-page [which (one-of/c 'horizontal 'vertical)]
[value (integer-in 1 10000)])
void?]{
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 horizontal or vertical scrollbar, respectively.
See also
@method[canvas% init-manual-scrollbars].
}
@defmethod[(set-scroll-pos [which (one-of/c 'horizontal 'vertical)]
[value (integer-in 0 10000)])
void?]{
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
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}]
See also
@method[canvas% init-manual-scrollbars] and
@method[canvas% scroll].
}
@defmethod[(set-scroll-range [which (one-of/c 'horizontal 'vertical)]
[value (integer-in 0 10000)])
void?]{
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
horizontal or vertical scrollbar, respectively.
See also
@method[canvas% init-manual-scrollbars].
}
@defmethod[(show-scrollbars [show-horiz? any/c]
[show-vert? any/c])
void?]{
@ -369,47 +392,40 @@ init-manual-scrollbars].
}
@defmethod[(get-view-start)
(values (integer-in 0 10000) (integer-in 0 10000))]{
Get the location at which the visible portion of the canvas
starts, based on the current values of the horizontal and
vertical scrollbars if they are initialized as automatic (see
@method[canvas% init-auto-scrollbars]). Combined with
@method[window<%> get-client-size], an application can
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)].
}
@defmethod*[([(accept-tab-focus)
boolean?]
[(accept-tab-focus [on? any/c])
void?])]{
@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). 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 canvas, Tab, arrow, and Enter 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.
}
@defmethod[#:mode 'override
(on-paint)
@defmethod[(swap-gl-buffers)
void?]{
Calls
@method[gl-context<%> swap-buffers]
on the result of
@method[dc<%> get-gl-context]
for this canvas's DC as returned by
@method[canvas<%> get-dc].
Calls the procedure supplied as the @scheme[paint-callback] argument when
the @scheme[canvas%] was created.
The
@method[gl-context<%> swap-buffers]
method acquires a re-entrant lock, so nested calls to
@method[canvas% with-gl-context] on different threads or OpenGL contexts can block or deadlock.
}}
}
@defmethod[(with-gl-context [thunk (-> any)])
any]{
Passes the given thunk to
@method[gl-context<%> call-as-current]
of the result of
@method[dc<%> get-gl-context]
for this canvas's DC as returned by
@method[canvas<%> get-dc].
The
@method[gl-context<%> call-as-current]
method acquires a re-entrant lock, so nested calls to
@method[canvas% with-gl-context] on different threads or OpenGL contexts can block or deadlock.
}
}

View File

@ -21,6 +21,59 @@ The @scheme[canvas<%>] interface is implemented by two classes:
}
@defmethod[(get-canvas-background)
(or/c (is-a/c color%) false/c)]{
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.
}
@defmethod[(get-dc)
(is-a/c dc<%>)]{
Gets the canvas's device context. See
@scheme[dc<%>] for more information about drawing.
}
@defmethod*[([(min-client-height)
(integer-in 0 10000)]
[(min-client-height [h (integer-in 0 10000)])
void?])]{
Gets or sets the canvas's minimum height for geometry management,
based on the client size rather than the full size. The client height
is obtained or changed via
@xmethod[area<%> min-height], adding or subtracting border and scrollbar sizes as appropriate.
The minimum height is ignored when it is smaller than the canvas's
@tech{graphical minimum height}. See @|geomdiscuss| for
more information.
}
@defmethod*[([(min-client-width)
(integer-in 0 10000)]
[(min-client-width [w (integer-in 0 10000)])
void?])]{
Gets or sets the canvas's minimum width for geometry management, based
on the canvas's client size rather than its full size. The client
width is obtained or changed via
@xmethod[area<%> min-width], adding or subtracting border and scrollbar sizes as appropriate.
The minimum width is ignored when it is smaller than the canvas's
@tech{graphical minimum width}. See @|geomdiscuss| for
more information.
}
@defmethod[(on-char [ch (is-a/c key-event%)])
@ -39,6 +92,7 @@ Does nothing.
}}
@defmethod[(on-event [event (is-a/c mouse-event%)])
void?]{
@methspec{
@ -102,50 +156,6 @@ Does nothing.
}}
@defmethod[(get-dc)
(is-a/c dc<%>)]{
Gets the canvas's device context. See
@scheme[dc<%>] for more information about drawing.
}
@defmethod*[([(min-client-width)
(integer-in 0 10000)]
[(min-client-width [w (integer-in 0 10000)])
void?])]{
Gets or sets the canvas's minimum width for geometry management, based
on the canvas's client size rather than its full size. The client
width is obtained or changed via
@xmethod[area<%> min-width], adding or subtracting border and scrollbar sizes as appropriate.
The minimum width is ignored when it is smaller than the canvas's
@tech{graphical minimum width}. See @|geomdiscuss| for
more information.
}
@defmethod*[([(min-client-height)
(integer-in 0 10000)]
[(min-client-height [h (integer-in 0 10000)])
void?])]{
Gets or sets the canvas's minimum height for geometry management,
based on the client size rather than the full size. The client height
is obtained or changed via
@xmethod[area<%> min-height], adding or subtracting border and scrollbar sizes as appropriate.
The minimum height is ignored when it is smaller than the canvas's
@tech{graphical minimum height}. See @|geomdiscuss| for
more information.
}
@defmethod[(warp-pointer [x (integer-in 0 10000)]
[y (integer-in 0 10000)])
void?]{
Moves the cursor to the given location on the canvas.
}
@defmethod[(set-canvas-background [color (is-a/c color%)])
void?]{
@ -160,18 +170,6 @@ If the canvas was created with the @indexed-scheme['transparent] style,
}
@defmethod[(get-canvas-background)
(or/c (is-a/c color%) false/c)]{
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.
}
@defmethod[(set-resize-corner [on? any/c])
void?]{
@ -182,5 +180,13 @@ Under Mac OS X, enables or disables space for a resize tab at the
default, but it can be enabled when a canvas is created with the
@scheme['resize-corner] style.
}}
}
@defmethod[(warp-pointer [x (integer-in 0 10000)]
[y (integer-in 0 10000)])
void?]{
Moves the cursor to the given location on the canvas.
}
}

View File

@ -16,8 +16,8 @@ Whenever a check box is clicked by the user, the check box's value is
@defconstructor[([label (or/c label-string? (is-a/c bitmap%))]
[parent (or/c (is-a/c frame%) (is-a/c dialog%)
(is-a/c panel%) (is-a/c pane%))]
[callback ((is-a/c check-box) (is-a/c control-event%) . -> . any) (lambda (c e) (void))]
[style (listof (symbols/c deleted)) null]
[callback ((is-a/c check-box%) (is-a/c control-event%) . -> . any) (lambda (c e) (void))]
[style (listof (one-of/c 'deleted)) null]
[value any/c #f]
[font (is-a/c font%) @scheme[normal-control-font]]
[enabled any/c #t]

View File

@ -16,23 +16,24 @@ See also
@scheme[list-box%].
@defconstructor[[label (or/c label-string? false/c)]
[choices list of {\labelstrings}]
[parent (or/c (is-a/c frame%) (is-a/c dialog%) (is-a/c panel%) (is-a/c pane%))]
[callback procedure of two arguments: a @scheme[choice%] object and a @scheme[control-event%] object @scheme[(\scmk{lambda] (@scheme[c] @scheme[e]) (void))}]
[style (symbols/c deleted horizontal-label vertical-label) null]
[selection nonnegative-exact-integer? 0]
[font (is-a/c font%) @scheme[normal-control-font]]
[enabled any/c #t]
[vert-margin (integer-in 0 1000) 2]
[horiz-margin (integer-in 0 1000) 2]
[min-width (integer-in 0 10000) {\rm graphical minimum width}]
[min-height (integer-in 0 10000) {\rm graphical minimum height}]
[stretchable-width any/c #f]
[stretchable-height any/c #f]]{
@defconstructor[([label (or/c label-string? false/c)]
[choices (listof label-string?)]
[parent (or/c (is-a/c frame%) (is-a/c dialog%)
(is-a/c panel%) (is-a/c pane%))]
[callback ((is-a/c choice%) (is-a/c control-event%) . -> . any)
(lambda (c e) (void))]
[style (listof (one-of/c 'horizontal-label 'vertical-label
'deleted))
null]
[selection nonnegative-exact-integer? 0]
[font (is-a/c font%) @scheme[normal-control-font]]
[enabled any/c #t]
[vert-margin (integer-in 0 1000) 2]
[horiz-margin (integer-in 0 1000) 2]
[min-width (integer-in 0 10000) _graphical-minimum-width]
[min-height (integer-in 0 10000) _graphical-minimum-height]
[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.
@ -48,7 +49,7 @@ The @scheme[callback] procedure is called (with the event type
@indexed-scheme['choice]) when the user selects a choice item (or
re-selects the currently selected item).
\HVLabelNote{choice item} \DeletedStyleNote{choice item}
@HVLabelNote{choice item} @DeletedStyleNote{choice item}
By default, the first choice (if any) is initially selected. If
@scheme[selection] is positive, it is passed to
@ -58,8 +59,5 @@ By default, the first choice (if any) is initially selected. If
@FontKWs[] @WindowKWs[] @SubareaKWs[] @AreaKWs[]
}}

View File

@ -12,55 +12,24 @@ A @scheme[clipboard-client%] object is associated to an eventspace
@method[clipboard<%> set-clipboard-client] for more information.
@defconstructor[]{
@defconstructor[()]{
Creates a clipboard client that supports no data formats.
}
@defmethod[(add-type [format string])
void?]{
@spec{
Adds a new data format name to the list supported by the clipboard
client.
@clipboardtypes[]
}
@impl{
{\clipboardtypes}
}}
@defmethod[(get-types)
list of strings]{
@spec{
Returns a list of names that are the data formats supported by the
clipboard client.
}}
@defmethod[(on-replaced)
void?]{
@spec{
Called when a clipboard client is dismissed as the clipboard owner
(because the clipboard has be taken by another client or by an
external application).
}}
@defmethod[(get-data [format string])
(or/c byte string false/c)]{
@spec{
(or/c bytes? string? false/c)]{
Called when a process requests clipboard data while this client is the
current one for the clipboard. The requested format is passed to the
@ -68,8 +37,7 @@ Called when a process requests clipboard data while this client is the
format, or @scheme[#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].
method; see @method[clipboard-client% add-type].
When this method is called by the clipboard, the current eventspace is
the same as the client's eventspace. If, at the point of the
@ -78,9 +46,21 @@ When this method is called by the clipboard, the current eventspace is
thread of the client's eventspace.
}
@impl{
{\clipboardtypes}
@defmethod[(get-types)
(listof string?)]{
}}}
Returns a list of names that are the data formats supported by the
clipboard client.
}
@defmethod[(on-replaced)
void?]{
Called when a clipboard client is dismissed as the clipboard owner
(because the clipboard has be taken by another client or by an
external application).
}
}

View File

@ -28,91 +28,8 @@ Generic data is always retrieved from the clipboard as a byte
clipboard formats is determined by the current clipboard owner.
@defmethod[(set-clipboard-client [new-owner (is-a/c clipboard-client%)]
[time (and/c exact? integer?)])
void?]{
@spec{
Changes the clipboard-owning client.
}
@impl{
Sets the client to @scheme[new-owner] and associates @scheme[new-owner] with
the current eventspace (as determined by
@scheme[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,
@|MismatchExn|}.
}}
@defmethod[(set-clipboard-string [new-text string]
[time (and/c exact? integer?)])
void?]{
@spec{
Changes the current clipboard contents to a text string
and releases the current clipboard client (if any).
}
@impl{
Sets the clipboard contents to @scheme[new-text]. See @|timediscuss| for
a discussion of the @scheme[time] argument. If @scheme[time] is outside
the platform-specific range of times, @|MismatchExn|}.
}}
@defmethod[(set-clipboard-bitmap [new-bitmap (is-a/c bitmap%)]
[time (and/c exact? integer?)])
void?]{
@spec{
Changes the current clipboard contents to a bitmap (Windows, Mac OS X)
and releases the current clipboard client (if any).
}
@impl{
Sets the clipboard contents to @scheme[new-bitmap]. See @|timediscuss| for
a discussion of the @scheme[time] argument. If @scheme[time] is outside
the platform-specific range of times, @|MismatchExn|}.
}}
@defmethod[(get-clipboard-string [time (and/c exact? integer?)])
(or/c string false/c)]{
@spec{
Gets the current clipboard contents as simple text, returning
@scheme[#f] if the clipboard does not contain any text.
See
@method[clipboard<%> get-clipboard-data] for information on eventspaces and the current clipboard client.
}
@impl{
See @|timediscuss| for a discussion of the @scheme[time] argument. If
@scheme[time] is outside the platform-specific range of times,
@|MismatchExn|}.
}}
@defmethod[(get-clipboard-bitmap [time (and/c exact? integer?)])
(or/c (is-a/c bitmap%) false/c)]{
@spec{
Gets the current clipboard contents as a bitmap (Windows, Mac OS X),
returning @scheme[#f] if the clipboard does not contain a bitmap.
@ -120,21 +37,15 @@ Gets the current clipboard contents as a bitmap (Windows, Mac OS X),
See
@method[clipboard<%> get-clipboard-data] for information on eventspaces and the current clipboard client.
}
@impl{
See @|timediscuss| for a discussion of the @scheme[time] argument. If
@scheme[time] is outside the platform-specific range of times,
@|MismatchExn|}.
@|MismatchExn|.
}}
}
@defmethod[(get-clipboard-data [format string]
[time (and/c exact? integer?)])
(or/c byte string false/c)]{
@spec{
Gets the current clipboard contents in a specific format, returning
@scheme[#f] if the clipboard does not contain data in the requested
@ -145,17 +56,69 @@ If the clipboard client is associated to an eventspace that is not the
client's eventspace. If no result is available within one second, the
request is abandoned and @scheme[#f] is returned.
}
@impl{
{\clipboardtypes}
See @xmethod[clipboard-client% add-type] for information on
@scheme[format].
See @|timediscuss| for a discussion of the @scheme[time] argument. If
@scheme[time] is outside the platform-specific range of times,
@|MismatchExn|}.
@|MismatchExn|.
}
@defmethod[(get-clipboard-string [time (and/c exact? integer?)])
(or/c string false/c)]{
Gets the current clipboard contents as simple text, returning
@scheme[#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,
@|MismatchExn|.
}
@defmethod[(set-clipboard-bitmap [new-bitmap (is-a/c bitmap%)]
[time (and/c exact? integer?)])
void?]{
Changes the current clipboard contents to @scheme[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
the platform-specific range of times, @|MismatchExn|.
}
@defmethod[(set-clipboard-client [new-owner (is-a/c clipboard-client%)]
[time (and/c exact? integer?)])
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
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,
@|MismatchExn|.
}
@defmethod[(set-clipboard-string [new-text string]
[time (and/c exact? integer?)])
void?]{
Changes the current clipboard contents to @scheme[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
the platform-specific range of times, @|MismatchExn|.
}
}

View File

@ -12,20 +12,24 @@ A @scheme[combo-field%] object is a @scheme[text-field%]
@defconstructor[[label (or/c label-string? false/c)]
[choices list of {\labelstrings}]
[parent (or/c (is-a/c frame%) (is-a/c dialog%) (is-a/c panel%) (is-a/c pane%))]
[callback procedure of two arguments: a @scheme[combo-field%] object and a @scheme[control-event%] object @scheme[(\scmk{lambda] (@scheme[cf] @scheme[e]) (void))}]
[init-value string ""]
[style (symbols/c deleted horizontal-label vertical-label) null]
[font (is-a/c font%) @scheme[normal-control-font]]
[enabled any/c #t]
[vert-margin (integer-in 0 1000) 2]
[horiz-margin (integer-in 0 1000) 2]
[min-width (integer-in 0 10000) {\rm graphical minimum width}]
[min-height (integer-in 0 10000) {\rm graphical minimum height}]
[stretchable-width any/c #t]
[stretchable-height any/c #f]]{
@defconstructor[([label (or/c label-string? false/c)]
[choices (listof label-string?)]
[parent (or/c (is-a/c frame%) (is-a/c dialog%)
(is-a/c panel%) (is-a/c pane%))]
[callback ((is-a/c combo-field%) (is-a/c control-event%) . -> . any)
(lambda (c e) (void))]
[init-value string ""]
[style (listof (one-of/c 'horizontal-label 'vertical-label
'deleted))
null]
[font (is-a/c font%) @scheme[normal-control-font]]
[enabled any/c #t]
[vert-margin (integer-in 0 1000) 2]
[horiz-margin (integer-in 0 1000) 2]
[min-width (integer-in 0 10000) _graphical-minimum-width]
[min-height (integer-in 0 10000) _graphical-minimum-height]
[stretchable-width any/c #t]
[stretchable-height any/c #f])]{
If @scheme[label] is not @scheme[#f], it is used as the combo label.
Otherwise, the combo does not display its label.
@ -51,55 +55,49 @@ 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
default width is selected.
\HVLabelNote{combo} \DeletedStyleNote{combo}.
@HVLabelNote{combo} @DeletedStyleNote{combo}.
@FontKWs[] @WindowKWs[] @SubareaKWs[] @AreaKWs[]
}
@defmethod[(get-menu)
(is-a/c popup-menu%)]{
@spec{
Returns the @scheme[popup-menu%] that is used by the default
@method[combo-field% on-popup] method. This menu is initialized with the @scheme[labels] argument when
the @scheme[combo-field%] is created, and the
@method[combo-field% append] method adds a new item to the menu.
}}
@defmethod[(on-popup [event (is-a/c control-event%)])
void?]{
@spec{
Called when the user clicks the combo's popup button.
}
@impl{
Gets a menu from
@method[combo-field% get-menu], sets its minimum width to match the combo control's width, and
then pops up the menu.
}}
@defmethod[(append [l label-string?])
void?]{
@spec{
Adds a new item to the combo's popup menu. The given label is used for
the item's name, and the item's callback installs the label into the
combo's text field.
}
@impl{
@defmethod[(get-menu)
(is-a/c popup-menu%)]{
Returns the @scheme[popup-menu%] that is used by the default
@method[combo-field% on-popup] method. This menu is initialized with the @scheme[labels] argument when
the @scheme[combo-field%] is created, and the
@method[combo-field% append] method adds a new item to the menu.
}
}}}
@defmethod[(on-popup [event (is-a/c control-event%)])
void?]{
@methspec{
Called when the user clicks the combo's popup button.
}
@methimpl{
Gets a menu from
@method[combo-field% get-menu], sets its minimum width to match the combo control's width, and
then pops up the menu.
}}
}

View File

@ -1,9 +1,15 @@
(module common mzscheme
(require (lib "manual.ss" "scribble")
(lib "basic.ss" "scribble")
(lib "class.ss")
(lib "contract.ss")
"blurbs.ss"
(only "../reference/mz.ss" AllUnix exnraise))
(provide (all-from (lib "manual.ss" "scribble"))
(all-from (lib "basic.ss" "scribble"))
(all-from (lib "class.ss"))
(all-from (lib "contract.ss"))
(all-from "blurbs.ss")
(all-from "../reference/mz.ss")))

View File

@ -7,11 +7,11 @@ A @scheme[control-event%] object contains information about a
control event. An instance of @scheme[control-event%] is always
provided to a control or menu item callback procedure.
@defconstructor[[event-type (symbols/c tab-panel menu-popdown-none menu-popdown radio-box slider text-field-enter text-field list-box-dclick list-box choice check-box button)]
[time-stamp (and/c exact? integer?) 0]]{
@defconstructor[([event-type (one-of/c 'button 'check-box 'choice
'list-box 'list-box-dclick 'text-field
'text-field-enter 'slider 'radio-box
'menu-popdown 'menu-popdown-none 'tab-panel)]
[time-stamp (and/c exact? integer?) 0])]{
The @scheme[event-type] argument is one of the following:
@itemize{
@ -34,33 +34,29 @@ This value is extracted out of a @scheme[control-event%] object with
the
@method[control-event% get-event-type] method.
See the corresponding @scheme[get-] and @scheme[set-] methods for
information about @scheme[time-stamp].
See @method[event% get-time-stamp] for information about
@scheme[time-stamp].
}
@defmethod[(get-event-type)
(symbols/c radio-box slider menu text-field-enter text-field list-box-dclick list-box choice check-box button)]{
@spec{
(one-of/c 'button 'check-box 'choice
'list-box 'list-box-dclick 'text-field
'text-field-enter '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.
}}
}
@defmethod[(set-event-type [type (symbols/c radio-box slider menu text-field-enter text-field list-box-dclick list-box choice check-box button)])
@defmethod[(set-event-type
[type (one-of/c 'button 'check-box 'choice
'list-box 'list-box-dclick 'text-field
'text-field-enter 'slider 'radio-box
'menu-popdown 'menu-popdown-none 'tab-panel)])
void?]{
@spec{
Sets the type of the event. See
@scheme[control-event%] for information about each event type symbol.
}
@impl{
}}}
}}

View File

@ -7,40 +7,29 @@ A cursor is a small icon that indicates the location of the mouse
pointer. The bitmap image typically indicates the current mode or
meaning of a mouse click at its current location.
A cursor is assigned to each window (or the window may use its parent's
cursor; see
@method[window<%> set-cursor] for more information), and the pointer image is changed to match the
window's cursor when the pointer is moved over the window. Each
cursor object may be assigned to many windows.
A cursor is assigned to each window (or the window may use its
parent's cursor; see @method[window<%> set-cursor] for more
information), and the pointer image is changed to match the window's
cursor when the pointer is moved over the window. Each cursor object
may be assigned to many windows.
@defconstructor*/make[([[image (is-a/c bitmap%)]
@defconstructor*/make[(([image (is-a/c bitmap%)]
[mask (is-a/c bitmap%)]
[hot-spot-x (integer-in 0 15) 0]
[hot-spot-y (integer-in 0 15) 0]]
[[id (symbols/c size-nw/se size-ne/sw size-e/w size-n/s blank watch ibeam hand cross bullseye arrow)]])]{
First case:
[hot-spot-y (integer-in 0 15) 0])
([id (one-of/c 'arrow 'bullseye 'cross 'hand 'ibeam 'watch 'blank
'size-n/s 'size-e/w 'size-ne/sw 'size-nw/se)]))]{
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
determine the focus point of the cursor within the cursor image,
relative to its top-left corner.
Creates a cursor using an image bitmap and a mask bitmap. Both
bitmaps must have depth 1 and size 16 by 16 pixels.
The second case creates a cursor using a stock cursor, specified
as one of the following:
The @scheme[hot-spot-x] and @scheme[hot-spot-y] arguments determine the
focus point of the cursor within the cursor image, relative to its
top-left corner.
If the cursor is created successfully,
@method[cursor% ok?] returns @scheme[#t], otherwise the cursor object cannot be assigned to a
window.
Second case:
Creates a cursor using a stock cursor, specified as one of the following:
@itemize{
@item{@scheme['arrow] --- the default cursor}
@ -73,22 +62,17 @@ Creates a cursor using a stock cursor, specified as one of the following:
}
If the cursor is created successfully, @method[cursor% ok?]
returns @scheme[#t], otherwise the cursor object cannot be
assigned to a window.
}
@defmethod[(ok?)
boolean?]{
@spec{
Returns @scheme[#t] if the cursor is can be assigned to a window,
@scheme[#f] otherwise.
}
@impl{
}}}
}}

View File

@ -10,48 +10,52 @@ A dialog is a top-level window that is @defterm{modal}: while the
@defconstructor[[label label-string?]
[parent (or/c @scheme[frame%] or @scheme[dialog%] object false/c) #f]
[width (or/c (integer-in 0 10000) false/c) #f]
[height (or/c (integer-in 0 10000) false/c) #f]
[x (or/c (integer-in 0 10000) false/c) #f]
[y (or/c (integer-in 0 10000) false/c) #f]
[style (symbols/c no-sheet resize-border no-caption) null]
[enabled any/c #t]
[border (integer-in 0 1000) 0]
[spacing (integer-in 0 1000) 0]
[alignment two-element list: @scheme['left], @scheme['center], or @scheme['right] and @scheme['top], @scheme['center], or @scheme['bottom] '(center top)]
[min-width (integer-in 0 10000) {\rm graphical minimum width}]
[min-height (integer-in 0 10000) {\rm graphical minimum height}]
[stretchable-width any/c #t]
[stretchable-height any/c #t]]{
@defconstructor[([label label-string?]
[parent (or/c (is-a/c frame%) (is-a/c dialog%) false/c) #f]
[width (or/c (integer-in 0 10000) false/c) #f]
[height (or/c (integer-in 0 10000) false/c) #f]
[x (or/c (integer-in 0 10000) false/c) #f]
[y (or/c (integer-in 0 10000) false/c) #f]
[style (listof (one-of/c 'no-caption 'resize-border 'no-sheet)) null]
[enabled any/c #t]
[border (integer-in 0 1000) 0]
[spacing (integer-in 0 1000) 0]
[alignment (list/c (one-of/c 'left 'center 'right)
(one-of/c 'top 'center 'bottom))
'(center top)]
[min-width (integer-in 0 10000) _graphical-minimum-width]
[min-height (integer-in 0 10000) _graphical-minimum-height]
[stretchable-width any/c #t]
[stretchable-height any/c #t])]{
The @scheme[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[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. Under
Windows, if @scheme[parent] is an existing frame, the new dialog is
always on top of its parent. Under Windows and X, a dialog is
iconized when its parent is iconized.
The @scheme[parent] argument can be @scheme[#f] or an existing
frame. Under Windows, if @scheme[parent] is an existing frame, the
new dialog is always on top of its parent. Under Windows and X, a
dialog is iconized when its parent is iconized.
If @scheme[parent] is @scheme[#f], then the eventspace for the new dialog is
the current eventspace, as determined by
@scheme[current-eventspace] . Otherwise, @scheme[parent]'s eventspace is the new dialog's eventspace.
If @scheme[parent] is @scheme[#f], then the eventspace for the new
dialog is the current eventspace, as determined by
@scheme[current-eventspace]. Otherwise, @scheme[parent]'s eventspace
is the new dialog's eventspace.
If the @scheme[width] or @scheme[height] argument is not @scheme[#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. Under Windows and Mac OS X (and with some X window
managers) dialogs are not resizeable.
If the @scheme[width] or @scheme[height] argument is not @scheme[#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. Under Windows and Mac OS X (and with some X window managers)
dialogs are not resizeable.
If the @scheme[x] or @scheme[y] argument is not @scheme[#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).
If the @scheme[x] or @scheme[y] argument is not @scheme[#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).
The @scheme[style] flags adjust the appearance of the dialog on some
platforms:
@itemize{
@item{@scheme['no-caption] --- omits the title bar for the dialog
@ -72,23 +76,33 @@ Even if the dialog is not shown, a few notification events may be
handled, or the dialog's eventspace is shut down.
@WindowKWs[] @AreaContKWs[] @AreaKWs[]
}
@defmethod[#:mode 'override
(on-subwindow-char [receiver (is-a/c window<%>)]
[event (is-a/c key-event%)])
boolean?]{
Returns the result of
@schemeblock[
(or (send this #,(:: top-level-window<%> on-system-menu-char) event)
(send this #,(:: top-level-window<%> on-traverse-char) event))
]
}
@defmethod[#:mode 'auto-super
(show [show? any/c])
void?]{
@impl{
If @scheme[show?]\ is true, the dialog is shown and all frames (and other
If @scheme[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 @scheme[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,
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]
@ -96,22 +110,5 @@ If @scheme[show?]\ is true, the method does not immediately return. Instead,
}}
@defmethod[#:mode 'override
(on-subwindow-char [receiver (is-a/c window<%>)]
[event (is-a/c key-event%)])
boolean?]{
@impl{
Returns the result of
\scmline{(or (send @scheme[this]
@method[top-level-window<%> on-system-menu-char] @scheme[event]) \\
\>(send @scheme[this]
@method[top-level-window<%> on-traverse-char] @scheme[event]))}
}}}
}
}

View File

@ -9,14 +9,14 @@ These functions get input from the user and/or display
@defproc[(get-file [message (or/c string false/c) #f]
@defproc[(get-file [message (or/c string? false/c) #f]
[parent (or/c (is-a/c frame%) (is-a/c dialog%) false/c) #f]
[directory (or/c path false/c) #f]
[filename (or/c path false/c) #f]
[extension (or/c string false/c) #f]
[style (listof (symbols/c enter-packages packages)) null]
[directory (or/c path-string? false/c) #f]
[filename (or/c path-string? false/c) #f]
[extension (or/c string? false/c) #f]
[style (listof (one-of/c 'packages 'enter-packages)) null]
[filters (listof (list/c string? string?)) @scheme['(("Any" "*.*"))]])
(or/c path false/c)]{
(or/c path? false/c)]{
Obtains a file pathname from the user via the platform-specific
standard (modal) dialog, using @scheme[parent] as the parent window if
@ -62,28 +62,28 @@ See also @scheme[path-dialog%].
}
@defproc[(get-file-list [message (or/c string false/c) #f]
@defproc[(get-file-list [message (or/c string? false/c) #f]
[parent (or/c (is-a/c frame%) (is-a/c dialog%) false/c) #f]
[directory (or/c path false/c) #f]
[filename (or/c path false/c) #f]
[extension (or/c string false/c) #f]
[directory (or/c path-string? false/c) #f]
[filename (or/c path-string? false/c) #f]
[extension (or/c string? false/c) #f]
[style null? null]
[filters (listof (list/c string? string?)) @scheme['(("Any" "*.*"))]])
(or/c list of paths false/c)]{
(or/c (listof path?) false/c)]{
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].
}
@defproc[(put-file [message (or/c string false/c) #f]
@defproc[(put-file [message (or/c string? false/c) #f]
[parent (or/c (is-a/c frame%) (is-a/c dialog%) false/c) #f]
[directory (or/c path false/c) #f]
[filename (or/c path false/c) #f]
[extension (or/c string false/c) #f]
[style (listof (symbols/c enter-packages packages)) null]
[directory (or/c path-string? false/c) #f]
[filename (or/c path-string? false/c) #f]
[extension (or/c string? false/c) #f]
[style (listof (one-of/c 'packages 'enter-packages)) null]
[filters (listof (list/c string? string?)) @scheme['(("Any" "*.*"))]])
(or/c path false/c)]{
(or/c path? false/c)]{
Obtains a file pathname from the user via the platform-specific
standard (modal) dialog, using @scheme[parent] as the parent window if
@ -136,10 +136,10 @@ See also @scheme[path-dialog%].
}
@defproc[(get-directory [message (or/c string false/c) #f]
@defproc[(get-directory [message (or/c string? false/c) #f]
[parent (or/c (is-a/c frame%) (is-a/c dialog%) false/c) #f]
[directory (or/c path false/c) #f]
[style (listof (symbols/c enter-packages)) null])
[directory (or/c path? false/c) #f]
[style (listof (one-of/c 'enter-packages)) null])
(or/c path false/c)]{
Obtains a directory pathname from the user via the platform-specific
@ -169,8 +169,8 @@ See also @scheme[path-dialog%].
@defproc[(message-box [title label-string?]
[message string]
[parent (or/c (is-a/c frame%) (is-a/c dialog%) false/c) #f]
[style (listof (symbols/c stop caution yes-no ok-cancel ok)) '(ok)])
(symbols/c no yes cancel ok)]{
[style (listof (one-of/c 'ok 'ok-cancel 'yes-no 'caution 'stop)) '(ok)])
(one-of/c 'ok 'cancel 'yes 'no)]{
See also @scheme[message-box/custom].
@ -223,9 +223,9 @@ The class that implements the dialog provides a @scheme[get-message]
[button2-label (or/c label-string? (is-a/c bitmap%) false/c)]
[button3-label (or/c label-string? (is-a/c bitmap%) false/c)]
[parent (or/c (is-a/c frame%) (is-a/c dialog%) false/c) #f]
[style (listof (symbols/c stop caution number-order
disallow-close no-default
default=3 default=2 default=1))
[style (listof (one-of/c 'stop 'caution 'number-order
'disallow-close 'no-default
'default=1 'default=2 'default=3))
'(no-default)]
[close-result any/c #f])
(one-of/c 1 2 3 close-result)]{
@ -304,8 +304,10 @@ The class that implements the dialog provides a @scheme[get-message]
[message string]
[check-label label-string?]
[parent (or/c (is-a/c frame%) (is-a/c dialog%) false/c) #f]
[style (listof (symbols/c checked stop caution yes-no ok-cancel ok)) '(ok)])
(symbols/c no yes cancel ok)]{
[style (listof (one-of/c 'ok 'ok-cancel 'yes-no
'caution 'stop 'checked))
'(ok)])
(one-of/c 'ok 'cancel 'yes 'no)]{
See also @scheme[message+check-box/custom].
@ -326,9 +328,9 @@ Like @scheme[message-box], except that
[button2-label (or/c label-string? (is-a/c bitmap%) false/c)]
[button3-label (or/c label-string? (is-a/c bitmap%) false/c)]
[parent (or/c (is-a/c frame%) (is-a/c dialog%) false/c) #f]
[style (listof (symbols/c checked stop caution number-order
disallow-close no-default
default=3 default=2 default=1))
[style (listof (one-of/c 'stop 'caution 'number-order
'disallow-close 'no-default
'default=1 'default=2 'default=3))
'(no-default)]
[close-result any/c #f])
(one-of/c 1 2 3 close-result)]{
@ -348,11 +350,11 @@ Like @scheme[message-box/custom], except that
}
@defproc[(get-text-from-user [title string]
[message (or/c string false/c)]
[message (or/c string? false/c)]
[parent (or/c (is-a/c frame%) (is-a/c dialog%) false/c) #f]
[init-val string ""]
[style (listof (symbols/c password)) null])
(or/c string false/c)]{
[init-val string? ""]
[style (listof (one-of/c 'password)) null])
(or/c string? false/c)]{
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
@ -372,12 +374,12 @@ If @scheme[style] includes @scheme['password], the dialog's text field
}
@defproc[(get-choices-from-user [title string]
[message (or/c string false/c)]
[message (or/c string? false/c)]
[choices (listof string?)]
[parent (or/c (is-a/c frame%) (is-a/c dialog%) false/c) #f]
[init-choices (listof nonnegative-exact-integer?) null]
[style (listof (symbols/c extended multiple single)) '(single)])
(or/c list of {\NNInts} false/c)]{
[style (listof (one-of/c 'single 'multiple 'extended)) '(single)])
(or/c (listof nonnegative-exact-integer?) false/c)]{
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
@ -398,7 +400,7 @@ The result is @scheme[#f] if the user cancels the dialog, the
}
@defproc[(get-color-from-user [message (or/c string false/c) #f]
@defproc[(get-color-from-user [message (or/c string? false/c) #f]
[parent (or/c (is-a/c frame%) (is-a/c dialog%) false/c) #f]
[init-color (or/c (is-a/c color%) false/c) #f]
[style null? null])
@ -419,7 +421,7 @@ The result is @scheme[#f] if the user cancels the dialog, the selected
}
@defproc[(get-font-from-user [message (or/c string false/c) #f]
@defproc[(get-font-from-user [message (or/c string? false/c) #f]
[parent (or/c (is-a/c frame%) (is-a/c dialog%) false/c) #f]
[init-font (or/c (is-a/c font%) false/c) #f]
[style null? null])
@ -440,7 +442,7 @@ The result is @scheme[#f] if the user cancels the dialog, the selected
}
@defproc[(get-ps-setup-from-user [message (or/c string false/c) #f]
@defproc[(get-ps-setup-from-user [message (or/c string? false/c) #f]
[parent (or/c (is-a/c frame%) (is-a/c dialog%) false/c) #f]
[init-setup (or/c (is-a/c ps-setup%) false/c) #f]
[style null? null])
@ -463,7 +465,7 @@ The result is @scheme[#f] if the user cancels the dialog, , a
}
@defproc[(get-page-setup-from-user [message (or/c string false/c) #f]
@defproc[(get-page-setup-from-user [message (or/c string? false/c) #f]
[parent (or/c (is-a/c frame%) (is-a/c dialog%) false/c) #f]
[init-setup (or/c (is-a/c ps-setup%) false/c) #f]
[style null? null])

View File

@ -11,41 +11,30 @@ keyboard, mouse, or scroll event. See also
@scheme[scroll-event%].
@defconstructor[([time-stamp (and/c exact? integer?) 0])]{
@defconstructor[[time-stamp (and/c exact? integer?) 0]]{
See the corresponding @scheme[get-] and @scheme[set-] methods for
information about @scheme[time-stamp].
See @method[event% get-time-stamp] for information about
@scheme[time-stamp].
}
@defmethod[(get-time-stamp)
(and/c exact? integer?)]{
@spec{
Returns the time, in milliseconds, when the event occurred. This time
is compatible with times reported by MzScheme's
@scheme[current-milliseconds] procedure.
}}
}
@defmethod[(set-time-stamp [time (and/c exact? integer?)])
void?]{
@spec{
Set the time, in milliseconds, when the event occurred. See also
MzScheme's @scheme[current-milliseconds].
If the supplied value is outside the platform-specific range of time
values, @|MismatchExn|}.
values, @|MismatchExn|.
}
@impl{
}}}
}}

View File

@ -10,49 +10,56 @@ A frame is a top-level container window. It has a title bar (which
Under Windows, both Multiple Document Interface (MDI) and Single
Document Interface (SDI) frames are supported.
@defconstructor[([label label-string?]
[parent (or/c (is-a/c frame%) false/c) #f]
[width (or/c (integer-in 0 10000) false/c) #f]
[height (or/c (integer-in 0 10000) false/c) #f]
[x (or/c (integer-in -10000 10000) false/c) #f]
[y (or/c (integer-in -10000 10000) false/c) #f]
[style (listof (one-of/c 'no-resize-border 'no-caption
'no-system-menu 'hide-menu-bar
'mdi-parent 'mdi-child
'toolbar-button 'float 'metal)) null]
[enabled any/c #t]
[border (integer-in 0 1000) 0]
[spacing (integer-in 0 1000) 0]
[alignment (list/c (one-of/c 'left 'center 'right)
(one-of/c 'top 'center 'bottom))
'(center top)]
[min-width (integer-in 0 10000) _graphical-minimum-width]
[min-height (integer-in 0 10000) _graphical-minimum-height]
[stretchable-width any/c #t]
[stretchable-height any/c #t])]{
The @scheme[label] string is displayed in the frame's title
bar. If the frame'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. Under Windows, if @scheme[parent] is an existing frame,
the new frame is always on top of its parent. Also, the
@scheme[parent] frame may be an MDI parent frame from a new MDI
child frame. Under Windows and X (for many window managers), a
frame is iconized when its parent is iconized.
@defconstructor[[label label-string?]
[parent (or/c (is-a/c frame%) false/c) #f]
[width (or/c (integer-in 0 10000) false/c) #f]
[height (or/c (integer-in 0 10000) false/c) #f]
[x (or/c (integer-in -10000 10000) false/c) #f]
[y (or/c (integer-in -10000 10000) false/c) #f]
[style (symbols/c metal float hide-menu-bar toolbar-button mdi-child mdi-parent no-system-menu no-caption no-resize-border) null]
[enabled any/c #t]
[border (integer-in 0 1000) 0]
[spacing (integer-in 0 1000) 0]
[alignment two-element list: @scheme['left], @scheme['center], or @scheme['right] and @scheme['top], @scheme['center], or @scheme['bottom] '(center top)]
[min-width (integer-in 0 10000) {\rm graphical minimum width}]
[min-height (integer-in 0 10000) {\rm graphical minimum height}]
[stretchable-width any/c #t]
[stretchable-height any/c #t]]{
If @scheme[parent] is @scheme[#f], then the eventspace for the
new frame is the current eventspace, as determined by
@scheme[current-eventspace]. Otherwise, @scheme[parent]'s
eventspace is the new frame's eventspace.
The @scheme[label] string is displayed in the frame's title bar. If the
frame's label is changed (see
@method[window<%> set-label] ), the title bar is updated.
If the @scheme[width] or @scheme[height] argument is not
@scheme[#f], it specifies an initial size for the frame (in
pixels) assuming that it is larger than the minimum size,
otherwise the minimum size is used.
The @scheme[parent] argument can be @scheme[#f] or an existing frame. Under
Windows, if @scheme[parent] is an existing frame, the new frame is
always on top of its parent. Also, the @scheme[parent] frame may be an
MDI parent frame from a new MDI child frame. Under Windows and X (for
many window managers), a frame is iconized when its parent is iconized.
If the @scheme[x] or @scheme[y] argument is not @scheme[#f], it
specifies an initial location for the frame. Otherwise, a
location is selected automatically (tiling frames and dialogs as
they are created).
If @scheme[parent] is @scheme[#f], then the eventspace for the new frame is
the current eventspace, as determined by
@scheme[current-eventspace] . Otherwise, @scheme[parent]'s eventspace is the new frame's eventspace.
The @scheme[style] flags adjust the appearance of the frame on
some platforms:
If the @scheme[width] or @scheme[height] argument is not @scheme[#f], it
specifies an initial size for the frame (in pixels) assuming that it
is larger than the minimum size, otherwise the minimum size is used.
If the @scheme[x] or @scheme[y] argument is not @scheme[#f], it specifies an
initial location for the frame. Otherwise, a location is selected
automatically (tiling frames and dialogs as they are created).
The @scheme[style] flags adjust the appearance of the frame on some
platforms:
@itemize{
@item{@scheme['no-resize-border] --- omits the resizeable border
@ -78,26 +85,26 @@ The @scheme[style] flags adjust the appearance of the frame on some
@item{@scheme['toolbar-button] --- includes a toolbar button on the
frame's title bar (Mac OS X); a click on the toolbar button triggers
a call to
@method[frame% on-toolbar-button-click]}
a call to @method[frame% on-toolbar-button-click]}
@item{@scheme['hide-menu-bar] --- hides the menu bar and dock when
the frame is active (Mac OS X)}
@item{@scheme['float] --- causes the frame to stay in front of all
other non-floating windows (Windows and Mac OS X always, X when
combined with @scheme['no-caption]); under Mac OS X, a floating
frame shares the focus with an active non-floating frame; when this
style is combined with @scheme['no-caption], then showing the frame
does not cause the keyboard focus to shift to the window, and under
X, clicking the frame does not move the focus}
combined with @scheme['no-caption]); under Mac OS X, a floating frame
shares the focus with an active non-floating frame; when this style
is combined with @scheme['no-caption], then showing the frame does
not cause the keyboard focus to shift to the window, and under X,
clicking the frame does not move the focus}
@item{@scheme['metal] --- draws the frame with a brushed-metal
background (Mac OS X); this style is ignored when
@scheme['no-caption] is specified}
}
If the @scheme['mdi-child] style is specified, the @scheme[parent] must be
a frame with the @scheme['mdi-parent] style, otherwise @|MismatchExn|}.
a frame with the @scheme['mdi-parent] style, otherwise @|MismatchExn|.
Even if the frame is not shown, a few notification events may be
queued for the frame on creation. Consequently, the new frame's
@ -106,44 +113,166 @@ Even if the frame is not shown, a few notification events may be
@WindowKWs[] @AreaContKWs[] @AreaKWs[]
}
@defmethod[(create-status-line)
void?]{
@impl{
Creates a status line at the bottom of the frame. The width of the
status line is the whole width of the frame (adjusted automatically
when resizing), and the height and text size are platform-specific.
See also
@method[frame% set-status-text].
See also @method[frame% set-status-text].
}}
}
@defmethod[(get-menu-bar)
(or/c (is-a/c menu-bar%) false/c)]{
@spec{
Returns the frame's menu bar, or @scheme[#f] if none has been created
for the frame.
}
@defmethod[(has-status-line?)
boolean?]{
Returns @scheme[#t] if the frame's status line has been created,
@scheme[#f] otherwise. See also @method[frame% create-status-line].
}
@defmethod[(iconize [iconize? any/c])
void?]{
Iconizes (@as-index{minimizes}) or deiconizes (restores) the
frame. Deiconizing brings the frame to the front.
@Unmonitored[@elem{A frame's iconization} @elem{the user} @elem{a
frame has been iconized} @elem{@method[frame% is-iconized?]}]
}
@defmethod[(is-iconized?)
boolean?]{
Returns @scheme[#t] if the frame is iconized (minimized), @scheme[#f]
otherwise.
}
@defmethod[(is-maximized?)
boolean?]{
Under Windows and Mac OS X, returns @scheme[#t] if the frame is
maximized, @scheme[#f] otherwise. Under X, the result is always
@scheme[#f].
}
@defmethod[(maximize [maximize? any/c])
void?]{
@methspec{
Maximizes or restores the frame under Windows and Mac OS X; the
frame's show state is not affected. Under Windows, an iconized frame
cannot be maximized or restored.
@MonitorMethod[@elem{A window's maximization} @elem{the user} @elem{@method[window<%> on-size]} @elem{size}]
}
@methimpl{
If @scheme[maximize?] is @scheme[#f], the window is restored, otherwise
it is maximized.
}}
@defmethod*[([(modified)
boolean?]
[(modified [modified? any/c])
void?])]{
Gets or sets the frame's modification state as reflected to the user.
Under Mac OS X, the modification state is reflected as a dot in the
frame's close button. Under Windows and X, the modification state is
reflected by an asterisk at the end of the frame's displayed title.
}
@defmethod[(on-mdi-activate [active? any/c])
void?]{
Called under Windows when a MDI-child frame becomes the active frame
within its parent (in which case the argument is @scheme[#t]), or when
the child frame ceases to be the active frame (in which case the
argument is @scheme[#f]).
MDI activation is different from keyboard-focus activation. If the
parent frame is the frontmost top-level frame, so that the MDI child
gets or loses the keyboard focus, then a separate
@method[top-level-window<%> on-activate] notification is sent to the MDI-child frame.
}
@defmethod[(on-menu-char [event (is-a/c key-event%)])
boolean?]{
If the frame has a menu bar with keyboard shortcuts, and if the key
event includes a Control, Alt, Option, Meta, Command, Shift, or
Function key, then @method[frame% on-menu-char] attempts to match the
given event to a menu item. If a match is found, @scheme[#t] is
returned, otherwise @scheme[#f] is returned.
When the match corresponds to a complete shortcut combination, the
menu item's callback is called (before
@method[frame% on-menu-char] returns).
If the event does not correspond to a complete shortcut combination,
the event may be handled anyway if it corresponds to a mnemonic in the
menu bar (i.e., an underlined letter in a menu's title, which is
installed by including an ampersand in the menu's label). If a
mnemonic match is found, the keyboard focus is moved to the menu bar
(selecting the menu with the mnemonic), and @scheme[#t] is returned.
}
@defmethod[#:mode 'override
(on-subwindow-char [receiver (is-a/c window<%>)]
[event (is-a/c key-event%)])
boolean?]{
Returns the result of
@schemeblock[
(or (send this (:: frame% on-menu-char) event)
(send this (:: top-level-window<%> on-system-menu-char) event)
(send this (:: top-level-window<%> on-traverse-char) event))
]
}
@defmethod[(on-toolbar-button-click)
void?]{
Under Mac OS X, called when the user clicks the toolbar button on a
frame created with the @indexed-scheme['toolbar-button] style.
}
@defmethod[(set-icon [icon (is-a/c bitmap%)]
[mask (is-a/c bitmap%) #f]
[which (symbols/c both large small) 'both])
[which (one-of/c 'small 'large 'both) 'both])
void?]{
@spec{
Sets the large or small icon bitmap for this frame. Future changes to
the bitmap do not affect the frame's icon.
The icon is used in a platform-specific way:
@itemize{
@item{Windows --- the small icon is used for the frame's icon (in the
@ -170,171 +299,13 @@ If a mask bitmap is provided, the mask must be monochrome. In the mask
pixels outside the icon's region. In the icon bitmap, use black
pixels for the region outside the icon.
}}
}
@defmethod[(set-status-text [text string])
void?]{
@spec{
Sets the frame's status line text and redraws the status line. See
also
@method[frame% create-status-line].
also @method[frame% create-status-line].
}}
@defmethod[(has-status-line?)
boolean?]{
@spec{
Returns @scheme[#t] if the frame's status line has been created,
@scheme[#f] otherwise. See
also
@method[frame% create-status-line].
}}
@defmethod[(iconize [iconize? any/c])
void?]{
@spec{
Iconizes (\first{minimizes}) or deiconizes (restores) the frame. Deiconizing
brings the frame to the front.
@Unmonitored[@elem{A frame's iconization} @elem{the user} @elem{a frame has been iconized} @elem{@method[frame% is-iconized?]}]
}}
@defmethod[(is-iconized?)
boolean?]{
@spec{
Returns @scheme[#t] if the frame is iconized (minimized), @scheme[#f] otherwise.
}}
@defmethod[(maximize [maximize? any/c])
void?]{
@spec{
Maximizes or restores the frame under Windows and Mac OS X; the
frame's show state is not affected. Under Windows, an iconized frame
cannot be maximized or restored.
@MonitorMethod[@elem{A window's maximization} @elem{the user} @elem{@method[window<%> on-size]} @elem{size}]
}
@impl{
If @scheme[maximize?] is @scheme[#f], the window is restored, otherwise
it is maximized.
}}
@defmethod[(is-maximized?)
boolean?]{
@spec{
Under Windows and Mac OS X, returns @scheme[#t] if the frame is maximized,
@scheme[#f] otherwise. Under X, the result is always @scheme[#f].
}}
@defmethod[(on-mdi-activate [active? any/c])
void?]{
@spec{
Called under Windows when a MDI-child frame becomes the active frame
within its parent (in which case the argument is @scheme[#t]), or when
the child frame ceases to be the active frame (in which case the
argument is @scheme[#f]).
MDI activation is different from keyboard-focus activation. If the
parent frame is the frontmost top-level frame, so that the MDI child
gets or loses the keyboard focus, then a separate
@method[top-level-window<%> on-activate] notification is sent to the MDI-child frame.
}}
@defmethod[(on-menu-char [event (is-a/c key-event%)])
boolean?]{
@spec{
If the frame has a menu bar with keyboard shortcuts, and if the key
event includes a Control, Alt, Option, Meta, Command, Shift, or
Function key, then
@method[frame% on-menu-char] attempts to match the given event to a menu item. If a match is found,
@scheme[#t] is returned, otherwise @scheme[#f] is returned.
When the match corresponds to a complete shortcut combination, the
menu item's callback is called (before
@method[frame% on-menu-char] returns).
If the event does not correspond to a complete shortcut combination,
the event may be handled anyway if it corresponds to a mnemonic in the
menu bar (i.e., an underlined letter in a menu's title, which is
installed by including an ampersand in the menu's label). If a
mnemonic match is found, the keyboard focus is moved to the menu bar
(selecting the menu with the mnemonic), and @scheme[#t] is returned.
}}
@defmethod[#:mode 'override
(on-subwindow-char [receiver (is-a/c window<%>)]
[event (is-a/c key-event%)])
boolean?]{
@impl{
Returns the result of
\scmline{(or (send @scheme[this]
@method[frame% on-menu-char] @scheme[event]) \\
\>(send @scheme[this]
@method[top-level-window<%> on-system-menu-char] @scheme[event])\\
\>(send @scheme[this]
@method[top-level-window<%> on-traverse-char] @scheme[event]))}
}}
@defmethod[(on-toolbar-button-click)
void?]{
@spec{
Under Mac OS X, called when the user clicks the toolbar button on a
frame created with the @indexed-scheme['toolbar-button] style.
}}
@defmethod*[([(modified)
boolean?]
[(modified [modified? any/c])
void?])]{
@spec{
Gets or sets the frame's modification state as reflected to the user.
Under Mac OS X, the modification state is reflected as a dot in the
frame's close button. Under Windows and X, the modification state is
reflected by an asterisk at the end of the frame's displayed title.
}
@impl{
First case:
Returns the current displayed modification state.
Second case:
Sets the displayed modification state.
}}}

View File

@ -4,38 +4,40 @@
@defclass[gauge% object% (control<%>)]{
A gauge is a horizontal or vertical bar for displaying the output
value of a bounded integer quantity. Each gauge has an adjustable
range, and the gauge's current value is always between 0 and its
range, inclusive. Use
@method[gauge% set-value] to set the value of the gauge.
value of a bounded integer quantity. Each gauge has an adjustable
range, and the gauge's current value is always between 0 and its
range, inclusive. Use @method[gauge% set-value] to set the value
of the gauge.
@defconstructor[[label (or/c label-string? false/c)]
[range (integer-in 1 10000)]
[parent (or/c (is-a/c frame%) (is-a/c dialog%) (is-a/c panel%) (is-a/c pane%))]
[style (symbols/c deleted horizontal-label vertical-label vertical horizontal) '(horizontal)]
[font (is-a/c font%) @scheme[normal-control-font]]
[enabled any/c #t]
[vert-margin (integer-in 0 1000) 2]
[horiz-margin (integer-in 0 1000) 2]
[min-width (integer-in 0 10000) {\rm graphical minimum width}]
[min-height (integer-in 0 10000) {\rm graphical minimum height}]
[stretchable-width any/c \#t {\rm for} @scheme['horizontal] {\rm style}, \#f {\rm for} @scheme['vertical]]
[stretchable-height any/c \#t {\rm for} @scheme['vertical] {\rm style}, \#f {\rm for} @scheme['horizontal]]]{
@defconstructor[([label (or/c label-string? false/c)]
[range (integer-in 1 10000)]
[parent (or/c (is-a/c frame%) (is-a/c dialog%)
(is-a/c panel%) (is-a/c pane%))]
[style (listof (one-of/c 'horizontal 'vertical
'vertical-label 'horizontal-label
'deleted))
'(horizontal)]
[font (is-a/c font%) @scheme[normal-control-font]]
[enabled any/c #t]
[vert-margin (integer-in 0 1000) 2]
[horiz-margin (integer-in 0 1000) 2]
[min-width (integer-in 0 10000) _graphical-minimum-width]
[min-height (integer-in 0 10000) _graphical-minimum-height]
[stretchable-width any/c (memq 'horizontal style)]
[stretchable-height any/c (memq 'vertical style)])]{
If @scheme[label] is a string, it is used as the gauge label; otherwise
the gauge does not display a label.
@labelstripped[(scheme label) @elem{gauge}]
@labelstripped[(scheme label) "" @elem{gauge}]
The @scheme[range] argument is an integer specifying the maximum value of
the gauge (inclusive). The minimum gauge value is always @scheme[0].
The @scheme[style] list must include either @scheme['horizontal],
specifying a horizontal gauge, or @scheme['vertical], specifying
a vertical gauge. \HVLabelNote{gauge} \DeletedStyleNote{gauge}
a vertical gauge. @HVLabelNote{gauge} @DeletedStyleNote{gauge}
@FontKWs[] @WindowKWs[] @SubareaKWs[] @AreaKWs[]
@ -43,43 +45,31 @@ The @scheme[style] list must include either @scheme['horizontal],
}
@defmethod[(set-range [range (integer-in 1 10000)])
void?]{
@spec{
Sets the range (maximum value) of the gauge.
}}
@defmethod[(get-range)
(integer-in 1 10000)]{
@spec{
Returns the range (maximum value) of the gauge.
}}
@defmethod[(set-value [pos (integer-in 0 10000)])
void?]{
@spec{
Sets the gauge's current value. If the specified value is larger than
the gauge's range, @|MismatchExn|}.
}}
}
@defmethod[(get-value)
(integer-in 0 10000)]{
@spec{
Returns the gauge's current value.
}
@impl{
@defmethod[(set-range [range (integer-in 1 10000)])
void?]{
Sets the range (maximum value) of the gauge.
}
@defmethod[(set-value [pos (integer-in 0 10000)])
void?]{
}}}
Sets the gauge's current value. If the specified value is larger than
the gauge's range, @|MismatchExn|.
}}

View File

@ -11,30 +11,30 @@ Unlike most panel classes, a group-box panel's horizontal and vertical
margins default to @scheme[2].
@defconstructor[[label label-string?]
[parent (or/c (is-a/c frame%) (is-a/c dialog%) (is-a/c panel%) (is-a/c pane%))]
[style (symbols/c deleted) null]
[font (is-a/c font%) @scheme[small-control-font]]
[enabled any/c #t]
[vert-margin (integer-in 0 1000) 2]
[horiz-margin (integer-in 0 1000) 2]
[border (integer-in 0 1000) 0]
[spacing (integer-in 0 1000) 0]
[alignment two-element list: @scheme['left], @scheme['center], or @scheme['right] and @scheme['top], @scheme['center], or @scheme['bottom] '(center top)]
[min-width (integer-in 0 10000) {\rm graphical minimum width}]
[min-height (integer-in 0 10000) {\rm graphical minimum height}]
[stretchable-width any/c #t]
[stretchable-height any/c #t]]{
@defconstructor[([label label-string?]
[parent (or/c (is-a/c frame%) (is-a/c dialog%)
(is-a/c panel%) (is-a/c pane%))]
[style (listof (one-of/c 'deleted)) null]
[font (is-a/c font%) @scheme[small-control-font]]
[enabled any/c #t]
[vert-margin (integer-in 0 1000) 2]
[horiz-margin (integer-in 0 1000) 2]
[border (integer-in 0 1000) 0]
[spacing (integer-in 0 1000) 0]
[alignment (list/c (one-of/c 'left 'center 'right)
(one-of/c 'top 'center 'bottom))
'(center top)]
[min-width (integer-in 0 10000) _graphical-minimum-width]
[min-height (integer-in 0 10000) _graphical-minimum-height]
[stretchable-width any/c #t]
[stretchable-height any/c #t])]{
Creates a group pane whose title is @scheme[label].
\DeletedStyleNote{group panel}
@DeletedStyleNote{group panel}
@FontKWs[] @WindowKWs[] @SubareaKWs[] @AreaKWs[]
}}

View File

@ -13,10 +13,8 @@ A @scheme[grow-box-spacer-pane%] object is intended for use as a
@scheme[grow-box-spacer-pane%] is unstretchable by default.
@defconstructor/auto-super[()]{
See @scheme[pane%] for information on initialization arguments.
@defconstructor/auto-super[[#f unknown]]{
Passes all arguments to @scheme[super-init].
}}

View File

@ -7,22 +7,21 @@ A horizontal pane arranges its subwindows in a single row. See also
@scheme[pane%].
@defconstructor[[parent (or/c (is-a/c frame%) (is-a/c dialog%) (is-a/c panel%) (is-a/c pane%))]
[vert-margin (integer-in 0 1000) 0]
[horiz-margin (integer-in 0 1000) 0]
[border (integer-in 0 1000) 0]
[spacing (integer-in 0 1000) 0]
[alignment two-element list: @scheme['left], @scheme['center], or @scheme['right] and @scheme['top], @scheme['center], or @scheme['bottom] '(left center)]
[min-width (integer-in 0 10000) {\rm graphical minimum width}]
[min-height (integer-in 0 10000) {\rm graphical minimum height}]
[stretchable-width any/c #t]
[stretchable-height any/c #t]]{
@defconstructor[([parent (or/c (is-a/c frame%) (is-a/c dialog%)
(is-a/c panel%) (is-a/c pane%))]
[vert-margin (integer-in 0 1000) 0]
[horiz-margin (integer-in 0 1000) 0]
[border (integer-in 0 1000) 0]
[spacing (integer-in 0 1000) 0]
[alignment (list/c (one-of/c 'left 'center 'right)
(one-of/c 'top 'center 'bottom))
'(left center)]
[min-width (integer-in 0 10000) _graphical-minimum-width]
[min-height (integer-in 0 10000) _graphical-minimum-height]
[stretchable-width any/c #t]
[stretchable-height any/c #t])]{
@SubareaKWs[] @AreaContKWs[] @AreaKWs[]
}}

View File

@ -6,25 +6,25 @@
A horizontal panel arranges its subwindows in a single row. See also
@scheme[panel%].
@defconstructor[[parent (or/c (is-a/c frame%) (is-a/c dialog%) (is-a/c panel%) (is-a/c pane%))]
[style (symbols/c deleted border) null]
[enabled any/c #t]
[vert-margin (integer-in 0 1000) 0]
[horiz-margin (integer-in 0 1000) 0]
[border (integer-in 0 1000) 0]
[spacing (integer-in 0 1000) 0]
[alignment two-element list: @scheme['left], @scheme['center], or @scheme['right] and @scheme['top], @scheme['center], or @scheme['bottom] '(left center)]
[min-width (integer-in 0 10000) {\rm graphical minimum width}]
[min-height (integer-in 0 10000) {\rm graphical minimum height}]
[stretchable-width any/c #t]
[stretchable-height any/c #t]]{
@defconstructor[([parent (or/c (is-a/c frame%) (is-a/c dialog%)
(is-a/c panel%) (is-a/c pane%))]
[style (listof (one-of/c 'border 'deleted)) null]
[enabled any/c #t]
[vert-margin (integer-in 0 1000) 0]
[horiz-margin (integer-in 0 1000) 0]
[border (integer-in 0 1000) 0]
[spacing (integer-in 0 1000) 0]
[alignment (list/c (one-of/c 'left 'center 'right)
(one-of/c 'top 'center 'bottom))
'(left center)]
[min-width (integer-in 0 10000) _graphical-minimum-width]
[min-height (integer-in 0 10000) _graphical-minimum-height]
[stretchable-width any/c #t]
[stretchable-height any/c #t])]{
If the @scheme['border] style is specified, the window is created with
a thin border (only in this case, the client size of the panel may be
less than its total size). \DeletedStyleNote{panel}
less than its total size). @DeletedStyleNote{panel}
@WindowKWs[] @SubareaKWs[] @AreaContKWs[] @AreaKWs[]

View File

@ -16,130 +16,57 @@ For a key-press event, a virtual key code is provided by
See also @|mousekeydiscuss|.
@defconstructor[([key-code (or/c char? symbol?) #\nul]
[shift-down any/c #f]
[control-down any/c #f]
[meta-down any/c #f]
[alt-down any/c #f]
[x (and/c exact? integer?) 0]
[y (and/c exact? integer?) 0]
[time-stamp (and/c exact? integer?) 0]
[caps-down any/c #f])]{
@defconstructor[[key-code character or symbol \#{\TTBackslash}nul]
[shift-down any/c #f]
[control-down any/c #f]
[meta-down any/c #f]
[alt-down any/c #f]
[x (and/c exact? integer?) 0]
[y (and/c exact? integer?) 0]
[time-stamp (and/c exact? integer?) 0]
[caps-down any/c #f]]{
See the corresponding @schemeidfont{get-} and @schemeidfont{set-}
methods for information about @scheme[key-code], @scheme[shift-down],
@scheme[control-down], @scheme[meta-down], @scheme[alt-down],
@scheme[x], @scheme[y], @scheme[time-stamp], @scheme[caps-down].
See the corresponding @scheme[get-] and @scheme[set-] methods for
information about @scheme[key-code], @scheme[shift-down],
@scheme[control-down], @scheme[meta-down], @scheme[alt-down], @scheme[x],
@scheme[y], @scheme[time-stamp], @scheme[caps-down].
The release key code, as returned by @method[key-event%
get-key-release-code], is initialized to @scheme['press].
The release key code, as returned by
@method[key-event% get-key-release-code], is initialized to @scheme['press].
}
@defmethod[(get-alt-down)
boolean?]{
Returns @scheme[#t] if the Option (Mac OS X) key was down for
the event. When the Alt key is pressed in Windows, it is reported as
a Meta press (see
@method[key-event% get-meta-down]).
}
@defmethod[(get-caps-down)
boolean?]{
Returns @scheme[#t] if the Caps Lock key was on for the event.
}
@defmethod[(get-control-down)
boolean?]{
@spec{
Returns @scheme[#t] if the Control key was down for the event.
Under Mac OS X, if a control-key press is combined with a mouse button
click, the event is reported as a right-button click and
@method[key-event% get-control-down] for the event reports @scheme[#f].
}}
@defmethod[(set-control-down [down? any/c])
void?]{
@spec{
Sets whether the Control key was down for the event.
Under Mac OS X, if a control-key press is combined with a mouse button
click, the event is reported as a right-button click and
@method[key-event% get-control-down] for the event reports @scheme[#f].
}}
@defmethod[(get-shift-down)
boolean?]{
@spec{
Returns @scheme[#t] if the Shift key was down for the event.
}}
@defmethod[(set-shift-down [down? any/c])
void?]{
@spec{
Sets whether the Shift key was down for the event.
}}
@defmethod[(get-alt-down)
boolean?]{
@spec{
Returns @scheme[#t] if the Option (Mac OS X) key was down for
the event. When the Alt key is pressed in Windows, it is reported as
a Meta press (see
@method[key-event% get-meta-down]).
}}
@defmethod[(set-alt-down [down? any/c])
void?]{
@spec{
Sets whether the Option (Mac OS X) key was down for the event.
When the Alt key is pressed in Windows, it is reported as
a Meta press (see
@method[key-event% set-meta-down]).
}}
@defmethod[(get-meta-down)
boolean?]{
@spec{
Returns @scheme[#t] if the Meta (X), Alt (Windows), or Command (Mac OS X)
key was down for the event.
}}
@defmethod[(set-meta-down [down? any/c])
void?]{
@spec{
Sets whether the Meta (X), Alt (Windows), or Command (Mac OS X) key was
down for the event.
}}
@defmethod[(get-caps-down)
boolean?]{
@spec{
Returns @scheme[#t] if the Caps Lock key was on for the event.
}}
@defmethod[(set-caps-down [down? any/c])
void?]{
@spec{
Sets whether the Caps Lock key was on for the event.
}}
}
@defmethod[(get-key-code)
character or symbol]{
@spec{
(or/c char? symbol?)]{
Gets the virtual key code for the key event. The virtual key code is
either a character or a special key symbol, one of the following:
@itemize{
@item{@indexed-scheme['start]}
@item{@indexed-scheme['cancel]}
@ -207,33 +134,35 @@ Gets the virtual key code for the key event. The virtual key code is
@item{@indexed-scheme['f24]}
@item{@indexed-scheme['numlock]}
@item{@indexed-scheme['scroll]}
@item{@indexed-scheme['wheel-up] --- \index{wheel on mouse} mouse wheel up one notch}
@item{@indexed-scheme['wheel-up] --- \index["wheel on mouse"]{mouse} wheel up one notch}
@item{@indexed-scheme['wheel-down] --- mouse wheel down one notch}
@item{@indexed-scheme['release] --- indicates a key-release event}
@item{@indexed-scheme['press] --- indicates a key-press event; usually only from @scheme[get-key-release-code]}
}
The special key symbols attempt to capture useful keys that have no
standard ASCII representation. A few keys have standard
representations that are not obvious:
@itemize{
@item{@scheme[#{\TTBackslash]space} --- the space bar}
@item{@scheme[#\space] --- the space bar}
@item{@scheme[#{\TTBackslash]return} --- the Enter or Return key (on all
@item{@scheme[#\return] --- the Enter or Return key (on all
platforms), but not necessarily the Enter key near the numpad
(which is reported as @scheme['numpad-enter] if the platform
distinguishes the two Enter keys)}
@item{@scheme[#{\TTBackslash]tab} --- the tab key}
@item{@scheme[#\tab] --- the tab key}
@item{@scheme[#{\TTBackslash]backspace} --- the backspace key}
@item{@scheme[#\backspace] --- the backspace key}
@item{@scheme[#{\TTBackslash]rubout} --- the delete key}
@item{@scheme[#\rubout] --- the delete key}
}
If a suitable special key symbol or ASCII representation is not
available, @scheme[#{\TTBackslash]nul} (the null character) is
reported.
available, @scheme[#\nul] (the NUL character) is reported.
Under X, a @scheme['wheel-up] or @scheme['wheel-down] event may be sent
to a window other than the one with the keyboard focus, because X
@ -244,75 +173,80 @@ Under Windows, when the Control key is pressed without Alt, the key
of the Shift key. Under Mac OS X, the key code is computed without
Caps Lock effects when the Control or Command key is pressed; in the
case of Control, Caps Lock is used normally if special handling is
disabled for the Control key via
@scheme[special-control-key]. Under X, the key code is computed with Caps Lock effects when the
Control key is pressed without Alt.
disabled for the Control key via @scheme[special-control-key]. Under
X, the key code is computed with Caps Lock effects when the Control
key is pressed without Alt.
See also
@method[key-event% get-other-shift-key-code].
See also @method[key-event% get-other-shift-key-code].
}}
@defmethod[(set-key-code [code character or symbol])
void?]{
@spec{
Sets the virtual key code for the event, either a character or one
of the special symbols listed with
@method[key-event% get-key-code].
}}
}
@defmethod[(get-key-release-code)
character or symbol]{
@spec{
(or/c char? symbol?)]{
Gets the virtual key code for a key-release event; the result is
@scheme['press] for a key-press event. See
@method[key-event% get-key-code] for the list of virtual key codes.
@scheme['press] for a key-press event. See @method[key-event%
get-key-code] for the list of virtual key codes.
}}
}
@defmethod[(set-key-release-code [code character or symbol])
void?]{
@spec{
@defmethod[(get-meta-down)
boolean?]{
Sets the virtual key code for a release event, either a character or
one of the special symbols listed with
@method[key-event% get-key-code]. See also
@method[key-event% get-key-release-code].
Returns @scheme[#t] if the Meta (X), Alt (Windows), or Command (Mac OS
X) key was down for the event.
}}
}
@defmethod[(get-other-altgr-key-code)
(or/c char? symbol? false/c)]{
See @method[key-event% get-other-shift-key-code].
}
@defmethod[(get-other-caps-key-code)
(or/c char? symbol? false/c)]{
See @method[key-event% get-other-shift-key-code].
}
@defmethod[(get-other-shift-altgr-key-code)
(or/c char? symbol? false/c)]{
See @method[key-event% get-other-shift-key-code].
}
@defmethod[(get-other-shift-key-code)
(or/c character, symbol, false/c)]{
@spec{
(or/c char? symbol? false/c)]{
Since keyboard mappings vary, it is sometimes useful in key mappings
for a program to know the result that the keyboard would have
produced for an event if the Shift key had been toggled differently. The
@method[key-event% get-other-shift-key-code] produces that other mapping,
returning @scheme[#f] if the alternate mapping is
unavailable, otherwise returning the same kind of result as
@method[key-event% get-key-code].
produced for an event if the Shift key had been toggled
differently. The @method[key-event% get-other-shift-key-code]
produces that other mapping, returning @scheme[#f] if the alternate
mapping is unavailable, otherwise returning the same kind of result
as @method[key-event% get-key-code].
The
@method[key-event% get-other-altgr-key-code] method provides the same information with respect to the AltGr key
(i.e., Alt combined with Control) under Windows and X, or the Option
key under Mac OS X. The
@method[key-event% get-other-shift-altgr-key-code] method reports a mapping for in tha case that both Shift and AltGr/Option
were different from the actual event.
The @method[key-event% get-other-altgr-key-code] method provides the
same information with respect to the AltGr key (i.e., Alt combined
with Control) under Windows and X, or the Option key under Mac OS
X. The @method[key-event% get-other-shift-altgr-key-code] method
reports a mapping for in tha case that both Shift and AltGr/Option
were different from the actual event.
The
@method[key-event% get-other-shift-key-code],
@method[key-event% get-other-altgr-key-code], and
@method[key-event% get-other-shift-altgr-key-code] results all report key mappings where Caps Lock is off, independent
of whether Caps Lock was on for the actual event. The
@method[key-event% get-other-caps-key-code] method reports a mapping for in that case that the Caps Lock state
was treated opposite as for the
@method[key-event% get-key-code] result. (Caps Lock normally has either no effect or the same effect
as Shift, so further combinations involving Caps Lock and other
modifier keys would not normally produce further alternatives.)
The @method[key-event% get-other-shift-key-code], @method[key-event%
get-other-altgr-key-code], and @method[key-event%
get-other-shift-altgr-key-code] results all report key mappings where
Caps Lock is off, independent of whether Caps Lock was on for the
actual event. The @method[key-event% get-other-caps-key-code] method
reports a mapping for in that case that the Caps Lock state was
treated opposite as for the @method[key-event% get-key-code]
result. (Caps Lock normally has either no effect or the same effect as
Shift, so further combinations involving Caps Lock and other modifier
keys would not normally produce further alternatives.)
Alternate mappings are not available for all events. Under Windows,
alternate mappings are reported when they produce ASCII letters,
@ -320,111 +254,137 @@ Alternate mappings are not available for all events. Under Windows,
available only when the Command key is pressed. Under X, alternate
mappings are usually available.
}}
}
@defmethod[(set-other-shift-key-code [code (or/c character, symbol, false/c)])
void?]{
@spec{
@defmethod[(get-shift-down)
boolean?]{
Sets the key code produced by
@method[key-event% get-other-shift-key-code].
Returns @scheme[#t] if the Shift key was down for the event.
}}
@defmethod[(get-other-altgr-key-code)
(or/c character, symbol, false/c)]{
@spec{
See
@method[key-event% get-other-shift-key-code].
}}
@defmethod[(set-other-altgr-key-code [code (or/c character, symbol, false/c)])
void?]{
@spec{
Sets the key code produced by
@method[key-event% get-other-altgr-key-code].
}}
@defmethod[(get-other-shift-altgr-key-code)
(or/c character, symbol, false/c)]{
@spec{
See
@method[key-event% get-other-shift-key-code].
}}
@defmethod[(set-other-shift-altgr-key-code [code (or/c character, symbol, false/c)])
void?]{
@spec{
Sets the key code produced by
@method[key-event% get-other-shift-altgr-key-code].
}}
@defmethod[(get-other-caps-key-code)
(or/c character, symbol, false/c)]{
@spec{
See
@method[key-event% get-other-shift-key-code].
}}
@defmethod[(set-other-caps-key-code [code (or/c character, symbol, false/c)])
void?]{
@spec{
Sets the key code produced by
@method[key-event% get-other-caps-key-code].
}}
}
@defmethod[(get-x)
(and/c exact? integer?)]{
@spec{
Returns the x-position of the mouse at the time of the event, in the
target's window's (client-area) coordinate system.
}}
@defmethod[(set-x [pos (and/c exact? integer?)])
void?]{
@spec{
Sets the x-position of the mouse at the time of the event in the
target's window's (client-area) coordinate system.
}}
}
@defmethod[(get-y)
(and/c exact? integer?)]{
@spec{
Returns the y-position of the mouse at the time of the event in the
target's window's (client-area) coordinate system.
}}
}
@defmethod[(set-alt-down [down? any/c])
void?]{
Sets whether the Option (Mac OS X) key was down for the event. When
the Alt key is pressed in Windows, it is reported as a Meta press
(see @method[key-event% set-meta-down]).
}
@defmethod[(set-caps-down [down? any/c])
void?]{
Sets whether the Caps Lock key was on for the event.
}
@defmethod[(set-control-down [down? any/c])
void?]{
Sets whether the Control key was down for the event.
Under Mac OS X, if a control-key press is combined with a mouse button
click, the event is reported as a right-button click and
@method[key-event% get-control-down] for the event reports
@scheme[#f].
}
@defmethod[(set-key-code [code (or/c char? symbol?)])
void?]{
Sets the virtual key code for the event, either a character or one of
the special symbols listed with @method[key-event% get-key-code].
}
@defmethod[(set-key-release-code [code (or/c char? symbol?)])
void?]{
Sets the virtual key code for a release event, either a character or
one of the special symbols listed with @method[key-event%
get-key-code]. See also @method[key-event% get-key-release-code].
}
@defmethod[(set-meta-down [down? any/c])
void?]{
Sets whether the Meta (X), Alt (Windows), or Command (Mac OS X) key
was down for the event.
}
@defmethod[(set-other-altgr-key-code [code (or/c char? symbol? false/c)])
void?]{
Sets the key code produced by @method[key-event%
get-other-altgr-key-code].
}
@defmethod[(set-other-caps-key-code [code (or/c char? symbol? false/c)])
void?]{
Sets the key code produced by @method[key-event%
get-other-caps-key-code].
}
@defmethod[(set-other-shift-altgr-key-code [code (or/c char? symbol? false/c)])
void?]{
Sets the key code produced by @method[key-event%
get-other-shift-altgr-key-code].
}
@defmethod[(set-other-shift-key-code [code (or/c char? symbol? false/c)])
void?]{
Sets the key code produced by @method[key-event%
get-other-shift-key-code].
}
@defmethod[(set-shift-down [down? any/c])
void?]{
Sets whether the Shift key was down for the event.
}
@defmethod[(set-x [pos (and/c exact? integer?)])
void?]{
Sets the x-position of the mouse at the time of the event in the
target's window's (client-area) coordinate system.
}
@defmethod[(set-y [pos (and/c exact? integer?)])
void?]{
@spec{
Sets the y-position of the mouse at the time of the event in the
target's window's (client-area) coordinate system.
}
@impl{
}}}
}

View File

@ -11,61 +11,19 @@ A @scheme[labelled-menu-item<%>] object is a @scheme[menu-item<%>] with
@defmethod[(get-label)
label-string?]{
@spec{
Returns the item's label.
See also
@method[labelled-menu-item<%> set-label] and
@method[labelled-menu-item<%> get-plain-label].
}}
@defmethod[(set-label [label label-string?])
@defmethod[(enable [enabled? any/c])
void?]{
@spec{
Sets the menu item's label. If the item has a shortcut, the shortcut
is not affected.
Enables or disables the menu item. If the item is a submenu (or menu
in a menu bar), the entire menu is disabled, but each submenu item's
@method[labelled-menu-item<%> is-enabled?] method returns @scheme[#f]
only if the item is specifically disabled (in addition to the
submenu).
If the label contains an ampersand (``\&'') and the window is a
control, the label is parsed specially; under Windows and X, the
character following an ampersand is underlined in the displayed menu
to indicate a keyboard mnemonic. Pressing the Alt key with an
underlined character from a menu's name in the menu bar causes the
menu to be selected (via @method[frame% on-menu-char]). When
a menu has the focus, the mnemonic characters are used for navigation
without Alt. A double-ampersand in the label is replaced by a literal
(non-navigation) ampersand. Under Mac OS X, ampersands in the
label are parsed in the same way as for X and Windows, but no
mnemonic underline is displayed.
An ampersand is always preserved in the label returned by
@method[labelled-menu-item<%> get-label], but never preserved in the label returned by
@method[labelled-menu-item<%> get-plain-label].
For historical reasons, if a label contains a tab character, then the
tab and all remaining characters are hidden in the displayed menu.
}}
@defmethod[(get-plain-label)
label-string?]{
@spec{
Like
@method[labelled-menu-item<%> get-label], except that ampersands in the label are removed as described in
@method[labelled-menu-item<%> set-label].
}}
}
@defmethod[(get-help-string)
(or/c label-string? false/c)]{
@spec{
Returns the help string for the menu item, or @scheme[#f] if the item
has no help string.
@ -73,60 +31,93 @@ Returns the help string for the menu item, or @scheme[#f] if the item
When an item has a @scheme[help], the string may be used to
display help information to the user.
}}
}
@defmethod[(set-help-string [help (or/c label-string? false/c)])
void?]{
@spec{
@defmethod[(get-label)
label-string?]{
Sets the help string for the menu item. Use @scheme[#f] to remove
the help string for an item.
Returns the item's label.
}}
See also @method[labelled-menu-item<%> set-label] and
@method[labelled-menu-item<%> get-plain-label].
@defmethod[(enable [enabled? any/c])
void?]{
@spec{
Enables or disables the menu item. If the item is a submenu (or menu in
a menu bar), the entire menu is disabled, but each submenu item's
@method[labelled-menu-item<%> is-enabled?] method returns @scheme[#f] only if the item is specifically disabled (in
addition to the submenu).
}
}}
@defmethod[(get-plain-label)
label-string?]{
Like @method[labelled-menu-item<%> get-label], except that
@litchar{&}s in the label are removed as described in
@method[labelled-menu-item<%> set-label].
}
@defmethod[(is-enabled?)
boolean?]{
@spec{
Returns @scheme[#t] if the menu item is enabled, @scheme[#f] otherwise.
Returns @scheme[#t] if the menu item is enabled, @scheme[#f]
otherwise.
See also
@method[labelled-menu-item<%> enable].
}}
}
@defmethod[(on-demand)
void?]{
@spec{
@methspec{
Normally called when the user clicks on the menu bar containing the
item (before the user sees any menu items), just before the popup
menu containing the item is popped up, or just before inspecting the
menu bar containing the item for a shortcut key binding.
A
@xmethod[menu-item-container<%> on-demand] method can be overridden in such a way that the container does not
call the
A @xmethod[menu-item-container<%> on-demand] method can be overridden
in such a way that the container does not call the
@method[labelled-menu-item<%> on-demand] method of its items.
}
@impl{
@methimpl{
Calls the @scheme[demand-callback] procedure that was provided when the
object was created.
}}
@defmethod[(set-help-string [help (or/c label-string? false/c)])
void?]{
}}}
Sets the help string for the menu item. Use @scheme[#f] to remove the
help string for an item.
}
@defmethod[(set-label [label label-string?])
void?]{
Sets the menu item's label. If the item has a shortcut, the shortcut
is not affected.
If the label contains @litchar{&} and the window is a control, the
label is parsed specially; under Windows and X, the character
following a @litchar{&} is underlined in the displayed menu to
indicate a keyboard mnemonic. Pressing the Alt key with an underlined
character from a menu's name in the menu bar causes the menu to be
selected (via @method[frame% on-menu-char]). When a menu has the
focus, the mnemonic characters are used for navigation without Alt. A
@litchar{&&} in the label is replaced by a literal (non-navigation)
@litchar{&}. Under Mac OS X, @litchar{&}s in the label are parsed in
the same way as for X and Windows, but no mnemonic underline is
displayed.
A @litchar{&} is always preserved in the label returned by
@method[labelled-menu-item<%> get-label], but never preserved in the
label returned by @method[labelled-menu-item<%> get-plain-label].
For historical reasons, if a label contains a tab character, then the
tab and all remaining characters are hidden in the displayed menu.
}}

View File

@ -1,6 +1,9 @@
#reader(lib "defreader.ss" "scribble")
@require["common.ss"]
@define[lbnumnote @elem{List box items are indexed from @scheme[0].}]
@defclass[list-box% object% (list-control<%>)]{
A list box allows the user to select one or more string items from a
@ -13,36 +16,35 @@ Whenever the user changes the selection in a list box, the list box's
callback procedure is called. A callback procedure is provided as an
initialization argument when each list box is created.
\newcommand{\lbnumnote}[0]{List box items are indexed from
@scheme[0].}
@|lbnumnote|
{\lbnumnote}
See also
@scheme[choice%].
See also @scheme[choice%].
@defconstructor[([label (or/c label-string? false/c)]
[choices (listof label-string?)]
[parent (or/c (is-a/c frame%) (is-a/c dialog%)
(is-a/c panel%) (is-a/c pane%))]
[callback ((is-a/c list-box%) (is-a/c control-event%) . -> . any)
(lambda (c e) (void))]
[style (listof (one-of/c 'single 'multiple 'extended
'vertical-label 'horizontal-label
'deleted))
'(single)]
[selection (or/c nonnegative-exact-integer? false/c) #f]
[font (is-a/c font%) @scheme[view-control-font]]
[label-font (is-a/c font%) @scheme[normal-control-font]]
[enabled any/c #t]
[vert-margin (integer-in 0 1000) 2]
[horiz-margin (integer-in 0 1000) 2]
[min-width (integer-in 0 10000) _graphical-minimum-width]
[min-height (integer-in 0 10000) _graphical-minimum-height]
[stretchable-width any/c #t]
[stretchable-height any/c #t])]{
@defconstructor[[label (or/c label-string? false/c)]
[choices list of {\labelstrings}]
[parent (or/c (is-a/c frame%) (is-a/c dialog%) (is-a/c panel%) (is-a/c pane%))]
[callback procedure of two arguments: a @scheme[list-box%] object and a @scheme[control-event%] object @scheme[(\scmk{lambda] (@scheme[lb] @scheme[e]) (void))}]
[style (symbols/c deleted horizontal-label vertical-label extended multiple single) '(single)]
[selection (or/c nonnegative-exact-integer? false/c) #f]
[font (is-a/c font%) @scheme[view-control-font]]
[label-font (is-a/c font%) @scheme[normal-control-font]]
[enabled any/c #t]
[vert-margin (integer-in 0 1000) 2]
[horiz-margin (integer-in 0 1000) 2]
[min-width (integer-in 0 10000) {\rm graphical minimum width}]
[min-height (integer-in 0 10000) {\rm graphical minimum height}]
[stretchable-width any/c #t]
[stretchable-height any/c #t]]{
If @scheme[label] is not @scheme[#f], it is used as the list box label.
Otherwise, the list box will not display its
label.
If @scheme[label] is not @scheme[#f], it is used as the list box
label. Otherwise, the list box will not display its label.
@labelstripped[(scheme label) @elem{} @elem{move the keyboard focus to the list box}]
@ -81,7 +83,7 @@ The @scheme['multiple] and @scheme['extended] styles determine a
user can deselect the (sole) selected item in a @scheme['single] list
box.
\HVLabelNote{list box} \DeletedStyleNote{list box}
@HVLabelNote{list box} @DeletedStyleNote{list box}
If @scheme[selection] is an integer, it is passed to
@method[list-control<%> set-selection] to set the initial selection. The @scheme[selection] must be less than
@ -89,15 +91,13 @@ If @scheme[selection] is an integer, it is passed to
@FontLabelKWs[] @WindowKWs[] @SubareaKWs[] @AreaKWs[]
}
@defmethod[#:mode 'add
(append [item string]
[data value])
[data any/c])
void?]{
@impl{
Adds a new item to the list box with an associated ``data'' object.
The @scheme[data] object is not displayed in the list box; it is
@ -105,166 +105,85 @@ Adds a new item to the list box with an associated ``data'' object.
@method[list-box% get-data], possibly allowing a programmer to avoid managing a separate
item-to-data mapping in addition to the list box control.
}
}}
@defmethod[(delete [n nonnegative-exact-integer?])
void?]{
@spec{
Deletes a choice from the list box. Selected items that are not
deleted remain selected, and no other items are selected.
Deletes the item indexed by @scheme[n]. @|lbnumnote| If @scheme[n] is equal
to or larger than the number of items in the control, @|MismatchExn|.
Selected items that are not deleted remain selected, and no other
items are selected.
}
@impl{
Deletes the item indexed by @scheme[n]. {\lbnumnote} If @scheme[n] is equal
to or larger than the number of items in the control, @|MismatchExn|}.
}}
@defmethod[(get-data [n nonnegative-exact-integer?])
value]{
@spec{
any/c]{
Returns the data value associated with a list box item, or @scheme[#f]
if there is no associated data. See also
@method[list-box% append] and
@method[list-box% set-data].
Returns the data for the item indexed by @scheme[n], or @scheme[#f]
if there is no associated data. @|lbnumnote| If
@scheme[n] is equal to or larger than the number of choices,
@|MismatchExn|.
See also @method[list-box% append] and @method[list-box% set-data].
}
@impl{
Returns the data for the item indexed by @scheme[n]. {\lbnumnote} If
@scheme[n] is equal to or larger than the number of choices,
@|MismatchExn|}.
@defmethod[(get-first-visible-item)
nonnegative-exact-integer?]{
}}
Reports the index of the item currently scrolled to the top of the
list box. @|lbnumnote|
}
@defmethod[(get-label-font)
(is-a/c font%)]{
Returns the font used for the control's label, which is optionally
supplied when a list box is created.
}
@defmethod[(get-selections)
list of {\Ints}]{
@spec{
(listof nonnegative-exact-integer?)]{
Returns a list of indices for all currently selected items.
{\lbnumnote}
@|lbnumnote|
For single-selection lists, the result is always either @scheme[null] or
a list containing one number.
}}
}
@defmethod[(is-selected? [n nonnegative-exact-integer?])
boolean?]{
Returns @scheme[#t] if the item index by @scheme[n] is selected,
@scheme[#f] otherwise. @|lbnumnote| If @scheme[n] is equal to or
larger than the number of choices, @|MismatchExn|.
@MonitorCallback[@elem{A list box's selection} @elem{the user clicking the control} @elem{selection}]
}
@defmethod[(number-of-visible-items)
positive-exact-integer?]{
@spec{
Returns the maximum number of items in the list box that are visible
to the user with the control's current size (rounding down if the
exact answer is fractional, but returning at least @scheme[1]).
}}
@defmethod[(is-selected? [n nonnegative-exact-integer?])
boolean?]{
@spec{
Returns @scheme[#t] if the item matching the specifies index is
selected, @scheme[#f] otherwise.
@MonitorCallback[@elem{A list box's selection} @elem{the user clicking the control} @elem{selection}]
}
@impl{
Returns @scheme[#t] if the item index by @scheme[n] is
selected. {\lbnumnote} If @scheme[n] is equal to or larger than the
number of choices, @|MismatchExn|}.
}}
@defmethod[(set [choices list of {\labelstrings}])
void?]{
@spec{
Clears the list box and installs a new list of items.
}}
@defmethod[(set-data [n nonnegative-exact-integer?]
[data value])
void?]{
@spec{
Sets the associated data for a list box choice item. See also
@method[list-box% append].
}
@impl{
Sets the associated data for item indexed by @scheme[n]. {\lbnumnote} If
@scheme[n] is equal to or larger than the number of choices,
@|MismatchExn|}.
}}
@defmethod[(set-string [n nonnegative-exact-integer?]
[label label-string?])
void?]{
@spec{
Changes an item in the list box.
}
@impl{
Sets the item indexed by @scheme[n]. {\lbnumnote} If @scheme[n] is equal to
or larger than the number of choices, @|MismatchExn|}.
}}
@defmethod[(get-first-visible-item)
nonnegative-exact-integer?]{
@spec{
Reports the index of the item currently scrolled to the top of the
list box. {\lbnumnote}
}}
@defmethod[(set-first-visible-item [n nonnegative-exact-integer?])
void?]{
@spec{
Scrolls the list box so that the specified item is at the top of the
list box display.
@Unmonitored[@elem{A list box's scroll position} @elem{the user clicking the control} @elem{the scroll position
changes} @elem{@method[list-box% get-first-visible-item]}]
}
@impl{
Shows the item indexed by @scheme[n] at the list box's top. {\lbnumnote}
If @scheme[n] is equal to or larger than the number of choices,
@|MismatchExn|}.
}}
@defmethod[(select [n nonnegative-exact-integer?]
[select? any/c #t])
void?]{
@spec{
Selects or deselects an item. For selection in a single-selection list
box, if a different choice is currently selected, it is automatically
@ -272,32 +191,57 @@ Selects or deselects an item. For selection in a single-selection list
selections are preserved, unlike
@method[list-control<%> set-selection].
If @scheme[select?] is @scheme[#f], the item indexed by @scheme[n] is
deselected; otherwise it is selected. @|lbnumnote| If @scheme[n] is
equal to or larger than the number of choices, @|MismatchExn|.
@MonitorCallback[@elem{A list box's selection} @elem{the user clicking the control} @elem{selection}]
The control's callback procedure is {\em not} invoked.
The control's callback procedure is @italic{not} invoked.
}
@impl{
If @scheme[select?] is @scheme[#f], the item indexed by @scheme[n] is
deselected; otherwise it is selected. {\lbnumnote} If @scheme[n] is
equal to or larger than the number of choices, @|MismatchExn|}.
@defmethod[(set [choices (listof label-string?)])
void?]{
}}
@defmethod[(get-label-font)
(is-a/c font%)]{
@spec{
Returns the font used for the control's label, which is optionally
supplied when a list box is created.
Clears the list box and installs a new list of items.
}
@impl{
@defmethod[(set-data [n nonnegative-exact-integer?]
[data any/c])
void?]{
}}}
Sets the associated data for item indexed by @scheme[n]. @|lbnumnote| If
@scheme[n] is equal to or larger than the number of choices,
@|MismatchExn|.
See also @method[list-box% append].
}
@defmethod[(set-first-visible-item [n nonnegative-exact-integer?])
void?]{
Scrolls the list box so that the item indexed by @scheme[n] is at the
top of the list box display. @|lbnumnote| If @scheme[n] is equal to
or larger than the number of choices, @|MismatchExn|.
@Unmonitored[@elem{A list box's scroll position} @elem{the user clicking the control} @elem{the scroll position
changes} @elem{@method[list-box% get-first-visible-item]}]
}
@defmethod[(set-string [n nonnegative-exact-integer?]
[label label-string?])
void?]{
Sets the item indexed by @scheme[n]. @|lbnumnote| If @scheme[n] is
equal to or larger than the number of choices, @|MismatchExn|.
}
}

View File

@ -24,114 +24,93 @@ In either case, the set of user-selectable items can be changed
@defmethod[(append [item string])
void?]{
@spec{
Adds a new item to the list of user-selectable items. The current
selection is unchanged (unless the list control is an empty choice
control, in which case the new item is selected).
}}
}
@defmethod[(clear)
void?]{
@spec{
Removes all user-selectable items from the control.
}}
}
@defmethod[(find-string [s string])
(or/c nonnegative-exact-integer? false/c)]{
@spec{
Finds a user-selectable item matching the given string. If no matching
choice is found, @scheme[#f] is returned, otherwise the index of the
matching choice is returned (items are indexed from @scheme[0]).
}}
}
@defmethod[(get-number)
nonnegative-exact-integer?]{
Returns the number of user-selectable items in the control (which is
also one more than the greatest index in the list control).
}
@defmethod[(get-selection)
(or/c nonnegative-exact-integer? false/c)]{
@spec{
Returns the index of the currently selected item (items are indexed
from @scheme[0]). If the choice item currently contains no choices or no
selections, @scheme[#f] is returned. If multiple selections are
allowed and multiple items are selected, the index of the first
selection is returned.
}}
}
@defmethod[(get-string [n nonnegative-exact-integer?])
(and/c immutable? label-string?)]{
Returns the item for the given index (items are indexed from
@scheme[0]). If the provided index is larger than the greatest index in
the list control, @|MismatchExn|.
}
@defmethod[(get-string-selection)
(or/c immutable {\labelstring} false/c)]{
@spec{
(or/c (and/c immutable? label-string?) false/c)]{
Returns the currently selected item. If the control currently
contains no choices, @scheme[#f] is returned. If multiple selections
are allowed and multiple items are selected, the first selection is
returned.
}}
@defmethod[(get-number)
nonnegative-exact-integer?]{
@spec{
Returns the number of user-selectable items in the control (which is
also one more than the greatest index in the list control).
}}
}
@defmethod[(set-selection [n nonnegative-exact-integer?])
void?]{
@spec{
Selects the item specified by the given index (items are indexed from
@scheme[0]). If the given index larger than the greatest index in the
list control, @|MismatchExn|}.
list control, @|MismatchExn|.
In a list box control, all other items are deselected, even if multiple
selections are allowed in the control. See also
@xmethod[list-box% select].
The control's callback procedure is {\em not} invoked when this method
The control's callback procedure is @italic{not} invoked when this method
is called.
@MonitorCallback[@elem{The list control's selection} @elem{the user clicking the control} @elem{selection}]
}}
}
@defmethod[(set-string-selection [s string])
void?]{
@spec{
Selects the item that matches the given string. If no match
is found in the list control, @|MismatchExn|}.
is found in the list control, @|MismatchExn|.
In a list box control, all other items are deselected, even if multiple
selections are allowed in the control. See also
@xmethod[list-box% select].
The control's callback procedure is {\em not} invoked when this method
The control's callback procedure is @italic{not} invoked when this method
is called.
@MonitorCallback[@elem{The list control's selection} @elem{the user clicking the control} @elem{selection}]
}}
@defmethod[(get-string [n nonnegative-exact-integer?])
immutable {\labelstring}]{
@spec{
Returns the item for the given index (items are indexed from
@scheme[0]). If the provided index is larger than the greatest index in
the list control, @|MismatchExn|}.
}
}
@impl{
}}}

View File

@ -5,59 +5,50 @@
A @scheme[menu-bar%] object is created for a particular
@scheme[frame%] object. A frame can have at most one menu bar;
@|MismatchExn|} when a new menu bar is created for a frame that
@|MismatchExn| when a new menu bar is created for a frame that
already has a menu bar.
@defconstructor[[parent @scheme[frame%] object or @scheme['root]]
[demand-callback procedure of one argument: a @scheme[menu-bar%] object @scheme[void]]]{
@defconstructor[([parent (or/c (is-a/c frame%) (one-of/c 'root))]
[demand-callback ((is-a/c menu-bar%) . -> . any) (lambda (m) (void))])]{
Creates a menu bar in the specified frame. The menu bar is initially
empty. If @indexed-scheme['root] is supplied as @scheme[parent], the menu
bar becomes active only when no other frames are shown. A
empty. If @indexed-scheme['root] is supplied as @scheme[parent], the
menu bar becomes active only when no other frames are shown. A
@scheme['root] @scheme[parent] is allowed only when
@scheme[current-eventspace-has-menu-root?] returns
@scheme[#t], and only if no such menu bar has been created before,
otherwise @|MismatchExn|}.
@scheme[current-eventspace-has-menu-root?] returns @scheme[#t], and
only if no such menu bar has been created before, otherwise
@|MismatchExn|.
The @scheme[demand-callback] procedure is called by the default
@method[menu-item-container<%> on-demand] method with the object itself.
}
@defmethod[(get-frame)
(is-a/c frame%)]{
@spec{
Returns the menu bar's frame.
}}
@defmethod[(enable [enable? any/c])
void?]{
@spec{
Enables or disables the menu bar (i.e., all of its menus). Each
menu's
@method[labelled-menu-item<%> is-enabled?] method returns @scheme[#f] only if the menu is specifically disabled (in
addition to the menu bar).
menu's @method[labelled-menu-item<%> is-enabled?] method returns
@scheme[#f] only if the menu is specifically disabled (in addition to
the menu bar).
}
@defmethod[(get-frame)
(is-a/c frame%)]{
Returns the menu bar's frame.
}
}}
@defmethod[(is-enabled?)
boolean?]{
@spec{
Returns @scheme[#t] if the menu bar is enabled, @scheme[#f] otherwise.
}
@impl{
}}}
}}

View File

@ -10,28 +10,32 @@ A @scheme[menu-item%] is a plain string-labelled menu item. Its
@defconstructor[[label label-string?]
[parent @scheme[menu%] or @scheme[popup-menu%] object]
[callback procedure of two arguments: a @scheme[menu-item%] object and a @scheme[control-event%] object]
[shortcut (or/c character false/c) #f]
[help-string (or/c label-string? false/c) #f]
[demand-callback procedure of one argument: a @scheme[menu-item%] object @scheme[void]]
[shortcut-prefix (symbols/c option shift ctl meta cmd alt) @scheme[(\iscmprocedure{get-default-shortcut-prefix])}]]{
@defconstructor[([label label-string?]
[parent (or/c (is-a/c menu% popup-menu%))]
[callback ((is-a/c menu-item%) (is-a/c control-event%) . -> . any)
(lambda (i e) (void))]
[shortcut (or/c char? false/c) #f]
[help-string (or/c label-string? false/c) #f]
[demand-callback ((is-a/c menu-item%) . -> . any)
(lambda (i) (void))]
[shortcut-prefix (listof (one-of/c 'alt 'cmd 'meta 'ctl 'shift 'option))
(get-default-shortcut-prefix)])]{
Creates a new menu item in @scheme[parent]. The item is initially shown,
appended to the end of its parent. The @scheme[callback] procedure is
called (with the event type @indexed-scheme['menu]) when the user selects
the menu item (either via a menu bar,
@xmethod[window<%> popup-menu], or
@xmethod[editor-admin% popup-menu]).
Creates a new menu item in @scheme[parent]. The item is initially
shown, appended to the end of its parent. The @scheme[callback]
procedure is called (with the event type @indexed-scheme['menu]) when
the user selects the menu item (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 ampersands (``\&'') in @scheme[label].
See @method[labelled-menu-item<%> set-label] for information about
mnemonic ampersands (``\&'') in @scheme[label].
If @scheme[shortcut] is not @scheme[#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 keys for the shortcut; see
@method[selectable-menu-item<%> get-shortcut-prefix].
@method[selectable-menu-item<%> get-shortcut] for more information.
The @scheme[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
@method[labelled-menu-item<%> get-help-string] for more information.
@ -39,7 +43,5 @@ If @scheme[help] is not @scheme[#f], the item has a help string. See
The @scheme[demand-callback] procedure is called by the default
@method[menu-item-container<%> on-demand] method with the object itself.
}}

View File

@ -4,10 +4,10 @@
@definterface[menu-item<%> ()]{
A @scheme[menu-item<%>] object is an element within a @scheme[menu%],
@scheme[popup-menu%], or @scheme[menu-bar%]. Operations that
affect the parent --- such as renaming the item, deleting the item, or
@scheme[popup-menu%], or @scheme[menu-bar%]. Operations that affect
the parent --- such as renaming the item, deleting the item, or
adding a check beside the item --- are accomplished via the
\scmintf{menu-item} object.
@scheme[menu-item<%>] object.
A menu item is either a @scheme[separator-menu-item%] object (merely
a separator), of a @scheme[labelled-menu-item<%>] object; the latter
@ -16,54 +16,41 @@ A menu item is either a @scheme[separator-menu-item%] object (merely
item), or @scheme[menu%] (a submenu).
@defmethod[(delete)
void?]{
Removes the item from its parent. If the menu item is already deleted,
@method[menu-item<%> delete] has no effect.
See also @method[menu-item<%> restore].
}
@defmethod[(get-parent)
@scheme[menu%], @scheme[popup-menu%], or @scheme[menu-bar%] object]{
@spec{
(or/c (is-a/c menu%) (is-a/c popup-menu%) (is-a/c menu-bar%))]{
Returns the menu, popup menu, or menu bar containing the item. The
parent for a menu item is specified when the menu item is created,
and it cannot be changed.
}}
@defmethod[(delete)
void?]{
@spec{
Removes the item from its parent. If the menu item is already deleted,
@method[menu-item<%> delete] has no effect.
See also
@method[menu-item<%> restore].
}}
@defmethod[(restore)
void?]{
@spec{
Adds a deleted item back into its parent. The item is always restored
to the end of the parent, regardless of its original position. If the
item is not currently deleted,
@method[menu-item<%> restore] has no effect.
}}
}
@defmethod[(is-deleted?)
boolean?]{
@spec{
Returns @scheme[#t] if the menu item is deleted from its parent,
@scheme[#f] otherwise.
}
@impl{
@defmethod[(restore)
void?]{
Adds a deleted item back into its parent. The item is always restored
to the end of the parent, regardless of its original position. If the
item is not currently deleted, @method[menu-item<%> restore] has no
effect.
}}}
}}

View File

@ -15,22 +15,21 @@ A @scheme[pane%] object has a degenerate placement strategy for
See also @scheme[grow-box-spacer-pane%].
@defconstructor[[parent (or/c (is-a/c frame%) (is-a/c dialog%) (is-a/c panel%) (is-a/c pane%))]
[vert-margin (integer-in 0 1000) 0]
[horiz-margin (integer-in 0 1000) 0]
[border (integer-in 0 1000) 0]
[spacing (integer-in 0 1000) 0]
[alignment two-element list: @scheme['left], @scheme['center], or @scheme['right] and @scheme['top], @scheme['center], or @scheme['bottom] '(center center)]
[min-width (integer-in 0 10000) {\rm graphical minimum width}]
[min-height (integer-in 0 10000) {\rm graphical minimum height}]
[stretchable-width any/c #t]
[stretchable-height any/c #t]]{
@defconstructor[([parent (or/c (is-a/c frame%) (is-a/c dialog%)
(is-a/c panel%) (is-a/c pane%))]
[vert-margin (integer-in 0 1000) 0]
[horiz-margin (integer-in 0 1000) 0]
[border (integer-in 0 1000) 0]
[spacing (integer-in 0 1000) 0]
[alignment (list/c (one-of/c 'left 'center 'right)
(one-of/c 'top 'center 'bottom))
'(center top)]
[min-width (integer-in 0 10000) _graphical-minimum-width]
[min-height (integer-in 0 10000) _graphical-minimum-height]
[stretchable-width any/c #t]
[stretchable-height any/c #t])]{
@SubareaKWs[] @AreaContKWs[] @AreaKWs[]
}}

View File

@ -15,28 +15,27 @@ A @scheme[panel%] object has a degenerate placement strategy for
management.
@defconstructor[[parent (or/c (is-a/c frame%) (is-a/c dialog%) (is-a/c panel%) (is-a/c pane%))]
[style (symbols/c deleted border) null]
[enabled any/c #t]
[vert-margin (integer-in 0 1000) 0]
[horiz-margin (integer-in 0 1000) 0]
[border (integer-in 0 1000) 0]
[spacing (integer-in 0 1000) 0]
[alignment two-element list: @scheme['left], @scheme['center], or @scheme['right] and @scheme['top], @scheme['center], or @scheme['bottom] '(center center)]
[min-width (integer-in 0 10000) {\rm graphical minimum width}]
[min-height (integer-in 0 10000) {\rm graphical minimum height}]
[stretchable-width any/c #t]
[stretchable-height any/c #t]]{
@defconstructor[([parent (or/c (is-a/c frame%) (is-a/c dialog%)
(is-a/c panel%) (is-a/c pane%))]
[style (listof (one-of/c 'border 'deleted)) null]
[enabled any/c #t]
[vert-margin (integer-in 0 1000) 0]
[horiz-margin (integer-in 0 1000) 0]
[border (integer-in 0 1000) 0]
[spacing (integer-in 0 1000) 0]
[alignment (list/c (one-of/c 'left 'center 'right)
(one-of/c 'top 'center 'bottom))
'(center center)]
[min-width (integer-in 0 10000) _graphical-minimum-width]
[min-height (integer-in 0 10000) _graphical-minimum-height]
[stretchable-width any/c #t]
[stretchable-height any/c #t])]{
If the @scheme['border] style is specified, the window is created with
a thin border (only in this case, the client size of the panel may be
less than its total size). \DeletedStyleNote{panel}
less than its total size). @DeletedStyleNote{panel}
@WindowKWs[] @SubareaKWs[] @AreaContKWs[] @AreaKWs[]
}}

View File

@ -6,94 +6,120 @@
A top-level window is either a @scheme[frame%] or @scheme[dialog%]
object.
@defmethod[(get-eventspace)
eventspace]{
@spec{
Returns the window's eventspace.
}}
@defmethod[#:mode 'pubment
(on-close)
void?]{
@spec{
Called just before the window is closed (e.g., by the window manager).
This method is {\em not}\/ called by
@method[window<%> show] .
See also
@method[top-level-window<%> can-close?].
}}
@defmethod[#:mode 'pubment
(can-close?)
boolean?]{
@spec{
Called just before the window might be closed (e.g., by the window
manager). If @scheme[#f] is returned, the window is not\/
closed, otherwise
@method[top-level-window<%> on-close] is called and the window is closed (i.e., the window is hidden,
like calling
@method[window<%> show] with @scheme[#f]).
This method is {\em not}\/ called by
@method[window<%> show] .
}}
@defmethod[(on-exit)
void?]{
@spec{
Called by the default application quit handler (as determined by the
@scheme[application-quit-handler] parameter) when the
operating system requests that the application shut down (e.g., when
the \OnScreen{Quit} menu item is selected in the main application
menu under Mac OS X). In that case, this method is called for the
most recently active top-level window in the initial eventspace, but
only if the window's
@method[top-level-window<%> can-exit?] method first returns true.
manager). If @scheme[#f] is returned, the window is not\/ closed,
otherwise @method[top-level-window<%> on-close] is called and the
window is closed (i.e., the window is hidden, like calling
@method[window<%> show] with @scheme[#f]).
This method is @italic{not} called by @method[window<%> show].
}
@impl{
Calls
@method[top-level-window<%> on-close] and then
@method[top-level-window<%> show] to hide the window.
}}
@defmethod[(can-exit?)
boolean?]{
@spec{
@methspec{
Called before
@method[top-level-window<%> on-exit] to check whether an exit is allowed. See
@method[top-level-window<%> on-exit] for more information.
Called before @method[top-level-window<%> on-exit] to check whether an
exit is allowed. See @method[top-level-window<%> on-exit] for more
information.
}
@impl{
Calls
@method[top-level-window<%> can-close?] and returns the result.
@methimpl{
Calls @method[top-level-window<%> can-close?] and returns the result.
}}
@defmethod[(center [direction (one-of/c 'horizontal 'vertical 'both) 'both])
void?]{
Centers the window on the screen if it has no parent. If it has a
parent, the window is centered with respect to its parent's location.
If @scheme[direction] is @scheme['horizontal], the window is centered
horizontally. If @scheme[direction] is @scheme['vertical], the
window is centered vertically. If @scheme[direction] is
@scheme['both], the window is centered in both directions.
}
@defmethod[(get-edit-target-object)
(or/c (or/c (is-a/c window<%>) (is-a/c editor<%>)) false/c)]{
@index['("keyboard focus" "last active")]{Like}
@method[top-level-window<%> get-edit-target-window], but if an editor
canvas had the focus and it also displays an editor, the editor is
returned instead of the canvas. Further, if the editor's focus is
delegated to an embedded editor, the embedded editor is returned.
See also @method[top-level-window<%> get-focus-object].
}
@defmethod[(get-edit-target-window)
(or/c (is-a/c window<%>) false/c)]{
@index['("keyboard focus" "last active")]{Returns} the window that
most recently had the keyboard focus, either the top-level window or
one of its currently-shown children. If neither the window nor any of
its currently-shown children has even owned the keyboard focus,
@scheme[#f] is returned.
See also @method[top-level-window<%> get-focus-window] and
@method[top-level-window<%> get-edit-target-object].
}
@defmethod[(get-eventspace)
eventspace]{
Returns the window's eventspace.
}
@defmethod[(get-focus-object)
(or/c (or/c (is-a/c window<%>) (is-a/c editor<%>)) false/c)]{
@index["keyboard focus"]{Like} @method[top-level-window<%>
get-focus-window], but if an editor canvas has the focus and it also
displays an editor, the editor is returned instead of the
canvas. Further, if the editor's focus is delegated to an embedded
editor, the embedded editor is returned.
See also @method[top-level-window<%> get-edit-target-object].
}
@defmethod[(get-focus-window)
(or/c (is-a/c window<%>) false/c)]{
@index["keyboard focus"]{Returns} the window that has the keyboard
focus, either the top-level window or one of its children. If neither
the window nor any of its children has the focus, @scheme[#f] is
returned.
See also @method[top-level-window<%> get-edit-target-window] and
@method[top-level-window<%> get-focus-object].
}
@defmethod[(move [x (integer-in -10000 10000)]
[y (integer-in -10000 10000)])
void?]{
Moves the window to the given position on the screen.
@MonitorMethod[@elem{A window's position} @elem{the user dragging the window} @elem{@method[window<%> on-move]} @elem{position}]
}
@defmethod[(on-activate [active? any/c])
void?]{
@spec{
Called when a window is @defterm{activated} or
@defterm{deactivated}. A top-level window is activated when the
@ -107,149 +133,81 @@ Called when a window is @defterm{activated} or
The method's argument is @scheme[#t] when the window is activated,
@scheme[#f] when it is deactivated.
}
@defmethod[#:mode 'pubment
(on-close)
void?]{
Called just before the window is closed (e.g., by the window manager).
This method is @italic{not} called by @method[window<%> show].
See also
@method[top-level-window<%> can-close?].
}
@defmethod[(on-exit)
void?]{
@methspec{
Called by the default application quit handler (as determined by the
@scheme[application-quit-handler] parameter) when the operating
system requests that the application shut down (e.g., when the
@onscreen{Quit} menu item is selected in the main application menu
under Mac OS X). In that case, this method is called for the most
recently active top-level window in the initial eventspace, but only
if the window's @method[top-level-window<%> can-exit?] method first
returns true.
}
@methimpl{
Calls
@method[top-level-window<%> on-close] and then
@method[top-level-window<%> show] to hide the window.
}}
@defmethod[(on-message [message value])
value]{
@spec{
@defmethod[(on-message [message any/c])
any/c]{
@methspec{
\index{drag-and-drop}
A generic message method, usually called by
@index["drag-and-drop"]{A} generic message method, usually called by
@scheme[send-message-to-window].
If the method is invoked by
@scheme[send-message-to-window], then it is invoked in the thread where
@scheme[send-message-to-window] was called (which is possibly {\em not\/} the handler thread of the
window's eventspace).
If the method is invoked by @scheme[send-message-to-window], then it
is invoked in the thread where @scheme[send-message-to-window] was
called (which is possibly @italic{not} the handler thread of the
window's eventspace).
}
@impl{
Returns void.
@methimpl{
Returns @|void-const|.
}}
@defmethod[(get-focus-window)
(or/c (is-a/c window<%>) false/c)]{
@spec{
\index{keyboard focus}
Returns the window that has the keyboard focus, either the top-level
window or one of its children. If neither the window nor any of its
children has the focus, @scheme[#f] is returned.
See also
@method[top-level-window<%> get-edit-target-window] and
@method[top-level-window<%> get-focus-object].
}}
@defmethod[(get-focus-object)
(or/c (or/c (is-a/c window<%>) (is-a/c editor<%>)) false/c)]{
@spec{
\index{keyboard focus}
Like
@method[top-level-window<%> get-focus-window], but if an editor canvas has the focus and it also displays an
editor, the editor is returned instead of the canvas. Further, if the
editor's focus is delegated to an embedded editor, the embedded
editor is returned.
See also
@method[top-level-window<%> get-edit-target-object].
}}
@defmethod[(get-edit-target-window)
(or/c (is-a/c window<%>) false/c)]{
@spec{
\index{keyboard focus!last active}
Returns the window that most recently had the keyboard focus, either
the top-level window or one of its currently-shown children. If
neither the window nor any of its currently-shown children has even
owned the keyboard focus, @scheme[#f] is returned.
See also
@method[top-level-window<%> get-focus-window] and
@method[top-level-window<%> get-edit-target-object].
}}
@defmethod[(get-edit-target-object)
(or/c (or/c (is-a/c window<%>) (is-a/c editor<%>)) false/c)]{
@spec{
\index{keyboard focus!last active}
Like
@method[top-level-window<%> get-edit-target-window], but if an editor canvas had the focus and it also displays an
editor, the editor is returned instead of the canvas. Further, if the
editor's focus is delegated to an embedded editor, the embedded
editor is returned.
See also
@method[top-level-window<%> get-focus-object].
}}
@defmethod[(center [direction (symbols/c both vertical horizontal) 'both])
void?]{
@spec{
Centers the window on the screen if it has no parent. If it has a
parent, the window is centered with respect to its parent's location.
}
@impl{
If @scheme[direction] is @scheme['horizontal], the window is centered
horizontally. If @scheme[direction] is @scheme['vertical], the
window is centered vertically. If @scheme[direction] is
@scheme['both], the window is centered in both directions.
}}
@defmethod[(move [x (integer-in -10000 10000)]
[y (integer-in -10000 10000)])
void?]{
@spec{
Moves the window to the given position on the screen.
@MonitorMethod[@elem{A window's position} @elem{the user dragging the window} @elem{@method[window<%> on-move]} @elem{position}]
}}
@defmethod[(resize [width (integer-in 0 10000)]
[height (integer-in 0 10000)])
void?]{
@spec{
Sets the size of the window (in pixels), but only if the given size is
larger than the window's minimum size.
@MonitorMethod[@elem{A window's size} @elem{the user} @elem{@method[window<%> on-size]} @elem{size}]
}}
@defmethod[(on-traverse-char [event (is-a/c key-event%)])
boolean?]{
@spec{
\index{keyboard focus!navigation}
Attempts to handle the given keyboard event as a navigation event, such
as a Tab key event that moves the keyboard focus. If the event is
handled, @scheme[#t] is returned, otherwise @scheme[#f] is returned.
@methspec{
@index['("keyboard focus" "navigation")]{Attempts} to handle the given
keyboard event as a navigation event, such as a Tab key event that
moves the keyboard focus. If the event is handled, @scheme[#t] is
returned, otherwise @scheme[#f] is returned.
}
@impl{
@methimpl{
The following rules determine, in order, whether and how @scheme[event]
is handled:
@itemize{
@item{
@ -331,32 +289,35 @@ If @scheme[event] is an alphanumeric key event and the current top-level
Otherwise, @scheme[#f] is returned.}
}
}}
@defmethod[(on-system-menu-char [event (is-a/c key-event%)])
boolean?]{
@spec{
Checks whether the given event pops open the system menu in the
top-left corner of the window (Windows only). If the window's system
menu is opened, @scheme[#t] is returned, otherwise @scheme[#f] is
returned.
}}
}
@defmethod[(resize [width (integer-in 0 10000)]
[height (integer-in 0 10000)])
void?]{
Sets the size of the window (in pixels), but only if the given size is
larger than the window's minimum size.
@MonitorMethod[@elem{A window's size} @elem{the user} @elem{@method[window<%> on-size]} @elem{size}]
}
@defmethod[#:mode 'auto-super
(show [show any/c])
void?]{
@impl{
If the window is already shown, it is moved front of other top-level
windows. If the window is iconized (frames only), it is deiconized.
}}}
}}

View File

@ -8,20 +8,21 @@ A vertical pane arranges its subwindows in a single column. See also @scheme[pan
@defconstructor[[parent (or/c (is-a/c frame%) (is-a/c dialog%) (is-a/c panel%) (is-a/c pane%))]
[vert-margin (integer-in 0 1000) 0]
[horiz-margin (integer-in 0 1000) 0]
[border (integer-in 0 1000) 0]
[spacing (integer-in 0 1000) 0]
[alignment two-element list: @scheme['left], @scheme['center], or @scheme['right] and @scheme['top], @scheme['center], or @scheme['bottom] '(center top)]
[min-width (integer-in 0 10000) {\rm graphical minimum width}]
[min-height (integer-in 0 10000) {\rm graphical minimum height}]
[stretchable-width any/c #t]
[stretchable-height any/c #t]]{
@defconstructor[([parent (or/c (is-a/c frame%) (is-a/c dialog%)
(is-a/c panel%) (is-a/c pane%))]
[vert-margin (integer-in 0 1000) 0]
[horiz-margin (integer-in 0 1000) 0]
[border (integer-in 0 1000) 0]
[spacing (integer-in 0 1000) 0]
[alignment (list/c (one-of/c 'left 'center 'right)
(one-of/c 'top 'center 'bottom))
'(center top)]
[min-width (integer-in 0 10000) _graphical-minimum-width]
[min-height (integer-in 0 10000) _graphical-minimum-height]
[stretchable-width any/c #t]
[stretchable-height any/c #t])]{
@SubareaKWs[] @AreaContKWs[] @AreaKWs[]
}}

View File

@ -9,22 +9,25 @@ A vertical panel arranges its subwindows in a single column. See
@defconstructor[[parent (or/c (is-a/c frame%) (is-a/c dialog%) (is-a/c panel%) (is-a/c pane%))]
[style (symbols/c deleted border) null]
[enabled any/c #t]
[vert-margin (integer-in 0 1000) 0]
[horiz-margin (integer-in 0 1000) 0]
[border (integer-in 0 1000) 0]
[spacing (integer-in 0 1000) 0]
[alignment two-element list: @scheme['left], @scheme['center], or @scheme['right] and @scheme['top], @scheme['center], or @scheme['bottom] '(left center)]
[min-width (integer-in 0 10000) {\rm graphical minimum width}]
[min-height (integer-in 0 10000) {\rm graphical minimum height}]
[stretchable-width any/c #t]
[stretchable-height any/c #t]]{
@defconstructor[([parent (or/c (is-a/c frame%) (is-a/c dialog%)
(is-a/c panel%) (is-a/c pane%))]
[style (listof (one-of/c 'border 'deleted)) null]
[enabled any/c #t]
[vert-margin (integer-in 0 1000) 0]
[horiz-margin (integer-in 0 1000) 0]
[border (integer-in 0 1000) 0]
[spacing (integer-in 0 1000) 0]
[alignment (list/c (one-of/c 'left 'center 'right)
(one-of/c 'top 'center 'bottom))
'(center top)]
[min-width (integer-in 0 10000) _graphical-minimum-width]
[min-height (integer-in 0 10000) _graphical-minimum-height]
[stretchable-width any/c #t]
[stretchable-height any/c #t])]{
If the @scheme['border] style is specified, the window is created with
a thin border (only in this case, the client size of the panel may be
less than its total size). \DeletedStyleNote{panel}
less than its total size). @DeletedStyleNote{panel}
@WindowKWs[] @SubareaKWs[] @AreaContKWs[] @AreaKWs[]

View File

@ -18,6 +18,263 @@ All @scheme[window<%>] classes accept the following named instantiation
@defmethod*[([(accept-drop-files)
boolean?]
[(accept-drop-files [accept-files? any/c])
void?])]{
@index["drag-and-drop"]{Enables} or disables drag-and-drop dropping
for the window, or gets the enable state. Dropping is initially
disabled. See also @method[window<%> on-drop-file].
}
@defmethod[(client->screen [x (integer-in -10000 10000)]
[y (integer-in -10000 10000)])
(values (integer-in -10000 10000)
(integer-in -10000 10000))]{
@index["global coordinates"]{Converts} local window coordinates to
screen coordinates.
}
@defmethod[(enable [enable? any/c])
void?]{
Enables or disables a window so that input events are ignored. (Input
events include mouse events, keyboard events, and close-box clicks,
but not focus or update events.) When a window is disabled, input
events to its children are also ignored.
@MonitorMethod[@elem{The enable state of a window} @elem{enabling a parent window} @elem{@method[window<%> on-superwindow-enable]} @elem{enable state}]
If @scheme[enable?] is true, the window is enabled, otherwise it is
disabled.
}
@defmethod[(focus)
void?]{
@index['("keyboard focus" "setting")]{Moves} the keyboard focus to the
window, relative to its top-level window, if the window ever accepts
the keyboard focus. If the focus is in the window's top-level
window, then the focus is immediately moved to this
window. Otherwise, the focus is not immediately moved, but when the
window's top-level window gets the keyboard focus, the focus is
delegated to this window.
See also
@method[window<%> on-focus].
Note that under X, keyboard focus can move to the menu bar
when the user is selecting a menu item.
@MonitorMethod[@elem{The current keyboard focus window} @elem{the user} @elem{@method[window<%> on-focus]} @elem{focus}]
}
@defmethod[(get-client-size)
(values (integer-in 0 10000)
(integer-in 0 10000))]{
Gets the interior size of the window in pixels. For a container, the
interior size is the size available for placing subwindows (including
the border margin). For a canvas, this is the visible drawing
area.
The client size is returned as two values: width and height (in pixels).
See also
@method[area-container<%> reflow-container].
}
@defmethod[(get-cursor)
(or/c (is-a/c cursor%) false/c)]{
Returns the window's cursor, or @scheme[#f] if this window's cursor
defaults to the parent's cursor. See
@method[window<%> set-cursor] for more information.
}
@defmethod[(get-handle)
exact-integer?]{
Returns an exact integer representing a handle to the window in the
current platform's GUI toolbox. Cast this number from a C \cpp{long}
to a platform-specific C type:
@itemize{
@item{Windows: @tt{HWND}}
@item{Mac OS X: @tt{WindowRef} for a @scheme[top-level-window<%>] object,
@tt{ControlRef} for other windows}
@item{X: @tt{Widget*}}
}
Some windows may not have a representation in the platform's GUI level,
in which case the result of this method is @scheme[0].
}
@defmethod[(get-height)
(integer-in 0 10000)]{
Returns the window's total height (in pixels).
See also
@method[area-container<%> reflow-container].
}
@defmethod[(get-label)
(or/c {\labelstring}, @scheme[bitmap%] object, @scheme['app], @scheme['caution], @scheme['stop], false/c)]{
Gets a window's label, if any. Control windows generally display their
label in some way. Frames and dialogs display their label as a window
title. Panels do not display their label, but the label can be used
for identification purposes. Messages, buttons, and check boxes can
have bitmap labels (only when they are created with bitmap labels),
but all other windows have string labels. In addition, a message
label can be an icon symbol @scheme['app], @scheme['caution], or
@scheme['stop].
The label string may contain ampersands (``\&''), which serve as
keyboard navigation annotations for controls under Windows and X. The
ampersands are not part of the displayed label of a control; instead,
ampersands are removed in the displayed label (under all platforms),
and any character preceding an ampersand is underlined (Windows and
X) indicating that the character is a mnemonic for the
control. Double ampersands are converted into a single ampersand
(with no displayed underline). See also
@method[top-level-window<%> on-traverse-char].
If the window does not have a label, @scheme[#f] is returned.
}
@defmethod[(get-plain-label)
(or/c string false/c)]{
Like
@method[window<%> get-label], except that ampersands in the label are removed. If the window has
no label or the window's
label is not a string, @scheme[#f] is returned.
}
@defmethod[(get-size)
(values (integer-in 0 10000)
(integer-in 0 10000))]{
Gets the current size of the entire window in pixels, not counting
horizontal and vertical margins. (Under X, this size does not include
a title bar or borders for a frame/dialog.) See also
@method[window<%> get-client-size].
The geometry is returned as two values: width and height (in pixels).
See also
@method[area-container<%> reflow-container].
}
@defmethod[(get-width)
(integer-in 0 10000)]{
Returns the window's current total width (in pixels).
See also
@method[area-container<%> reflow-container].
}
@defmethod[(get-x)
(integer-in -10000 10000)]{
Returns the position of the window's left edge in its
parent's coordinate system.
See also
@method[area-container<%> reflow-container].
}
@defmethod[(get-y)
(integer-in -10000 10000)]{
Returns the position of the window's top edge in its
parent's coordinate system.
See also
@method[area-container<%> reflow-container].
}
@defmethod[(has-focus?)
boolean?]{
Indicates whether the window currently has the keyboard focus. See
also
@method[window<%> on-focus].
}
@defmethod[(is-enabled?)
boolean?]{
Returns @scheme[#t] if the window is enabled when all of its ancestors
are enabled, @scheme[#f] otherwise.
}
@defmethod[(is-shown?)
boolean?]{
Indicates whether the window is currently shown or not (when
all of its ancestors are also shown).
The result is @scheme[#t] if this window is shown when its ancestors are
shown, or @scheme[#f] if this window remains hidden when its ancestors
are shown.
}
@defmethod[(on-drop-file [pathname path])
void?]{
@index["drag-and-drop"]{Called} when the user drags a file onto the
window. (Under X, drag-and-drop is supported via the XDND
protocol.) Drag-and-drop must first be enabled for the window with
@method[window<%> accept-drop-files].
Under Mac OS X, when the application is running and user
double-clicks an application-handled file or drags a file onto the
application's icon, the main thread's application file handler is
called (see
@scheme[application-file-handler]). The default handler calls the
@method[window<%> on-drop-file] method of the most-recently activated frame if drag-and-drop is
enabled for that frame, independent of the frame's eventspace (but
the method is called in the frame's eventspace's handler
thread). When the application is not running, the filenames are
provided as command-line arguments.
}
@defmethod[(on-focus [on? any/c])
void?]{
@methspec{
@ -38,14 +295,14 @@ Does nothing.
}}
@defmethod[(on-size [width (integer-in 0 10000)]
[height (integer-in 0 10000)])
@defmethod[(on-move [x (integer-in -10000 10000)]
[y (integer-in -10000 10000)])
void?]{
@methspec{
Called when the window is resized. The window's new size (in pixels)
is provided to the method. The size values are for the entire window,
not just the client area.
Called when the window is moved. (For windows that are not top-level
windows, ``moved'' means moved relative to the parent's top-left
corner.) The new position is provided to the method.
}
@methimpl{
@ -56,14 +313,14 @@ Does nothing.
}}
@defmethod[(on-move [x (integer-in -10000 10000)]
[y (integer-in -10000 10000)])
@defmethod[(on-size [width (integer-in 0 10000)]
[height (integer-in 0 10000)])
void?]{
@methspec{
Called when the window is moved. (For windows that are not top-level
windows, ``moved'' means moved relative to the parent's top-left
corner.) The new position is provided to the method.
Called when the window is resized. The window's new size (in pixels)
is provided to the method. The size values are for the entire window,
not just the client area.
}
@methimpl{
@ -130,39 +387,6 @@ Returns @scheme[#f].
}}
@defmethod[(client->screen [x (integer-in -10000 10000)]
[y (integer-in -10000 10000)])
(values (integer-in -10000 10000)
(integer-in -10000 10000))]{
@index["global coordinates"]{Converts} local window coordinates to
screen coordinates.
}
@defmethod[(enable [enable? any/c])
void?]{
Enables or disables a window so that input events are ignored. (Input
events include mouse events, keyboard events, and close-box clicks,
but not focus or update events.) When a window is disabled, input
events to its children are also ignored.
@MonitorMethod[@elem{The enable state of a window} @elem{enabling a parent window} @elem{@method[window<%> on-superwindow-enable]} @elem{enable state}]
If @scheme[enable?] is true, the window is enabled, otherwise it is
disabled.
}
@defmethod[(is-enabled?)
boolean?]{
Returns @scheme[#t] if the window is enabled when all of its ancestors
are enabled, @scheme[#f] otherwise.
}
@defmethod[(on-superwindow-enable [enabled? any/c])
void?]{
@ -187,151 +411,34 @@ If the enable state of a window's ancestor changes while the window is
}
@defmethod[(get-width)
(integer-in 0 10000)]{
Returns the window's current total width (in pixels).
See also
@method[area-container<%> reflow-container].
}
@defmethod[(get-height)
(integer-in 0 10000)]{
Returns the window's total height (in pixels).
See also
@method[area-container<%> reflow-container].
}
@defmethod[(get-x)
(integer-in -10000 10000)]{
Returns the position of the window's left edge in its
parent's coordinate system.
See also
@method[area-container<%> reflow-container].
}
@defmethod[(get-y)
(integer-in -10000 10000)]{
Returns the position of the window's top edge in its
parent's coordinate system.
See also
@method[area-container<%> reflow-container].
}
@defmethod[(get-label)
(or/c {\labelstring}, @scheme[bitmap%] object, @scheme['app], @scheme['caution], @scheme['stop], false/c)]{
Gets a window's label, if any. Control windows generally display their
label in some way. Frames and dialogs display their label as a window
title. Panels do not display their label, but the label can be used
for identification purposes. Messages, buttons, and check boxes can
have bitmap labels (only when they are created with bitmap labels),
but all other windows have string labels. In addition, a message
label can be an icon symbol @scheme['app], @scheme['caution], or
@scheme['stop].
The label string may contain ampersands (``\&''), which serve as
keyboard navigation annotations for controls under Windows and X. The
ampersands are not part of the displayed label of a control; instead,
ampersands are removed in the displayed label (under all platforms),
and any character preceding an ampersand is underlined (Windows and
X) indicating that the character is a mnemonic for the
control. Double ampersands are converted into a single ampersand
(with no displayed underline). See also
@method[top-level-window<%> on-traverse-char].
If the window does not have a label, @scheme[#f] is returned.
}
@defmethod[(set-label [l label-string?])
@defmethod[(on-superwindow-show [shown? any/c])
void?]{
Sets a window's label. The window's natural minimum size might be
different after the label is changed, but the window's minimum size
is not recomputed.
Called via the event queue whenever the visibility of a window has
changed, either through a call to the window's
@method[window<%> show], through the showing/hiding of one of the window's ancestors, or
through the activating or deactivating of the window or its ancestor
in a container (e.g., via
@method[area-container<%> delete-child]). The method's argument indicates whether the window is now
visible or not.
If the window was not created with a label, or if the window was
created with a non-string label, @scheme[l] is ignored.
See
@method[window<%> get-label] for more information.
This method is not called when the window is initially created; it is
called only after a change from the window's initial
visibility. Furthermore, if a show notification event is queued for
the window and it reverts its visibility before the event is
dispatched, then the dispatch is canceled.
}
@defmethod[(get-plain-label)
(or/c string false/c)]{
@defmethod[(popup-menu [menu (is-a/c popup-menu%)]
[x (integer-in 0 10000)]
[y (integer-in 0 10000)])
void?]{
Like
@method[window<%> get-label], except that ampersands in the label are removed. If the window has
no label or the window's
label is not a string, @scheme[#f] is returned.
@popupmenuinfo["window" "window" ""]
}
@defmethod[(get-handle)
exact-integer?]{
Returns an exact integer representing a handle to the window in the
current platform's GUI toolbox. Cast this number from a C \cpp{long}
to a platform-specific C type:
@itemize{
@item{Windows: @tt{HWND}}
@item{Mac OS X: @tt{WindowRef} for a @scheme[top-level-window<%>] object,
@tt{ControlRef} for other windows}
@item{X: @tt{Widget*}}
}
Some windows may not have a representation in the platform's GUI level,
in which case the result of this method is @scheme[0].
}
@defmethod[(get-size)
(values (integer-in 0 10000)
(integer-in 0 10000))]{
Gets the current size of the entire window in pixels, not counting
horizontal and vertical margins. (Under X, this size does not include
a title bar or borders for a frame/dialog.) See also
@method[window<%> get-client-size].
The geometry is returned as two values: width and height (in pixels).
See also
@method[area-container<%> reflow-container].
}
@defmethod[(get-client-size)
(values (integer-in 0 10000)
(integer-in 0 10000))]{
Gets the interior size of the window in pixels. For a container, the
interior size is the size available for placing subwindows (including
the border margin). For a canvas, this is the visible drawing
area.
The client size is returned as two values: width and height (in pixels).
See also
@method[area-container<%> reflow-container].
The @scheme[menu] is popped up within the window at position
(@scheme[x], @scheme[y]).
}
@ -352,47 +459,6 @@ local coordinates.
}
@defmethod[(focus)
void?]{
@index['("keyboard focus" "setting")]{Moves} the keyboard focus to the
window, relative to its top-level window, if the window ever accepts
the keyboard focus. If the focus is in the window's top-level
window, then the focus is immediately moved to this
window. Otherwise, the focus is not immediately moved, but when the
window's top-level window gets the keyboard focus, the focus is
delegated to this window.
See also
@method[window<%> on-focus].
Note that under X, keyboard focus can move to the menu bar
when the user is selecting a menu item.
@MonitorMethod[@elem{The current keyboard focus window} @elem{the user} @elem{@method[window<%> on-focus]} @elem{focus}]
}
@defmethod[(has-focus?)
boolean?]{
Indicates whether the window currently has the keyboard focus. See
also
@method[window<%> on-focus].
}
@defmethod[(popup-menu [menu (is-a/c popup-menu%)]
[x (integer-in 0 10000)]
[y (integer-in 0 10000)])
void?]{
@popupmenuinfo["window" "window" ""]
The @scheme[menu] is popped up within the window at position
(@scheme[x], @scheme[y]).
}
@defmethod[(set-cursor [cursor (or/c (is-a/c cursor%) false/c)])
void?]{
@ -407,12 +473,19 @@ If a window does not have a cursor, it uses the cursor of its parent.
}
@defmethod[(get-cursor)
(or/c (is-a/c cursor%) false/c)]{
Returns the window's cursor, or @scheme[#f] if this window's cursor
defaults to the parent's cursor. See
@method[window<%> set-cursor] for more information.
@defmethod[(set-label [l label-string?])
void?]{
Sets a window's label. The window's natural minimum size might be
different after the label is changed, but the window's minimum size
is not recomputed.
If the window was not created with a label, or if the window was
created with a non-string label, @scheme[l] is ignored.
See
@method[window<%> get-label] for more information.
}
@ -428,65 +501,5 @@ window is shown.
}
@defmethod[(is-shown?)
boolean?]{
Indicates whether the window is currently shown or not (when
all of its ancestors are also shown).
The result is @scheme[#t] if this window is shown when its ancestors are
shown, or @scheme[#f] if this window remains hidden when its ancestors
are shown.
}
@defmethod[(on-superwindow-show [shown? any/c])
void?]{
Called via the event queue whenever the visibility of a window has
changed, either through a call to the window's
@method[window<%> show], through the showing/hiding of one of the window's ancestors, or
through the activating or deactivating of the window or its ancestor
in a container (e.g., via
@method[area-container<%> delete-child]). The method's argument indicates whether the window is now
visible or not.
This method is not called when the window is initially created; it is
called only after a change from the window's initial
visibility. Furthermore, if a show notification event is queued for
the window and it reverts its visibility before the event is
dispatched, then the dispatch is canceled.
}
@defmethod[(on-drop-file [pathname path])
void?]{
@index["drag-and-drop"]{Called} when the user drags a file onto the
window. (Under X, drag-and-drop is supported via the XDND
protocol.) Drag-and-drop must first be enabled for the window with
@method[window<%> accept-drop-files].
Under Mac OS X, when the application is running and user
double-clicks an application-handled file or drags a file onto the
application's icon, the main thread's application file handler is
called (see
@scheme[application-file-handler]). The default handler calls the
@method[window<%> on-drop-file] method of the most-recently activated frame if drag-and-drop is
enabled for that frame, independent of the frame's eventspace (but
the method is called in the frame's eventspace's handler
thread). When the application is not running, the filenames are
provided as command-line arguments.
}
@defmethod*[([(accept-drop-files)
boolean?]
[(accept-drop-files [accept-files? any/c])
void?])]{
@index["drag-and-drop"]{Enables} or disables drag-and-drop dropping
for the window, or gets the enable state. Dropping is initially
disabled. See also @method[window<%> on-drop-file].
}}

View File

@ -8,36 +8,77 @@ The windowing toolbox.
@local-table-of-contents[]
@require["area-intf.scrbl"]
@include-class[area<%>]
@require["area-container-intf.scrbl"]
@include-class[area-container<%>]
@require["area-container-window-intf.scrbl"]
@include-class[area-container-window<%>]
@require["button-class.scrbl"]
@include-class[button%]
@require["canvas-class.scrbl"]
@include-class[canvas%]
@require["canvas-intf.scrbl"]
@include-class[canvas<%>]
@require["check-box-class.scrbl"]
@include-class[check-box%]
@require["choice-class.scrbl"]
@require["clipboard-client-class.scrbl"]
@require["clipboard-intf.scrbl"]
@require["combo-field-class.scrbl"]
@require["control-intf.scrbl"]
@include-class[control<%>]
@require["control-event-class.scrbl"]
@require["cursor-class.scrbl"]
@require["dialog-class.scrbl"]
@require["event-class.scrbl"]
@require["frame-class.scrbl"]
@require["gauge-class.scrbl"]
@require["group-box-panel-class.scrbl"]
@require["grow-box-spacer-pane-class.scrbl"]
@require["horizontal-pane-class.scrbl"]
@require["horizontal-panel-class.scrbl"]
@require["key-event-class.scrbl"]
@require["labelled-menu-item-intf.scrbl"]
@require["list-box-class.scrbl"]
@require["list-control-intf.scrbl"]
@require["menu-bar-class.scrbl"]
@require["menu-item-intf.scrbl"]
@require["pane-class.scrbl"]
@require["panel-class.scrbl"]
@require["subarea-intf.scrbl"]
@include-class[subarea<%>]
@require["subwindow-intf.scrbl"]
@include-class[subwindow<%>]
@require["top-level-window-intf.scrbl"]
@require["vertical-pane-class.scrbl"]
@require["vertical-panel-class.scrbl"]
@require["window-intf.scrbl"]
@include-class[area<%>]
@include-class[area-container<%>]
@include-class[area-container-window<%>]
@include-class[button%]
@include-class[canvas%]
@include-class[canvas<%>]
@include-class[check-box%]
@include-class[choice%]
@include-class[clipboard-client%]
@include-class[clipboard<%>]
@include-class[combo-field%]
@include-class[control<%>]
@include-class[control-event%]
@include-class[cursor%]
@include-class[dialog%]
@include-class[event%]
@include-class[frame%]
@include-class[gauge%]
@include-class[group-box-panel%]
@include-class[grow-box-spacer-pane%]
@include-class[horizontal-pane%]
@include-class[horizontal-panel%]
@include-class[key-event%]
@include-class[labelled-menu-item<%>]
@include-class[list-control<%>]
@include-class[list-box%]
@include-class[menu-bar%]
@include-class[menu-item<%>]
@include-class[pane%]
@include-class[panel%]
@include-class[subarea<%>]
@include-class[subwindow<%>]
@include-class[top-level-window<%>]
@include-class[vertical-pane%]
@include-class[vertical-panel%]
@include-class[window<%>]
@include-section["dialog-funcs.scrbl"]

View File

@ -160,13 +160,13 @@ defined to be: characters, symbols, booleans, null keywords, numbers,
void, and undefined.}
@defproc[(symbols/c [sym symbol?] ...+) flat-contract?]{
@defproc[(symbols [sym symbol?] ...+) flat-contract?]{
Accepts any number of symbols and returns a flat contract that
recognizes those symbols.}
@defproc[(is-a?/class [type? (or/c class? interface?)]) flat-contract?]{
@defproc[(is-a?/c [type? (or/c class? interface?)]) flat-contract?]{
Accepts a class or interface and returns a flat contract that
recognizes objects that instantiate the class/interface.}