remove unsupported MDI styles and method

Closes PR 12042
This commit is contained in:
Matthew Flatt 2011-08-04 07:59:31 -06:00
parent 1bc8978ce8
commit 71621bfd72
4 changed files with 14 additions and 51 deletions

View File

@ -162,14 +162,8 @@
(check-init-pos-integer cwho x) (check-init-pos-integer cwho x)
(check-init-pos-integer cwho y) (check-init-pos-integer cwho y)
(check-style cwho #f '(no-resize-border no-caption no-system-menu (check-style cwho #f '(no-resize-border no-caption no-system-menu
mdi-parent mdi-child
toolbar-button hide-menu-bar float metal) toolbar-button hide-menu-bar float metal)
style) style)))
(when (memq 'mdi-child style)
(when (memq 'mdi-parent style)
(raise-type-error (who->name cwho)
"style list, 'mdi-child and 'mdi-parent are mutually exclusive"
style)))))
(rename [super-on-subwindow-char on-subwindow-char]) (rename [super-on-subwindow-char on-subwindow-char])
(private-field (private-field
[wx #f] [wx #f]
@ -186,7 +180,6 @@
(lambda (e) (lambda (e)
(check-instance '(method frame% on-menu-char) wx:key-event% 'key-event% #f e) (check-instance '(method frame% on-menu-char) wx:key-event% 'key-event% #f e)
(send wx handle-menu-key e)))] (send wx handle-menu-key e)))]
[on-mdi-activate (lambda (on?) (void))]
[on-toolbar-button-click (lambda () (void))] [on-toolbar-button-click (lambda () (void))]
[create-status-line (entry-point (lambda () (unless status-line? (do-create-status-line) (set! status-line? #t))))] [create-status-line (entry-point (lambda () (unless status-line? (do-create-status-line) (set! status-line? #t))))]
[set-status-text (lambda (s) (do-set-status-text s))] [set-status-text (lambda (s) (do-set-status-text s))]
@ -217,16 +210,12 @@
(or x -11111) (or y -11111) (or x -11111) (or y -11111)
(or width -1) (or height -1) (or width -1) (or height -1)
style) style)
(memq 'mdi-parent style))) #f))
(send wx set-mdi-parent (memq 'mdi-parent style)) (send wx set-mdi-parent #f)
wx) wx)
(lambda () (lambda ()
(let ([cwho '(constructor frame)]) (let ([cwho '(constructor frame)])
(check-container-ready cwho parent) (check-container-ready cwho parent)))
(when (memq 'mdi-child style)
(let ([pwx (and parent (mred->wx parent))])
(unless (and pwx (send pwx get-mdi-parent))
(raise-mismatch-error (who->name cwho) "parent for 'mdi-child frame is not an 'mdi-parent frame: " parent))))))
label parent)))))) label parent))))))
(define dialog% (define dialog%

View File

@ -7,9 +7,6 @@ A frame is a top-level container window. It has a title bar (which
displays the frame's label), an optional menu bar, and an optional displays the frame's label), an optional menu bar, and an optional
status line. status line.
On Windows, both Multiple Document Interface (MDI) and Single
Document Interface (SDI) frames are supported.
@defconstructor[([label label-string?] @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] [width (or/c (integer-in 0 10000) false/c) #f]
@ -18,7 +15,6 @@ On Windows, both Multiple Document Interface (MDI) and Single
[y (or/c (integer-in -10000 10000) false/c) #f] [y (or/c (integer-in -10000 10000) false/c) #f]
[style (listof (one-of/c 'no-resize-border 'no-caption [style (listof (one-of/c 'no-resize-border 'no-caption
'no-system-menu 'hide-menu-bar 'no-system-menu 'hide-menu-bar
'mdi-parent 'mdi-child
'toolbar-button 'float 'metal)) null] 'toolbar-button 'float 'metal)) null]
[enabled any/c #t] [enabled any/c #t]
[border (integer-in 0 1000) 0] [border (integer-in 0 1000) 0]
@ -37,9 +33,8 @@ set-label]), the title bar is updated.
The @racket[parent] argument can be @racket[#f] or an existing The @racket[parent] argument can be @racket[#f] or an existing
frame. On Windows, if @racket[parent] is an existing frame, frame. On Windows, if @racket[parent] is an existing frame,
the new frame is always on top of its parent. Also, the the new frame is always on top of its parent.
@racket[parent] frame may be an MDI parent frame from a new MDI On Windows and Unix (for many window managers), a
child frame. On Windows and Unix (for many window managers), a
frame is iconized when its parent is iconized. frame is iconized when its parent is iconized.
If @racket[parent] is @racket[#f], then the eventspace for the If @racket[parent] is @racket[#f], then the eventspace for the
@ -72,14 +67,6 @@ some platforms:
@item{@racket['no-system-menu] --- omits the system menu @item{@racket['no-system-menu] --- omits the system menu
(Windows)} (Windows)}
@item{@racket['mdi-child] --- creates the frame as a MDI
(multiple document interface) child frame, mutually exclusive with
@racket['mdi-parent] (Windows)}
@item{@racket['mdi-parent] --- creates the frame as a MDI
(multiple document interface) parent frame, mutually exclusive with
@racket['mdi-child] (Windows)}
@item{@racket['toolbar-button] --- includes a toolbar button on the @item{@racket['toolbar-button] --- includes a toolbar button on the
frame's title bar (Mac OS X); a click on the toolbar button triggers frame's title bar (Mac OS X); a click on the toolbar button triggers
a call to @method[frame% on-toolbar-button-click]} a call to @method[frame% on-toolbar-button-click]}
@ -99,9 +86,6 @@ some platforms:
] ]
If the @racket['mdi-child] style is specified, the @racket[parent] must be
a frame with the @racket['mdi-parent] style, otherwise @|MismatchExn|.
Even if the frame is not shown, a few notification events may be Even if the frame is not shown, a few notification events may be
queued for the frame on creation. Consequently, the new frame's queued for the frame on creation. Consequently, the new frame's
resources (e.g., memory) cannot be reclaimed until some events are resources (e.g., memory) cannot be reclaimed until some events are
@ -199,22 +183,6 @@ Gets or sets the frame's modification state as reflected to the user.
} }
@defmethod[(on-mdi-activate [active? any/c])
void?]{
Called on Windows when a MDI-child frame becomes the active frame
within its parent (in which case the argument is @racket[#t]), or when
the child frame ceases to be the active frame (in which case the
argument is @racket[#f]).
MDI activation is different from keyboard-focus activation. If the
parent frame is the frontmost top-level frame, so that the MDI child
gets or loses the keyboard focus, then a separate
@method[top-level-window<%> on-activate] notification is sent to the MDI-child frame.
}
@defmethod[(on-menu-char [event (is-a?/c key-event%)]) @defmethod[(on-menu-char [event (is-a?/c key-event%)])
boolean?]{ boolean?]{

View File

@ -18,8 +18,8 @@ API:
The GRacket executable still offers some additional GUI-specific The GRacket executable still offers some additional GUI-specific
functionality however. Most notably, GRacket is a GUI application functionality however. Most notably, GRacket is a GUI application
under Windows (as opposed to a console application, which is on Windows (as opposed to a console application, which is
launched slightly differently by the OS), GRacket is a bundle under launched slightly differently by the OS), GRacket is a bundle on
Mac OS X (so the dock icon is the Racket logo, for example), and Mac OS X (so the dock icon is the Racket logo, for example), and
GRacket manages single-instance mode for Windows and X. GRacket manages single-instance mode for Windows and X.
@ -167,6 +167,11 @@ are somewhat more restricted in the actions they can take without
disabling the control's handling of key and mouse events. See the disabling the control's handling of key and mouse events. See the
documentation for more information. documentation for more information.
The 'mdi-child and 'mdi-parent styles for `frame%' on Windows are no
longer supported, and the `on-mdi-activate' method has been
removed. (The styles and method actually lingered in `racket/gui'
until version 5.1.2.3, but they did not work.)
Registry Functions Registry Functions
----------------- -----------------

View File

@ -1,6 +1,7 @@
Version 5.1.2.3 Version 5.1.2.3
Added set-port-next-location! and changed the default prompt Added set-port-next-location! and changed the default prompt
read handler to use it when input and output ar terminals read handler to use it when input and output ar terminals
racket/gui: removed unsupported MDI styles and method
Version 5.1.2.2 Version 5.1.2.2
Changed the location-creation semantics of internal definitions Changed the location-creation semantics of internal definitions