more GUI reference work

svn: r7087

original commit: 4f0479a68864e23a72698474b288dc22c08d3e46
This commit is contained in:
Matthew Flatt 2007-08-13 16:36:43 +00:00
parent afc945f9cd
commit 2c49de1d50
42 changed files with 460 additions and 515 deletions

View File

@ -21,14 +21,14 @@ All @scheme[area-container<%>] classes accept the following named
@defmethod[(add-child [child (is-a/c subwindow<%>)])
@defmethod[(add-child [child (is-a?/c subwindow<%>)])
void?]{
Add the given subwindow to the set of non-deleted children. See also
@method[area-container<%> change-children].
}
@defmethod[(after-new-child [child (is-a/c subarea<%>)])
@defmethod[(after-new-child [child (is-a?/c subarea<%>)])
void?]{
@methspec{
@ -71,7 +71,7 @@ Gets or sets the border margin for the container in pixels. This
}
@defmethod[(change-children [filter ((listof (is-a/c subarea<%>)) . -> . (listof (is-a/c subarea<%>)))])
@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
@ -114,7 +114,7 @@ Called to determine the minimum size of a container. See
}
@defmethod[(delete-child [child (is-a/c subwindow<%>)])
@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].
@ -139,7 +139,7 @@ Returns the container's current alignment specification. See
}
@defmethod[(get-children)
(listof (is-a/c subarea<%>))]{
(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

View File

@ -39,7 +39,7 @@ See @|geomdiscuss| for more information. Note that the return value
}
@defmethod[(get-parent)
(or/c (is-a/c area-container<%>) false/c)]{
(or/c (is-a?/c area-container<%>) false/c)]{
Returns the area's parent. A top-level window may have no parent (in
which case @scheme[#f] is returned), or it may have another top-level
@ -48,7 +48,7 @@ Returns the area's parent. A top-level window may have no parent (in
}
@defmethod[(get-top-level-window)
(or/c (is-a/c frame%) (is-a/c dialog))]{
(or/c (is-a?/c frame%) (is-a?/c dialog))]{
Returns the area's closest frame or dialog ancestor. For a frame or
dialog area, the frame or dialog itself is returned.

View File

@ -19,10 +19,10 @@
following @litchar{&} is underlined in the displayed control to
indicate a keyboard mnemonic. (Under Mac OS X, mnemonic underlines are
not shown.) The mnemonic is meaningless for a @|what| (as far as
@method[top-level-window<%> on-traverse-char] is concerned),
@xmethod[top-level-window<%> on-traverse-char] is concerned),
but it is supported for consistency with other control types. A
programmer may assign a meaning to the mnemonic, e.g., by overriding
@method[top-level-window<%> on-traverse-char].})
programmer may assign a meaning to the mnemonic (e.g., by overriding
@method[top-level-window<%> on-traverse-char]).})
(define (labelstripped where detail what)
@elem{If @litchar{&} occurs in @|where|@|detail|, it

View File

@ -8,12 +8,12 @@ Whenever a button is clicked by the user, the buttons's callback
procedure is invoked. A callback procedure is provided as an
initialization argument when each button is created.
@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 button%) (is-a/c control-event%) . -> . any) (lambda (b e) (void))]
@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 button%) (is-a?/c control-event%) . -> . any) (lambda (b e) (void))]
[style (one-of/c 'border 'deleted) null]
[font (is-a/c font%) @scheme[normal-control-font]]
[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]
@ -57,7 +57,7 @@ on-traverse-char]). @DeletedStyleNote{button}
@defmethod[#:mode 'add
(set-label [label (is-a/c bitmap%)])
(set-label [label (is-a?/c bitmap%)])
void?]{
Sets the bitmap label for a bitmap button. @bitmaplabeluseisbm[label]

View File

@ -7,15 +7,15 @@ A @scheme[canvas%] object is a general-purpose window for drawing
and handling events.
@defconstructor[([parent (or/c (is-a/c frame%) (is-a/c dialog%)
(is-a/c panel%) (is-a/c pane%))]
@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 '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]
[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]
[gl-config (or/c (is-a?/c gl-config%) false/c) #f]
[enabled any/c #t]
[vert-margin (integer-in 0 1000) 0]
[horiz-margin (integer-in 0 1000) 0]
@ -279,7 +279,7 @@ Calls the procedure supplied as the @scheme[paint-callback] argument when
}
@defmethod[(on-scroll [event (is-a/c scroll-event%)])
@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

View File

@ -22,7 +22,7 @@ The @scheme[canvas<%>] interface is implemented by two classes:
@defmethod[(get-canvas-background)
(or/c (is-a/c color%) false/c)]{
(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].
@ -35,7 +35,7 @@ The result is @scheme[#f] if the canvas was created with the
@defmethod[(get-dc)
(is-a/c dc<%>)]{
(is-a?/c dc<%>)]{
Gets the canvas's device context. See
@scheme[dc<%>] for more information about drawing.
@ -76,7 +76,7 @@ The minimum width is ignored when it is smaller than the canvas's
}
@defmethod[(on-char [ch (is-a/c key-event%)])
@defmethod[(on-char [ch (is-a?/c key-event%)])
void?]{
@methspec{
@ -93,7 +93,7 @@ Does nothing.
}}
@defmethod[(on-event [event (is-a/c mouse-event%)])
@defmethod[(on-event [event (is-a?/c mouse-event%)])
void?]{
@methspec{
@ -157,7 +157,7 @@ Does nothing.
}}
@defmethod[(set-canvas-background [color (is-a/c color%)])
@defmethod[(set-canvas-background [color (is-a?/c color%)])
void?]{
Sets the color used to ``erase'' the canvas content before

View File

@ -13,13 +13,13 @@ 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))]
@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 (one-of/c 'deleted)) null]
[value any/c #f]
[font (is-a/c font%) @scheme[normal-control-font]]
[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]
@ -54,7 +54,7 @@ Gets the state of the check box: @scheme[#t] if it is checked, @scheme[#f]
}
@defmethod[#:mode 'add
(set-label [label (is-a/c bitmap%)])
(set-label [label (is-a?/c bitmap%)])
void?]{
Sets the bitmap label for a bitmap check box.

View File

@ -18,15 +18,15 @@ See also
@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)
[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]]
[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]

View File

@ -29,7 +29,7 @@ Generic data is always retrieved from the clipboard as a byte
@defmethod[(get-clipboard-bitmap [time (and/c exact? integer?)])
(or/c (is-a/c bitmap%) false/c)]{
(or/c (is-a?/c bitmap%) false/c)]{
Gets the current clipboard contents as a bitmap (Windows, Mac OS X),
returning @scheme[#f] if the clipboard does not contain a bitmap.
@ -80,7 +80,7 @@ See @|timediscuss| for a discussion of the @scheme[time] argument. If
}
@defmethod[(set-clipboard-bitmap [new-bitmap (is-a/c bitmap%)]
@defmethod[(set-clipboard-bitmap [new-bitmap (is-a?/c bitmap%)]
[time (and/c exact? integer?)])
void?]{
@ -93,7 +93,7 @@ See @|timediscuss| for
}
@defmethod[(set-clipboard-client [new-owner (is-a/c clipboard-client%)]
@defmethod[(set-clipboard-client [new-owner (is-a?/c clipboard-client%)]
[time (and/c exact? integer?)])
void?]{

View File

@ -14,15 +14,15 @@ A @scheme[combo-field%] object is a @scheme[text-field%]
@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)
[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]]
[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]
@ -74,7 +74,7 @@ Adds a new item to the combo's popup menu. The given label is used for
@defmethod[(get-menu)
(is-a/c popup-menu%)]{
(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
@ -83,7 +83,7 @@ Returns the @scheme[popup-menu%] that is used by the default
}
@defmethod[(on-popup [event (is-a/c control-event%)])
@defmethod[(on-popup [event (is-a?/c control-event%)])
void?]{
@methspec{

View File

@ -19,7 +19,7 @@ The @scheme[control<%>] interface is implemented by the built-in
@defmethod[(command [event (is-a/c control-event%)])
@defmethod[(command [event (is-a?/c control-event%)])
void?]{
Calls the control's callback function, passing on the given
@ -28,7 +28,7 @@ Calls the control's callback function, passing on the given
}
@defmethod[(get-font)
(is-a/c font%)]{
(is-a?/c font%)]{
Returns the font used for the control, which is optionally supplied
when a control is created.

View File

@ -14,8 +14,8 @@ A cursor is assigned to each window (or the window may use its
may be assigned to many windows.
@defconstructor*/make[(([image (is-a/c bitmap%)]
[mask (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 (one-of/c 'arrow 'bullseye 'cross 'hand 'ibeam 'watch 'blank

View File

@ -11,7 +11,7 @@ A dialog is a top-level window that is @defterm{modal}: while the
@defconstructor[([label label-string?]
[parent (or/c (is-a/c frame%) (is-a/c dialog%) false/c) #f]
[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]
@ -79,8 +79,8 @@ Even if the dialog is not shown, a few notification events may be
}
@defmethod[#:mode 'override
(on-subwindow-char [receiver (is-a/c window<%>)]
[event (is-a/c key-event%)])
(on-subwindow-char [receiver (is-a?/c window<%>)]
[event (is-a?/c key-event%)])
boolean?]{
Returns the result of

View File

@ -10,7 +10,7 @@ These functions get input from the user and/or display
@defproc[(get-file [message (or/c string? false/c) #f]
[parent (or/c (is-a/c frame%) (is-a/c dialog%) false/c) #f]
[parent (or/c (is-a?/c frame%) (is-a?/c dialog%) 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]
@ -63,7 +63,7 @@ See also @scheme[path-dialog%].
}
@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]
[parent (or/c (is-a?/c frame%) (is-a?/c dialog%) 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]
@ -77,7 +77,7 @@ Like
}
@defproc[(put-file [message (or/c string? false/c) #f]
[parent (or/c (is-a/c frame%) (is-a/c dialog%) false/c) #f]
[parent (or/c (is-a?/c frame%) (is-a?/c dialog%) 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]
@ -137,7 +137,7 @@ See also @scheme[path-dialog%].
}
@defproc[(get-directory [message (or/c string? false/c) #f]
[parent (or/c (is-a/c frame%) (is-a/c dialog%) 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 (one-of/c 'enter-packages)) null])
(or/c path false/c)]{
@ -168,7 +168,7 @@ 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]
[parent (or/c (is-a?/c frame%) (is-a?/c dialog%) false/c) #f]
[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].
@ -219,10 +219,10 @@ The class that implements the dialog provides a @scheme[get-message]
@defproc[(message-box/custom [title label-string?]
[message string]
[button1-label (or/c label-string? (is-a/c bitmap%) false/c)]
[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]
[button1-label (or/c label-string? (is-a?/c bitmap%) false/c)]
[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 (one-of/c 'stop 'caution 'number-order
'disallow-close 'no-default
'default=1 'default=2 'default=3))
@ -303,7 +303,7 @@ The class that implements the dialog provides a @scheme[get-message]
@defproc[(message+check-box [title label-string?]
[message string]
[check-label label-string?]
[parent (or/c (is-a/c frame%) (is-a/c dialog%) false/c) #f]
[parent (or/c (is-a?/c frame%) (is-a?/c dialog%) false/c) #f]
[style (listof (one-of/c 'ok 'ok-cancel 'yes-no
'caution 'stop 'checked))
'(ok)])
@ -324,10 +324,10 @@ Like @scheme[message-box], except that
@defproc[(message+check-box/custom [title label-string?]
[message string]
[check-label label-string?]
[button1-label (or/c label-string? (is-a/c bitmap%) false/c)]
[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]
[button1-label (or/c label-string? (is-a?/c bitmap%) false/c)]
[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 (one-of/c 'stop 'caution 'number-order
'disallow-close 'no-default
'default=1 'default=2 'default=3))
@ -351,7 +351,7 @@ Like @scheme[message-box/custom], except that
@defproc[(get-text-from-user [title string]
[message (or/c string? false/c)]
[parent (or/c (is-a/c frame%) (is-a/c dialog%) false/c) #f]
[parent (or/c (is-a?/c frame%) (is-a?/c dialog%) false/c) #f]
[init-val string? ""]
[style (listof (one-of/c 'password)) null])
(or/c string? false/c)]{
@ -376,7 +376,7 @@ If @scheme[style] includes @scheme['password], the dialog's text field
@defproc[(get-choices-from-user [title string]
[message (or/c string? false/c)]
[choices (listof string?)]
[parent (or/c (is-a/c frame%) (is-a/c dialog%) false/c) #f]
[parent (or/c (is-a?/c frame%) (is-a?/c dialog%) false/c) #f]
[init-choices (listof nonnegative-exact-integer?) null]
[style (listof (one-of/c 'single 'multiple 'extended)) '(single)])
(or/c (listof nonnegative-exact-integer?) false/c)]{
@ -401,10 +401,10 @@ The result is @scheme[#f] if the user cancels the dialog, the
}
@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]
[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])
(or/c (is-a/c color%) false/c)]{
(or/c (is-a?/c color%) false/c)]{
Lets the user select a color though the platform-specific
(modal) dialog, using @scheme[parent] as the parent window if it is
@ -422,10 +422,10 @@ 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]
[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]
[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])
(or/c (is-a/c font%) false/c)]{
(or/c (is-a?/c font%) false/c)]{
Lets the user select a font though the platform-specific
(modal) dialog, using @scheme[parent] as the parent window if it is
@ -443,10 +443,10 @@ 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]
[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]
[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])
(or/c (is-a/c ps-setup%) false/c)]{
(or/c (is-a?/c ps-setup%) false/c)]{
Lets the user select a PostScript configuration though a (modal)
dialog, using @scheme[parent] as the parent window if it is
@ -466,10 +466,10 @@ 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]
[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]
[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])
(or/c (is-a/c ps-setup%) false/c)]{
(or/c (is-a?/c ps-setup%) false/c)]{
Like
@scheme[get-ps-setup-from-user], but the dialog configures page layout for native printing

View File

@ -64,7 +64,7 @@ Inspects the event queue of the current eventspace, searching for a
}
@defproc[(get-top-level-windows)
(listof (or/c (is-a/c frame%) (is-a/c dialog%)))]{
(listof (or/c (is-a?/c frame%) (is-a?/c dialog%)))]{
Returns a list of visible top-level frames and dialogs in the current
eventspace.

View File

@ -11,7 +11,7 @@ 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]
[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]
@ -128,7 +128,7 @@ See also @method[frame% set-status-text].
}
@defmethod[(get-menu-bar)
(or/c (is-a/c menu-bar%) false/c)]{
(or/c (is-a?/c menu-bar%) false/c)]{
Returns the frame's menu bar, or @scheme[#f] if none has been created
for the frame.
@ -219,7 +219,7 @@ MDI activation is different from keyboard-focus activation. If the
}
@defmethod[(on-menu-char [event (is-a/c key-event%)])
@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
@ -242,8 +242,8 @@ If the event does not correspond to a complete shortcut combination,
}
@defmethod[#:mode 'override
(on-subwindow-char [receiver (is-a/c window<%>)]
[event (is-a/c key-event%)])
(on-subwindow-char [receiver (is-a?/c window<%>)]
[event (is-a?/c key-event%)])
boolean?]{
Returns the result of
@ -263,8 +263,8 @@ Under Mac OS X, called when the user clicks the toolbar button on a
}
@defmethod[(set-icon [icon (is-a/c bitmap%)]
[mask (is-a/c bitmap%) #f]
@defmethod[(set-icon [icon (is-a?/c bitmap%)]
[mask (is-a?/c bitmap%) #f]
[which (one-of/c 'small 'large 'both) 'both])
void?]{

View File

@ -12,13 +12,13 @@ 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%))]
[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]]
[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]
@ -30,7 +30,7 @@ of the gauge.
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}]
@labelsimplestripped[(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].

View File

@ -12,10 +12,10 @@ Unlike most panel classes, a group-box panel's horizontal and vertical
@defconstructor[([label label-string?]
[parent (or/c (is-a/c frame%) (is-a/c dialog%)
(is-a/c panel%) (is-a/c pane%))]
[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]]
[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]

View File

@ -7,8 +7,8 @@ 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%))]
@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]

View File

@ -6,8 +6,8 @@
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%))]
@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]

View File

@ -24,17 +24,17 @@ 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)
[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]]
[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]
@ -141,7 +141,7 @@ Reports the index of the item currently scrolled to the top of the
}
@defmethod[(get-label-font)
(is-a/c font%)]{
(is-a?/c font%)]{
Returns the font used for the control's label, which is optionally
supplied when a list box is created.

View File

@ -10,8 +10,8 @@ A @scheme[menu-bar%] object is created for a particular
@defconstructor[([parent (or/c (is-a/c frame%) (one-of/c 'root))]
[demand-callback ((is-a/c menu-bar%) . -> . any) (lambda (m) (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
@ -39,7 +39,7 @@ Enables or disables the menu bar (i.e., all of its menus). Each
@defmethod[(get-frame)
(is-a/c frame%)]{
(is-a?/c frame%)]{
Returns the menu bar's frame.

View File

@ -8,42 +8,31 @@ A @scheme[menu%] object is a submenu within a @scheme[menu%] or
@scheme[menu-bar%].
@defconstructor[[label label-string?]
[parent @scheme[menu%], @scheme[popup-menu%], or @scheme[menu-bar%] object]
[help-string (or/c label-string? false/c) #f]
[demand-callback procedure of one argument: a @scheme[menu%] object @scheme[void]]]{
@defconstructor[([label label-string?]
[parent (or/c (is-a?/c menu%) (is-a?/c popup-menu%)
(is-a?/c menu-bar%))]
[help-string (or/c label-string? false/c) #f]
[demand-callback ((is-a?/c menu%) . -> . any) (lambda (m) (void))])]{
Creates a new menu with the given label.
If @scheme[label] contains an ampersand (``\&''), it is handled
specially; under Windows, the character following an ampersand is
underlined in the displayed menu title to indicate a keyboard
mnemonic. Pressing and releasing the Alt key switches to
menu-selection mode in the menu bar where mnemonic characters are
used for navigation. An Alt combination might select a specific menu
via @method[frame% on-menu-char]. A double-ampersand in
@scheme[label] is replaced by a literal (non-navigation)
ampersand. Under X and Mac OS X, ampersands in the label are parsed
in the same way as for Windows, but no mnemonic underline is
displayed.
If @scheme[label] contains a @litchar{&}, it is handled specially;
under Windows, the character following a @litchar{&} is underlined in
the displayed menu title to indicate a keyboard mnemonic. Pressing
and releasing the Alt key switches to menu-selection mode in the menu
bar where mnemonic characters are used for navigation. An Alt
combination might select a specific menu via @method[frame%
on-menu-char]. A @litchar{&&} in @scheme[label] is replaced by a
literal (non-navigation) @litchar{&}ampersand. Under X and Mac OS X,
@litchar{&}s in the label are parsed in the same way as for Windows,
but no mnemonic underline is displayed.
If @scheme[help] is not @scheme[#f], the menu has a help string. See
@method[labelled-menu-item<%> get-help-string] for more information.
If @scheme[help-string] is not @scheme[#f], the menu has a help
string. See @method[labelled-menu-item<%> get-help-string] for more
information.
The @scheme[demand-callback] procedure is called by the default
@method[menu-item-container<%> on-demand] method with the object itself.
\index{``About'' boxes} \index{``Help'' menus}
If the menu has the label ``Help'' in a menu bar, it is treated
specially on some platforms. Under Mac OS X, the items of a
``Help'' menu are folded into the standard help menu. In addition,
under Mac OS X, if the name of the first item in the ``Help''
menu starts with ``About'', then the menu item is duplicated as the
first item under the Apple menu.
}}

View File

@ -8,17 +8,16 @@ A @scheme[menu-item%] is a plain string-labelled menu item. Its
user selects the menu item, its callback procedure is called.
@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)
[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)
[demand-callback ((is-a?/c menu-item%) . -> . any)
(lambda (i) (void))]
[shortcut-prefix (listof (one-of/c 'alt 'cmd 'meta 'ctl 'shift 'option))
[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
@ -29,7 +28,7 @@ Creates a new menu item in @scheme[parent]. The item is initially
popup-menu]).
See @method[labelled-menu-item<%> set-label] for information about
mnemonic ampersands (``\&'') in @scheme[label].
mnemonic @litchar{&}s 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.
@ -44,4 +43,3 @@ The @scheme[demand-callback] procedure is called by the default
@method[menu-item-container<%> on-demand] method with the object itself.
}}

View File

@ -7,21 +7,18 @@ A @scheme[menu-item-container<%>] object is a @scheme[menu%],
@scheme[popup-menu%], or @scheme[menu-bar%].
@defmethod[(get-items)
list of @scheme[menu-item<%>] objects]{
@spec{
(listof (is-a?/c menu-item<%>))]{
Returns a list of the items in the menu, popup menu, or menu bar. The
order of the items in the returned list corresponds to the order as
the user sees them in the menu or menu bar.
}}
}
@defmethod[(on-demand)
void?]{
@spec{
@methspec{
Called when the user clicks on the container as a menu bar (before the
user sees any menu items), just before the container as a popup menu
@ -29,22 +26,19 @@ Called when the user clicks on the container as a menu bar (before the
item for a shortcut key binding.
If the container is not a menu bar or a popup menu, this method is
normally called via the
@method[menu-item-container<%> on-demand] method of the container's owning menu bar or popup menu, because the
normally called via the @method[menu-item-container<%> on-demand]
method of the container's owning menu bar or popup menu, because the
default implementation of the method chains to the
@method[labelled-menu-item<%> on-demand] method of its items. However, the method can be overridden in a
container such that it does not call the
@method[labelled-menu-item<%> on-demand] method of its items.
@method[labelled-menu-item<%> on-demand] method of its
items. However, the method can be overridden in a container such that
it does not call the @method[labelled-menu-item<%> on-demand] method
of its items.
}
@impl{
Calls the @scheme[demand-callback] procedure that was provided when the
object was created, then calls the
@method[labelled-menu-item<%> on-demand] method of the contained items.
@methimpl{
Calls the @scheme[demand-callback] procedure that was provided when
the object was created, then calls the @method[labelled-menu-item<%>
on-demand] method of the contained items.
}}}

View File

@ -28,7 +28,7 @@ See also @method[menu-item<%> restore].
}
@defmethod[(get-parent)
(or/c (is-a/c menu%) (is-a/c popup-menu%) (is-a/c menu-bar%))]{
(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,

View File

@ -8,46 +8,42 @@ A message control is a static line of text or a static bitmap. The
@method[window<%> set-label]).
@defconstructor[[label {\labelstring}, @scheme[bitmap%] object, @scheme['app], @scheme['caution], or @scheme['stop]]
[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[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? (is-a?/c bitmap%)
(or-of/c 'app 'caution 'stop))]
[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[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 string or bitmap message initially showing @scheme[label].
@bitmaplabeluse[label] An @indexed-scheme['app], @indexed-scheme['caution],
or @indexed-scheme['stop] symbol for @scheme[label] indicates an icon;
@scheme['app] is the application icon (Windows and Mac OS X) or a
generic ``info'' icon (X), @scheme['caution] is a caution-sign icon,
and @scheme['stop] a stop-sign icon.
@bitmaplabeluse[label] An @indexed-scheme['app],
@indexed-scheme['caution], or @indexed-scheme['stop] symbol for
@scheme[label] indicates an icon; @scheme['app] is the application
icon (Windows and Mac OS X) or a generic ``info'' icon (X),
@scheme['caution] is a caution-sign icon, and @scheme['stop] a
stop-sign icon.
@labelstripped[(scheme label) @elem{message}]
@labelsimplestripped[(scheme label) @elem{message}]
\DeletedStyleNote{message}
@DeletedStyleNote{message}
@FontKWs[] @WindowKWs[] @SubareaKWs[] @AreaKWs[]
}
@defmethod[#:mode 'add
(set-label [label (is-a/c bitmap%)])
(set-label [label (is-a?/c bitmap%)])
void?]{
@impl{
Sets the bitmap label for a bitmap message.
@bitmaplabeluseisbm[label] @|bitmapiforiglabel|
}}}
}}

View File

@ -22,7 +22,7 @@ Rings the system bell.
}
@defproc[(play-sound [filename path]
@defproc[(play-sound [filename path-string?]
[async? any/c])
boolean?]{
@ -126,10 +126,10 @@ Hides the cursor until the user moves the mouse or clicks the mouse
}
@defproc[(get-resource [section string]
[entry string]
[value (boxof exact-integer?)]
[file (or/c path false/c) #f])
@defproc[(get-resource [section string?]
[entry string?]
[value (box/c exact-integer?)]
[file (or/c path? false/c) #f])
boolean?]{
Gets a resource value from the resource database. The resource value
@ -191,10 +191,10 @@ Strips shortcut ampersands from @scheme[label], removes parenthesized
}
@defproc[(write-resource [section string]
[entry string]
@defproc[(write-resource [section string?]
[entry string?]
[value (or/c string? exact-integer?)]
[file (or/c path false/c) #f])
[file (or/c path-string? false/c) #f])
boolean?]{
Writes a resource value to the specified resource database. The
@ -218,7 +218,7 @@ See also @scheme[get-resource].}
@defproc[(get-default-shortcut-prefix)
(listof (symbols/c option shift ctl meta cmd alt))]{
(listof (one-of/c 'alt 'cmd 'meta 'ctl 'shift 'option))]{
Returns an immutable list specifying the default prefix for menu
shortcuts. See also
@xmethod[selectable-menu-item<%> get-shortcut-prefix].
@ -229,8 +229,8 @@ default is @scheme['(cmd)]. Under X, the default is normally
@Resource{defaultMenuPrefix} low-level preference (see
@|mrprefsdiscuss|).}
@defproc[(find-graphical-system-path [what (symbols/c x-display setup-file init-file)])
(or/c path false/c)]{
@defproc[(find-graphical-system-path [what (one-of/c 'init-file 'setup-file 'x-display)])
(or/c path? false/c)]{
Finds a platform-specific (and possibly user- or machine-specific)
standard filename or directory. See also @scheme[find-system-path].
@ -307,14 +307,14 @@ The keymap for the read-eval-print loop's editor is initialized by
}
@defthing[the-clipboard (is-a/c clipboard<%>)]{
@defthing[the-clipboard (is-a?/c clipboard<%>)]{
See @scheme[clipboard<%>].
}
@defthing[the-x-selection-clipboard (is-a/c clipboard<%>)]{
@defthing[the-x-selection-clipboard (is-a?/c clipboard<%>)]{
See @scheme[clipboard<%>].
@ -322,7 +322,7 @@ See @scheme[clipboard<%>].
}
@defproc[(get-window-text-extent [string string]
[font (is-a/c font%)])
[font (is-a?/c font%)])
(values nonnegative-exact-integer?
nonnegative-exact-integer?)]{
@ -333,7 +333,7 @@ See also @method[dc<%> get-text-extent].
}
@defproc[(get-panel-background)
(is-a/c color%)]{
(is-a?/c color%)]{
Returns the background color of a panel (usually some shade of gray)
for the current platform.
@ -366,7 +366,7 @@ The get operation always returns @scheme[#"????"] and @scheme[#"????"] for
[event-id-bytes (lambda (s) (and (bytes? s)
(= 4 (bytes-length s))))]
[direct-arg-v any/c (void)]
[argument-list list null])
[argument-list list? null])
any/c]{
Sends an AppleEvent or raises @scheme[exn:fail:unsupported].
@ -424,8 +424,8 @@ If the AppleEvent reply contains a value that cannot be
}
@defproc[(make-namespace-with-mred [flag (symbols/c empty initial mred) 'mred])
namespace]{
@defproc[(make-namespace-with-mred [flag (one-of/c 'mred 'initial 'empty) 'mred])
namespace?]{
Like @scheme[make-namespace], but the @scheme[(lib "mred.ss"
"mred")] module of the current namespace is attached. In addition, by

View File

@ -13,21 +13,24 @@ See also @|mousekeydiscuss|.
@defconstructor[[event-type (symbols/c motion right-up right-down middle-up middle-down left-up left-down leave enter)]
[left-down any/c #f]
[middle-down any/c #f]
[right-down any/c #f]
[x (and/c exact? integer?) 0]
[y (and/c exact? integer?) 0]
[shift-down any/c #f]
[control-down any/c #f]
[meta-down any/c #f]
[alt-down any/c #f]
[time-stamp (and/c exact? integer?) 0]
[caps-down any/c #f]]{
@defconstructor[([event-type (one-of/c 'enter 'leave 'left-down 'left-up
'middle-down 'middle-up
'right-down 'right-up 'motion)]
[left-down any/c #f]
[middle-down any/c #f]
[right-down any/c #f]
[x (and/c exact? integer?) 0]
[y (and/c exact? integer?) 0]
[shift-down any/c #f]
[control-down any/c #f]
[meta-down any/c #f]
[alt-down any/c #f]
[time-stamp (and/c exact? integer?) 0]
[caps-down any/c #f])]{
Creates a mouse event for a particular type of event. The event types
are:
@itemize{
@item{@scheme['enter] --- mouse pointer entered the window}
@item{@scheme['leave] --- mouse pointer left the window}
@ -40,267 +43,60 @@ Creates a mouse event for a particular type of event. The event types
@item{@scheme['motion] --- mouse moved, with or without button(s) pressed}
}
See the corresponding @scheme[get-] and @scheme[set-] methods for
information about @scheme[left-down], @scheme[middle-down],
@scheme[right-down], @scheme[x], @scheme[y], @scheme[shift-down],
@scheme[control-down], @scheme[meta-down], @scheme[alt-down],
@scheme[time-stamp], and @scheme[caps-down].
See the corresponding @schemeidfont{get-} and @schemeidfont{set-}
methods for information about @scheme[left-down],
@scheme[middle-down], @scheme[right-down], @scheme[x], @scheme[y],
@scheme[shift-down], @scheme[control-down], @scheme[meta-down],
@scheme[alt-down], @scheme[time-stamp], and @scheme[caps-down].
}
@defmethod[(get-control-down)
@defmethod[(button-changed? [button (one-of/c 'left 'middle 'right 'any) 'any])
boolean?]{
@spec{
Returns @scheme[#t] if the Control key was down for the event.
Returns @scheme[#t] if this was a mouse button press or release event,
@scheme[#f] otherwise. See also
@method[mouse-event% button-up?] and
@method[mouse-event% button-down?].
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[mouse-event% get-control-down] for the event reports @scheme[#f].
If @scheme[button] is not @scheme['any], then @scheme[#t] is only returned
if it is a release event for a specific button.
}}
}
@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[mouse-event% get-control-down] for the event reports @scheme[#f].
}}
@defmethod[(get-shift-down)
@defmethod[(button-down? [button (one-of/c 'left 'middle 'right 'any) 'any])
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[mouse-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[mouse-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-event-type)
(symbols/c motion right-up right-down middle-up middle-down left-up left-down leave enter)]{
@spec{
Returns the type of the event; see
@scheme[mouse-event%] for information about each event type. See also
@method[mouse-event% set-event-type] .
}}
@defmethod[(set-event-type [event-type (symbols/c motion right-up right-down middle-up middle-down left-up left-down leave enter)])
void?]{
@spec{
Sets the type of the event; see
@scheme[mouse-event%] for information about each event type. See also
@method[mouse-event% get-event-type] .
}}
@defmethod[(get-left-down)
boolean?]{
@spec{
Returns @scheme[#t] if the left mouse button was down (but not pressed) during the event.
}}
@defmethod[(set-left-down [down? any/c])
void?]{
@spec{
Sets whether the left mouse button was down (but not pressed) during the event.
}}
@defmethod[(get-middle-down)
boolean?]{
@spec{
Returns @scheme[#t] if the middle mouse button was down (but not pressed) for the event.
Under Mac OS X, a middle-button click is impossible.
}}
@defmethod[(set-middle-down [down? any/c])
void?]{
@spec{
Sets whether the middle mouse button was down (but not pressed) for
the event. Under Mac OS X, a middle-button click is impossible.
}}
@defmethod[(get-right-down)
boolean?]{
@spec{
Returns @scheme[#t] if the right mouse button was down (but not pressed)
for the event. Under Mac OS X, a control-click combination is treated as
a right-button click.
}}
@defmethod[(set-right-down [down? any/c])
void?]{
@spec{
Sets whether the right mouse button was down (but not pressed) for the
event. Under Mac OS X, a control-click combination by the user is
treated as a right-button click.
}}
@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-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.
}}
@defmethod[(button-down? [button (symbols/c any right middle left) 'any])
boolean?]{
@spec{
Returns @scheme[#t] if the event is for a button press, @scheme[#f]
otherwise.
}
@impl{
If @scheme[button] is not @scheme['any], then @scheme[#t] is only returned
if it is a press event for a specific button.
}
}}
@defmethod[(button-up? [button (symbols/c any right middle left) 'any])
@defmethod[(button-up? [button (one-of/c 'left 'middle 'right 'any) 'any])
boolean?]{
@spec{
Returns @scheme[#t] if the event is for a button release, @scheme[#f]
otherwise. (As noted in @|mousekeydiscuss|, button release events are
sometimes dropped.)
}
@impl{
If @scheme[button] is not @scheme['any], then @scheme[#t] is only returned
if it is a release event for a specific button.
}}
}
@defmethod[(dragging?)
boolean?]{
@spec{
Returns @scheme[#t] if this was a dragging event (motion while a button
is pressed), @scheme[#f] otherwise.
}}
}
@defmethod[(entering?)
boolean?]{
@spec{
Returns @scheme[#t] if this event is for the mouse entering a window,
@scheme[#f] otherwise.
@ -311,55 +107,216 @@ When the mouse button is up, an enter/leave event notifies a window
all mouse events until the button is released; enter/leave events are
not sent to other windows, and are not reliably delivered to the
click-handling window (since the window can detect movement out of
its region via
@method[mouse-event% get-x] and
@method[mouse-event% get-y]). See also @|mousekeydiscuss|.
its region via @method[mouse-event% get-x] and @method[mouse-event%
get-y]). See also @|mousekeydiscuss|.
}}
}
@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[mouse-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?]{
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[mouse-event% get-control-down] for the event reports
@scheme[#f].
}
@defmethod[(get-event-type)
(one-of/c 'enter 'leave 'left-down 'left-up
'middle-down 'middle-up
'right-down 'right-up 'motion)]{
Returns the type of the event; see @scheme[mouse-event%] for
information about each event type. See also @method[mouse-event%
set-event-type] .
}
@defmethod[(get-left-down)
boolean?]{
Returns @scheme[#t] if the left mouse button was down (but not pressed) during the event.
}
@defmethod[(get-meta-down)
boolean?]{
Returns @scheme[#t] if the Meta (X), Alt (Windows), or Command (Mac OS
X) key was down for the event.
}
@defmethod[(get-middle-down)
boolean?]{
Returns @scheme[#t] if the middle mouse button was down (but not
pressed) for the event. Under Mac OS X, a middle-button click is
impossible.
}
@defmethod[(get-right-down)
boolean?]{
Returns @scheme[#t] if the right mouse button was down (but not
pressed) for the event. Under Mac OS X, a control-click combination
is treated as a right-button click.
}
@defmethod[(get-shift-down)
boolean?]{
Returns @scheme[#t] if the Shift key was down for the event.
}
@defmethod[(get-x)
(and/c exact? integer?)]{
Returns 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?)]{
Returns the y-position of the mouse at the time of the event in the
target's window's (client-area) coordinate system.
}
@defmethod[(leaving?)
boolean?]{
@spec{
Returns @scheme[#t] if this event is for the mouse leaving a window,
@scheme[#f] otherwise.
See
@method[mouse-event% entering?] for information about enter and leave events while the mouse button is
clicked.
}}
@defmethod[(button-changed? [button (symbols/c any right middle left) 'any])
boolean?]{
@spec{
Returns @scheme[#t] if this was a mouse button press or release event,
@scheme[#f] otherwise. See also
@method[mouse-event% button-up?] and
@method[mouse-event% button-down?].
See @method[mouse-event% entering?] for information about enter and
leave events while the mouse button is clicked.
}
@impl{
If @scheme[button] is not @scheme['any], then @scheme[#t] is only returned
if it is a release event for a specific button.
}}
@defmethod[(moving?)
boolean?]{
@spec{
Returns @scheme[#t] if this was a moving event (whether a button is
pressed is not), @scheme[#f] otherwise.
}
@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[mouse-event% set-meta-down]).
}
@impl{
@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[mouse-event% get-control-down] for the event reports
@scheme[#f].
}
@defmethod[(set-event-type [event-type (one-of/c 'enter 'leave 'left-down 'left-up
'middle-down 'middle-up
'right-down 'right-up 'motion)])
void?]{
Sets the type of the event; see @scheme[mouse-event%] for information
about each event type. See also @method[mouse-event% get-event-type] .
}
@defmethod[(set-left-down [down? any/c])
void?]{
Sets whether the left mouse button was down (but not pressed) during
the event.
}
@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-middle-down [down? any/c])
void?]{
Sets whether the middle mouse button was down (but not pressed) for
the event. Under Mac OS X, a middle-button click is impossible.
}
@defmethod[(set-right-down [down? any/c])
void?]{
Sets whether the right mouse button was down (but not pressed) for the
event. Under Mac OS X, a control-click combination by the user is
treated as a right-button click.
}
@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?]{
Sets the y-position of the mouse at the time of the event in the
target's window's (client-area) coordinate system.
}}

View File

@ -15,8 +15,8 @@ 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%))]
@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]

View File

@ -15,8 +15,8 @@ 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%))]
@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]

View File

@ -20,7 +20,7 @@ A popup menu is {\em not} a control. A @scheme[choice%] control,
@defconstructor[[title (or/c label-string? false/c) #f]
[popdown-callback procedure of two arguments: a @scheme[popup-menu%] object and a @scheme[control-event%] object @scheme[(\scmk{lambda] (@scheme[m] @scheme[e]) (void))}]
[demand-callback procedure of one argument: a @scheme[popup-menu%] object @scheme[void]]
[font (is-a/c font%) @scheme[normal-control-font]]]{
[font (is-a?/c font%) @scheme[normal-control-font]]]{
If @scheme[title] is not @scheme[#f], it is used as a displayed title at
the top of the popup menu.
@ -50,7 +50,7 @@ The @scheme[font] argument determines the font for the popup menu's
}
@defmethod[(get-popup-target)
(or/c (or/c (is-a/c window<%>) (is-a/c editor<%>)) false/c)]{
(or/c (or/c (is-a?/c window<%>) (is-a?/c editor<%>)) false/c)]{
@spec{
Returns the context in which the popup menu is currently displayed, or
@ -64,7 +64,7 @@ The context is set before the
}}
@defmethod[(get-font)
(is-a/c font%)]{
(is-a?/c font%)]{
@spec{
Returns the font used for the popup menu's items, which is optionally

View File

@ -19,11 +19,11 @@ Whenever the user changes the selected radio button, the radio box's
@defconstructor[[label (or/c label-string? false/c)]
[choices list of {\labelstrings} or @scheme[bitmap%] objects]
[parent (or/c (is-a/c frame%) (is-a/c dialog%) (is-a/c panel%) (is-a/c pane%))]
[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[radio-box%] object and a @scheme[control-event%] object @scheme[(\scmk{lambda] (@scheme[rb] @scheme[e]) (void))}]
[style (symbols/c deleted horizontal-label vertical-label vertical horizontal) '(vertical)]
[selection nonnegative-exact-integer? 0]
[font (is-a/c font%) @scheme[normal-control-font]]
[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]

View File

@ -98,7 +98,7 @@ See
}}
@defmethod[(command [event (is-a/c control-event%)])
@defmethod[(command [event (is-a?/c control-event%)])
void?]{
@spec{

View File

@ -17,11 +17,11 @@ Whenever the user changes the value of a slider, its callback
@defconstructor[[label (or/c label-string? false/c)]
[min-value (integer-in -10000 10000)]
[max-value (integer-in -10000 10000)]
[parent (or/c (is-a/c frame%) (is-a/c dialog%) (is-a/c panel%) (is-a/c pane%))]
[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[slider%] object and a @scheme[control-event%] object @scheme[(\scmk{lambda] (@scheme[s] @scheme[e]) (void))}]
[init-value (integer-in -10000 10000) @scheme[min-value]]
[style (symbols/c deleted horizontal-label vertical-label plain vertical horizontal) '(horizontal)]
[font (is-a/c font%) @scheme[normal-control-font]]
[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]

View File

@ -16,10 +16,10 @@ The @scheme[tab-panel%] class does not implement the virtual
@defconstructor[[choices list of {\labelstrings}]
[parent (or/c (is-a/c frame%) (is-a/c dialog%) (is-a/c panel%) (is-a/c pane%))]
[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[tab-panel%] object and a @scheme[control-event%] object @scheme[(\scmk{lambda] (@scheme[tp] @scheme[e]) (void))}]
[style (symbols/c deleted no-border) null]
[font (is-a/c font%) @scheme[normal-control-font]]
[font (is-a?/c font%) @scheme[normal-control-font]]
[enabled any/c #t]
[vert-margin (integer-in 0 1000) 0]
[horiz-margin (integer-in 0 1000) 0]

View File

@ -39,11 +39,11 @@ The keymap for the text field's editor is initialized by calling the
@defconstructor[[label (or/c label-string? false/c)]
[parent (or/c (is-a/c frame%) (is-a/c dialog%) (is-a/c panel%) (is-a/c pane%))]
[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[text-field%] object and a @scheme[control-event%] object @scheme[(\scmk{lambda] (@scheme[tf] @scheme[e]) (void))}]
[init-value string ""]
[style (symbols/c deleted horizontal-label vertical-label password hscroll multiple single) '(single)]
[font (is-a/c font%) @scheme[normal-control-font]]
[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]
@ -110,7 +110,7 @@ Sets the text currently in the text field. (The control's callback
}}
@defmethod[(get-editor)
(is-a/c text%)]{
(is-a?/c text%)]{
@spec{
Returns the editor used to implement the text field.

View File

@ -48,7 +48,7 @@ If @scheme[direction] is @scheme['horizontal], the window is centered
}
@defmethod[(get-edit-target-object)
(or/c (or/c (is-a/c window<%>) (is-a/c editor<%>)) false/c)]{
(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
@ -61,7 +61,7 @@ See also @method[top-level-window<%> get-focus-object].
}
@defmethod[(get-edit-target-window)
(or/c (is-a/c window<%>) false/c)]{
(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
@ -81,7 +81,7 @@ Returns the window's eventspace.
}
@defmethod[(get-focus-object)
(or/c (or/c (is-a/c window<%>) (is-a/c editor<%>)) false/c)]{
(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
@ -94,7 +94,7 @@ See also @method[top-level-window<%> get-edit-target-object].
}
@defmethod[(get-focus-window)
(or/c (is-a/c window<%>) false/c)]{
(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
@ -192,7 +192,7 @@ Returns @|void-const|.
}}
@defmethod[(on-traverse-char [event (is-a/c key-event%)])
@defmethod[(on-traverse-char [event (is-a?/c key-event%)])
boolean?]{
@methspec{
@ -291,7 +291,7 @@ Otherwise, @scheme[#f] is returned.}
}
}}
@defmethod[(on-system-menu-char [event (is-a/c key-event%)])
@defmethod[(on-system-menu-char [event (is-a?/c key-event%)])
boolean?]{
Checks whether the given event pops open the system menu in the

View File

@ -8,8 +8,8 @@ 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%))]
@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]

View File

@ -9,8 +9,8 @@ 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%))]
@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]

View File

@ -93,7 +93,7 @@ See also
@defmethod[(get-cursor)
(or/c (is-a/c cursor%) false/c)]{
(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
@ -136,7 +136,8 @@ See also
}
@defmethod[(get-label)
(or/c {\labelstring}, @scheme[bitmap%] object, @scheme['app], @scheme['caution], @scheme['stop], false/c)]{
(or/c label-string? (is-a?/c bitmap%)
(one-of/c 'app 'caution '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
@ -331,8 +332,8 @@ Does nothing.
}}
@defmethod[(on-subwindow-char [receiver (is-a/c window<%>)]
[event (is-a/c key-event%)])
@defmethod[(on-subwindow-char [receiver (is-a?/c window<%>)]
[event (is-a?/c key-event%)])
boolean?]{
@methspec{
@ -363,8 +364,8 @@ Returns @scheme[#f].
}}
@defmethod[(on-subwindow-event [receiver (is-a/c window<%>)]
[event (is-a/c mouse-event%)])
@defmethod[(on-subwindow-event [receiver (is-a?/c window<%>)]
[event (is-a?/c mouse-event%)])
boolean?]{
@methspec{
@ -430,7 +431,7 @@ This method is not called when the window is initially created; it is
}
@defmethod[(popup-menu [menu (is-a/c popup-menu%)]
@defmethod[(popup-menu [menu (is-a?/c popup-menu%)]
[x (integer-in 0 10000)]
[y (integer-in 0 10000)])
void?]{
@ -460,7 +461,7 @@ local coordinates.
}
@defmethod[(set-cursor [cursor (or/c (is-a/c cursor%) false/c)])
@defmethod[(set-cursor [cursor (or/c (is-a?/c cursor%) false/c)])
void?]{
Sets the window's cursor. Providing @scheme[#f] instead of a cursor

View File

@ -11,8 +11,8 @@ The windowing toolbox.
@require["area-container-intf.scrbl"]
@require["area-container-window-intf.scrbl"]
@require["button-class.scrbl"]
@require["canvas-class.scrbl"]
@require["canvas-intf.scrbl"]
@require["canvas-class.scrbl"]
@require["check-box-class.scrbl"]
@require["choice-class.scrbl"]
@require["clipboard-client-class.scrbl"]
@ -33,8 +33,13 @@ The windowing toolbox.
@require["labelled-menu-item-intf.scrbl"]
@require["list-box-class.scrbl"]
@require["list-control-intf.scrbl"]
@require["menu-class.scrbl"]
@require["menu-bar-class.scrbl"]
@require["menu-item-intf.scrbl"]
@require["menu-item-class.scrbl"]
@require["menu-item-container-intf.scrbl"]
@require["message-class.scrbl"]
@require["mouse-event-class.scrbl"]
@require["pane-class.scrbl"]
@require["panel-class.scrbl"]
@require["subarea-intf.scrbl"]
@ -48,8 +53,8 @@ The windowing toolbox.
@include-class[area-container<%>]
@include-class[area-container-window<%>]
@include-class[button%]
@include-class[canvas%]
@include-class[canvas<%>]
@include-class[canvas%]
@include-class[check-box%]
@include-class[choice%]
@include-class[clipboard-client%]
@ -70,8 +75,13 @@ The windowing toolbox.
@include-class[labelled-menu-item<%>]
@include-class[list-control<%>]
@include-class[list-box%]
@include-class[menu%]
@include-class[menu-bar%]
@include-class[menu-item<%>]
@include-class[menu-item%]
@include-class[menu-item-container<%>]
@include-class[message%]
@include-class[mouse-event%]
@include-class[pane%]
@include-class[panel%]
@include-class[subarea<%>]