From b771af51a9d99542e3bc7da66597bbeace845ed5 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Thu, 9 Aug 2007 22:43:41 +0000 Subject: [PATCH] checkpoint mred doc work svn: r7071 --- .../scribblings/gui/area-container-intf.scrbl | 163 +++++-------- .../gui/area-container-window-intf.scrbl | 2 +- collects/scribblings/gui/area-intf.scrbl | 100 ++------ collects/scribblings/gui/button-class.scrbl | 32 +-- collects/scribblings/gui/control-intf.scrbl | 11 +- collects/scribblings/gui/subarea-intf.scrbl | 38 +-- collects/scribblings/gui/window-intf.scrbl | 228 +++++++----------- collects/scribblings/gui/windowing.scrbl | 24 ++ 8 files changed, 198 insertions(+), 400 deletions(-) diff --git a/collects/scribblings/gui/area-container-intf.scrbl b/collects/scribblings/gui/area-container-intf.scrbl index 12decb2ceb..64025481db 100644 --- a/collects/scribblings/gui/area-container-intf.scrbl +++ b/collects/scribblings/gui/area-container-intf.scrbl @@ -23,26 +23,24 @@ All @scheme[area-container<%>] classes accept the following named @defmethod[(get-children) - list of @scheme[subarea<%>] objects]{ -@spec{ - + (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 procedure of one argument, a list of \scmintf{subarea} objects, that returns a list of \scmintf{subarea} objects]) +@defmethod[(change-children [filter ((listof (is-a/c subarea<%>)) . -> . (listof (is-a/c subarea<%>)))]) void?]{ -@spec{ -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). +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 @@ -52,56 +50,59 @@ 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 list of list containing two \IntsIn{0}{10000} and two booleans] +@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)]) - list of list containing four \IntsIn{0}{10000}]{ -@spec{ + (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 list of list containing two \IntsIn{0}{10000} and two booleans]) - two \IntsIn{0}{10000}]{ -@spec{ +@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?]{ -@spec{ - Add the given subwindow to the set of non-deleted children. See also @method[area-container<%> change-children]. -}} +} @defmethod[(delete-child [child (is-a/c subwindow<%>)]) void?]{ -@spec{ - 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?]{ -@spec{ +@methspec{ This method is called after a new containee area is created with this area as its container. The new child is provided as an argument to the method. } -@impl{ +@methimpl{ Does nothing. @@ -113,64 +114,26 @@ Does nothing. (integer-in 0 1000)] [(border [margin (integer-in 0 1000)]) void?])]{ -@spec{ Gets or sets the border margin for the container in pixels. This margin is used as an inset into the panel's client area before the locations and sizes of the subareas are computed. - } -@impl{ -First case: - - -Returns the current border margin. - - - -Second case: - - -Sets the border margin. - - - -}} @defmethod*[([(spacing) (integer-in 0 1000)] [(spacing [spacing (integer-in 0 1000)]) void?])]{ -@spec{ 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). - } -@impl{ -First case: - - -Returns the current spacing. - - - -Second case: - - -Sets the spacing. - - - -}} @defmethod[(set-alignment [horiz-align (symbols/c right center left)] [vert-align (symbols/c bottom center top)]) void?]{ -@spec{ - 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). @@ -185,51 +148,46 @@ When the container's horizontal alignment is @scheme['left], the Similarly, a container's vertical alignment can be @scheme['top], @scheme['center], or @scheme['bottom]. -}} +} @defmethod[(get-alignment) - two symbols]{ -@spec{ + (values (symbols/c right center left) + (symbols/c bottom center top))]{ Returns the container's current alignment specification. See @method[area-container<%> set-alignment] for more information. -}} +} @defmethod[(reflow-container) void?]{ -@spec{ -When a container window is not shown, changes to the container's set - of children do not necessarily trigger the immediate re-computation - of the container's size and its children's sizes and positions. - Instead, the recalculation is delayed until the container is shown, - which avoids redundant computations between a series of changes. The -@method[area-container<%> reflow-container] method forces the immediate recalculation of the container's and its - children's sizes and locations. +When a container window is not shown, changes to the container's +set of children do not necessarily trigger the immediate +re-computation of the container's size and its children's sizes +and positions. Instead, the recalculation is delayed until the +container is shown, which avoids redundant computations between a +series of changes. The @method[area-container<%> +reflow-container] method forces the immediate recalculation of +the container's and its children's sizes and locations. -Immediately after calling the -@method[area-container<%> reflow-container] method, -@method[window<%> get-size], -@method[window<%> get-client-size], -@method[window<%> get-width], -@method[window<%> get-height], -@method[window<%> get-x], and -@method[window<%> get-y] report the manager-applied sizes and locations for the container and - its children, even when the container is hidden. A - container implementation can call functions such as -@method[window<%> get-size] at any time to obtain the current state of a window (because the - functions do not trigger geometry management). +Immediately after calling the @method[area-container<%> +reflow-container] method, @method[window<%> get-size], +@method[window<%> get-client-size], @method[window<%> get-width], +@method[window<%> get-height], @method[window<%> get-x], and +@method[window<%> get-y] report the manager-applied sizes and +locations for the container and its children, even when the +container is hidden. A container implementation can call +functions such as @method[window<%> get-size] at any time to +obtain the current state of a window (because the functions do +not trigger geometry management). -See also -@method[area-container<%> container-flow-modified]. +See also @method[area-container<%> container-flow-modified]. -}} +} @defmethod[(container-flow-modified) void?]{ -@spec{ - 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. @@ -238,12 +196,10 @@ 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. -}} +} @defmethod[(begin-container-sequence) void?]{ -@spec{ - Suspends geometry management in the container's top-level window until @method[area-container<%> end-container-sequence] is called. The @@ -255,20 +211,13 @@ Suspends geometry management in the container's top-level window @method[window<%> show] until the sequence is complete. Sequence begin and end commands may be nested arbitrarily deep. -}} +} @defmethod[(end-container-sequence) void?]{ -@spec{ See @method[area-container<%> begin-container-sequence]. -} -@impl{ - - - - -}}} +}} diff --git a/collects/scribblings/gui/area-container-window-intf.scrbl b/collects/scribblings/gui/area-container-window-intf.scrbl index 86e3e97b36..8498dc71c7 100644 --- a/collects/scribblings/gui/area-container-window-intf.scrbl +++ b/collects/scribblings/gui/area-container-window-intf.scrbl @@ -3,6 +3,6 @@ @definterface[area-container-window<%> (area-container<%> window<%>)]{ +Combines two interfaces. } - diff --git a/collects/scribblings/gui/area-intf.scrbl b/collects/scribblings/gui/area-intf.scrbl index 9facdb3066..daeffabcd8 100644 --- a/collects/scribblings/gui/area-intf.scrbl +++ b/collects/scribblings/gui/area-intf.scrbl @@ -26,34 +26,31 @@ All @scheme[area<%>] classes accept the following named instantiation @defmethod[(get-parent) (or/c (is-a/c area-container<%>) false/c)]{ -@spec{ 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 window as its parent. -}} +} @defmethod[(get-top-level-window) - @scheme[frame%] or @scheme[dialog%] object]{ -@spec{ + (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. -}} +} @defmethod*[([(min-width) (integer-in 0 10000)] [(min-width [w (integer-in 0 10000)]) void?])]{ -@spec{ Gets or sets the area's minimum width (in pixels) for geometry management. The minimum width is ignored when it is smaller than the area's - \DefinedElsewhere{minimum graphical width}, or when it is smaller + @tech{graphical minimum width}, or when it is smaller than the width reported by @method[area-container<%> container-size] if the area is a container. See @|geomdiscuss| for more information. @@ -61,35 +58,20 @@ An area's initial minimum width is its graphical minimum width. See also @method[area<%> get-graphical-min-size] . +When setting the minimum width, if @scheme[w] is smaller than the + internal hard minimum, @|MismatchExn|. + } -@impl{ -First case: - - -Returns the current minimum width (in pixels). - - - -Second case: - - -Sets the minimum width (in pixels); if @scheme[w] is smaller than the - internal hard minimum, @|MismatchExn|}. - - - -}} @defmethod*[([(min-height) (integer-in 0 10000)] [(min-height [h (integer-in 0 10000)]) void?])]{ -@spec{ Gets or sets the area's minimum height for geometry management. The minimum height is ignored when it is smaller than the area's - \DefinedElsewhere{minimum graphical height}, or when it is smaller + @tech{graphical minimum height}, or when it is smaller than the height reported by @method[area-container<%> container-size] if the area is a container. See @|geomdiscuss| for more information. @@ -97,91 +79,41 @@ An area's initial minimum height is its graphical minimum height. See also @method[area<%> get-graphical-min-size] . +When setting the minimum height (in pixels); if @scheme[h] is smaller + than the internal hard minimum, @|MismatchExn|. + } -@impl{ -First case: - - -Returns the current minimum height (in pixels). - - - -Second case: - - -Sets the minimum height (in pixels); if @scheme[h] is smaller than the - internal hard minimum, @|MismatchExn|}. - - - -}} @defmethod[(get-graphical-min-size) - two \IntsIn{0}{10000}]{ -@spec{ + (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 - {\em does not} depend on the area's + @italic{does not} depend on the area's @method[area<%> min-width] and @method[area<%> min-height] settings. -}} +} @defmethod*[([(stretchable-width) boolean?] [(stretchable-width [stretch? any/c]) void?])]{ -@spec{ Gets or sets the area's horizontal stretchability for geometry management. See @|geomdiscuss| for more information. } -@impl{ -First case: - - -Returns the current horizontal stretchability. - - - -Second case: - - -Sets the horizontal stretchability. - - - -}} @defmethod*[([(stretchable-height) boolean?] [(stretchable-height [stretch? any/c]) void?])]{ -@spec{ Gets or sets the area's vertical stretchability for geometry management. See @|geomdiscuss| for more information. -} -@impl{ -First case: - - -Returns the current vertical stretchability. - - - -Second case: - - -Sets the vertical stretchability. - - - - -}}} - +}} diff --git a/collects/scribblings/gui/button-class.scrbl b/collects/scribblings/gui/button-class.scrbl index b3aaf2af53..e0b6bb031c 100644 --- a/collects/scribblings/gui/button-class.scrbl +++ b/collects/scribblings/gui/button-class.scrbl @@ -8,21 +8,22 @@ 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))] - [style (symbols/c deleted border) 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) @italic{graphical minimum width}] - [min-height (integer-in 0 10000) @italic{graphical minimum height}] - [stretchable-width any/c #f] - [stretchable-height any/c #f]]{ +@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 (symbols/c deleted border) 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 button with a string or bitmap label. - label + @bitmaplabeluse[label] @labelstripped[(scheme label) @elem{ (when @scheme[label] is a string)} @elem{effectively click the button}] @@ -32,7 +33,7 @@ The @scheme[callback] procedure is called (with the event type If @scheme[style] includes @scheme['border], the button is drawn with a special border that indicates to the user that it is the default action button (see @method[top-level-window<%> -on-traverse-char]). \DeletedStyleNote{button} +on-traverse-char]). @DeletedStyleNote{button} @FontKWs[] @WindowKWs[] @SubareaKWs[] @AreaKWs[]} @@ -40,10 +41,9 @@ on-traverse-char]). \DeletedStyleNote{button} @defmethod[#:mode 'add (set-label [label (is-a/c bitmap%)]) void?]{ -@impl{ Sets the bitmap label for a bitmap button. @bitmaplabeluseisbm[label] @|bitmapiforiglabel| -}}} +}} diff --git a/collects/scribblings/gui/control-intf.scrbl b/collects/scribblings/gui/control-intf.scrbl index f56f7c49dd..00fd3fe97e 100644 --- a/collects/scribblings/gui/control-intf.scrbl +++ b/collects/scribblings/gui/control-intf.scrbl @@ -21,24 +21,17 @@ The @scheme[control<%>] interface is implemented by the built-in @defmethod[(command [event (is-a/c control-event%)]) void?]{ -@spec{ Calls the control's callback function, passing on the given @scheme[control-event%] object. -}} +} @defmethod[(get-font) (is-a/c font%)]{ -@spec{ Returns the font used for the control, which is optionally supplied when a control is created. -} -@impl{ - - - -}}} +}} diff --git a/collects/scribblings/gui/subarea-intf.scrbl b/collects/scribblings/gui/subarea-intf.scrbl index 3841a3654d..3c808f1baa 100644 --- a/collects/scribblings/gui/subarea-intf.scrbl +++ b/collects/scribblings/gui/subarea-intf.scrbl @@ -26,55 +26,21 @@ All @scheme[subarea<%>] classes accept the following named (integer-in 0 1000)] [(horiz-margin [margin (integer-in 0 1000)]) void?])]{ -@spec{ Gets or sets the area's horizontal margin, which is added both to the right and left, for geometry management. See @|geomdiscuss| for more information. } -@impl{ -First case: - - -Returns the current horizontal margin. - - - -Second case: - - -Sets the horizontal margin. - - - -}} @defmethod*[([(vert-margin) (integer-in 0 1000)] [(vert-margin [margin (integer-in 0 1000)]) void?])]{ -@spec{ Gets or sets the area's vertical margin, which is added both to the - right and left, for geometry management. See @|geomdiscuss| for more + top and bottom, for geometry management. See @|geomdiscuss| for more information. -} -@impl{ -First case: - - -Returns the current vertical margin. - - - -Second case: - - -Sets the vertical margin. - - - -}}} +}} diff --git a/collects/scribblings/gui/window-intf.scrbl b/collects/scribblings/gui/window-intf.scrbl index 02a2a4109b..163437fab5 100644 --- a/collects/scribblings/gui/window-intf.scrbl +++ b/collects/scribblings/gui/window-intf.scrbl @@ -20,18 +20,17 @@ All @scheme[window<%>] classes accept the following named instantiation @defmethod[(on-focus [on? any/c]) void?]{ -@spec{ +@methspec{ -\index{keyboard focus!notification} -Called when a window receives or loses the keyboard focus. If the - argument is @scheme[#t], the keyboard focus was received, otherwise it - was lost. +@index['("keyboard focus" "notification")]{Called} when a window + receives or loses the keyboard focus. If the argument is @scheme[#t], + the keyboard focus was received, otherwise it was lost. Note that under X, keyboard focus can move to the menu bar when the user is selecting a menu item. } -@impl{ +@methimpl{ Does nothing. @@ -42,14 +41,14 @@ Does nothing. @defmethod[(on-size [width (integer-in 0 10000)] [height (integer-in 0 10000)]) void?]{ -@spec{ +@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. } -@impl{ +@methimpl{ Does nothing. @@ -60,14 +59,14 @@ Does nothing. @defmethod[(on-move [x (integer-in -10000 10000)] [y (integer-in -10000 10000)]) void?]{ -@spec{ +@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. } -@impl{ +@methimpl{ Does nothing. @@ -78,7 +77,7 @@ Does nothing. @defmethod[(on-subwindow-char [receiver (is-a/c window<%>)] [event (is-a/c key-event%)]) boolean?]{ -@spec{ +@methspec{ Called when this window or a child window receives a keyboard event. The @@ -97,20 +96,20 @@ BEWARE: The default reach the ``receiver'' child unless the default frame or dialog method is overridden. -} -@impl{ - The @scheme[event] argument is the event that was generated for the - @scheme[receiver] window. Returns @scheme[#f]. + @scheme[receiver] window. +} +@methimpl{ +Returns @scheme[#f]. }} @defmethod[(on-subwindow-event [receiver (is-a/c window<%>)] [event (is-a/c mouse-event%)]) boolean?]{ -@spec{ +@methspec{ Called when this window or a child window receives a mouse event. The @@ -121,29 +120,28 @@ Called when this window or a child window receives a mouse event. @method[window<%> on-subwindow-event] method returns @scheme[#f], the event is passed on to the receiver's normal mouse-handling mechanism. -} -@impl{ - The @scheme[event] argument is the event that was generated for the - @scheme[receiver] window. Returns @scheme[#f]. + @scheme[receiver] window. +} +@methimpl{ +Returns @scheme[#f]. }} @defmethod[(client->screen [x (integer-in -10000 10000)] [y (integer-in -10000 10000)]) - two \IntsIn{-10000}{10000}]{ -@spec{ + (values (integer-in -10000 10000) + (integer-in -10000 10000))]{ -\index{global coordinates} -Converts local window coordinates to screen coordinates. +@index["global coordinates"]{Converts} local window coordinates to +screen coordinates. -}} +} @defmethod[(enable [enable? any/c]) void?]{ -@spec{ Enables or disables a window so that input events are ignored. (Input events include mouse events, keyboard events, and close-box clicks, @@ -152,29 +150,21 @@ Enables or disables a window so that input events are ignored. (Input @MonitorMethod[@elem{The enable state of a window} @elem{enabling a parent window} @elem{@method[window<%> on-superwindow-enable]} @elem{enable state}] - -} -@impl{ - If @scheme[enable?] is true, the window is enabled, otherwise it is disabled. - - -}} +} @defmethod[(is-enabled?) boolean?]{ -@spec{ 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?]{ -@spec{ Called via the event queue whenever the enable state of a window has changed, either through a call to the window's @@ -195,33 +185,30 @@ If the enable state of a window's ancestor changes while the window is different from the window's state when it was de-activated, then an enable event is immediately queued. -}} +} @defmethod[(get-width) (integer-in 0 10000)]{ -@spec{ Returns the window's current total width (in pixels). See also @method[area-container<%> reflow-container]. -}} +} @defmethod[(get-height) (integer-in 0 10000)]{ -@spec{ Returns the window's total height (in pixels). See also @method[area-container<%> reflow-container]. -}} +} @defmethod[(get-x) (integer-in -10000 10000)]{ -@spec{ Returns the position of the window's left edge in its parent's coordinate system. @@ -229,11 +216,10 @@ Returns the position of the window's left edge in its See also @method[area-container<%> reflow-container]. -}} +} @defmethod[(get-y) (integer-in -10000 10000)]{ -@spec{ Returns the position of the window's top edge in its parent's coordinate system. @@ -241,11 +227,10 @@ Returns the position of the window's top edge in its See also @method[area-container<%> reflow-container]. -}} +} @defmethod[(get-label) (or/c {\labelstring}, @scheme[bitmap%] object, @scheme['app], @scheme['caution], @scheme['stop], false/c)]{ -@spec{ 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 @@ -268,66 +253,59 @@ The label string may contain ampersands (``\&''), which serve as If the window does not have a label, @scheme[#f] is returned. -}} +} @defmethod[(set-label [l label-string?]) void?]{ -@spec{ 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. } -@impl{ - -If the window was not created with a label, or if the window was - created with a non-string label, @scheme[l] is ignored. - - - -}} @defmethod[(get-plain-label) (or/c string false/c)]{ -@spec{ 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-handle) - exact integer]{ -@spec{ + 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: \cpp{HWND}} + @item{Windows: @tt{HWND}} - @item{Mac OS X: \cpp{WindowRef} for a @scheme[top-level-window<%>] object, - \cpp{ControlRef} for other windows} + @item{Mac OS X: @tt{WindowRef} for a @scheme[top-level-window<%>] object, + @tt{ControlRef} for other windows} - @item{X: \cpp{Widget*}} + @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) - two \IntsIn{0}{10000}]{ -@spec{ + (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 @@ -339,11 +317,11 @@ The geometry is returned as two values: width and height (in pixels). See also @method[area-container<%> reflow-container]. -}} +} @defmethod[(get-client-size) - two \IntsIn{0}{10000}]{ -@spec{ + (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 @@ -355,38 +333,35 @@ The client size is returned as two values: width and height (in pixels). See also @method[area-container<%> reflow-container]. - -}} +} @defmethod[(refresh) void?]{ -@spec{ Enqueues an event to repaint the window. -}} +} @defmethod[(screen->client [x (integer-in -10000 10000)] [y (integer-in -10000 10000)]) - two \IntsIn{-10000}{10000}]{ -@spec{ + (values (integer-in -10000 10000) + (integer-in -10000 10000))]{ -\index{global coordinates} -Converts global coordinates to window local coordinates. +@index["global coordinates"]{Converts} global coordinates to window +local coordinates. -}} +} @defmethod[(focus) void?]{ -@spec{ -\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. +@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]. @@ -396,39 +371,31 @@ Note that under X, keyboard focus can move to the menu bar @MonitorMethod[@elem{The current keyboard focus window} @elem{the user} @elem{@method[window<%> on-focus]} @elem{focus}] -}} +} @defmethod[(has-focus?) boolean?]{ -@spec{ 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?]{ -@spec{ -\popupmenuinfo{window}{window}{} - -} -@impl{ +@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?]{ -@spec{ Sets the window's cursor. Providing @scheme[#f] instead of a cursor value removes the window's cursor. @@ -438,39 +405,31 @@ If a window does not have a cursor, it uses the cursor of its parent. fields start with an I-beam cursor. All other windows are created without a cursor. -}} +} @defmethod[(get-cursor) (or/c (is-a/c cursor%) false/c)]{ -@spec{ 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[(show [show? any/c]) void?]{ -@spec{ Shows or hides a window. @MonitorMethod[@elem{The visibility of a window} @elem{the user clicking the window's close box, for example} @elem{@method[window<%> on-superwindow-show] or @method[top-level-window<%> on-close]} @elem{visibility}] -} -@impl{ - If @scheme[show?] is @scheme[#f], the window is hidden. Otherwise, the window is shown. - - -}} +} @defmethod[(is-shown?) boolean?]{ -@spec{ Indicates whether the window is currently shown or not (when all of its ancestors are also shown). @@ -479,11 +438,10 @@ 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?]{ -@spec{ Called via the event queue whenever the visibility of a window has changed, either through a call to the window's @@ -499,17 +457,15 @@ This method is not called when the window is initially created; it is the window and it reverts its visibility before the event is dispatched, then the dispatch is canceled. -}} +} @defmethod[(on-drop-file [pathname path]) void?]{ -@spec{ -\index{drag-and-drop} -Called when the user drags a file onto the window.\footnote{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]. +@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 @@ -522,37 +478,15 @@ Under Mac OS X, when the application is running and user 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?])]{ -@spec{ -\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]. - -} -@impl{ -First case: - - -Returns @scheme[#t] if file-dropping is enabled, @scheme[#f] otherwise. - - - -Second case: - - -Enables file-dropping if @scheme[accept-files?] is true, disables - file-dropping otherwise. - - - - -}}} +@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]. +}} diff --git a/collects/scribblings/gui/windowing.scrbl b/collects/scribblings/gui/windowing.scrbl index b27f78f244..517f9a2015 100644 --- a/collects/scribblings/gui/windowing.scrbl +++ b/collects/scribblings/gui/windowing.scrbl @@ -7,6 +7,30 @@ 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["control-intf.scrbl"] +@include-class[control<%>] + +@require["subarea-intf.scrbl"] +@include-class[subarea<%>] + +@require["subwindow-intf.scrbl"] +@include-class[subwindow<%>] + +@require["window-intf.scrbl"] +@include-class[window<%>] + @include-section["dialog-funcs.scrbl"] @include-section["eventspace-funcs.scrbl"] @include-section["system-menu-funcs.scrbl"]