fix get-face-list 'mono under Mac OS X and X, and delay showing children of a frame during a container sequence
svn: r6563 original commit: 1131abd11f6fd8b46c0f8f74c9cf2e7629961eeb
This commit is contained in:
parent
f73a2b9dc5
commit
08bb60e13a
|
@ -62,6 +62,7 @@
|
||||||
(define wx-canvas%
|
(define wx-canvas%
|
||||||
(make-canvas-glue%
|
(make-canvas-glue%
|
||||||
(class100 (make-control% wx:canvas% 0 0 #t #t) (parent x y w h style gl-config)
|
(class100 (make-control% wx:canvas% 0 0 #t #t) (parent x y w h style gl-config)
|
||||||
|
(inherit get-top-level)
|
||||||
(private-field
|
(private-field
|
||||||
[tabable? #f])
|
[tabable? #f])
|
||||||
(public
|
(public
|
||||||
|
@ -74,13 +75,16 @@
|
||||||
(lambda (code alpha? meta?)
|
(lambda (code alpha? meta?)
|
||||||
(or meta? (not tabable?)))])
|
(or meta? (not tabable?)))])
|
||||||
(sequence
|
(sequence
|
||||||
(super-init style parent x y w h style "canvas" gl-config)))))
|
(super-init style parent x y w h (cons 'deleted style) "canvas" gl-config)
|
||||||
|
(unless (memq 'deleted style)
|
||||||
|
(send (get-top-level) show-control this #t))))))
|
||||||
|
|
||||||
(define (make-editor-canvas% %)
|
(define (make-editor-canvas% %)
|
||||||
(class100 % (parent x y w h name style spp init-buffer)
|
(class100 % (parent x y w h name style spp init-buffer)
|
||||||
(inherit get-editor force-redraw
|
(inherit get-editor force-redraw
|
||||||
call-as-primary-owner min-height get-size
|
call-as-primary-owner min-height get-size
|
||||||
get-hard-minimum-size set-min-height)
|
get-hard-minimum-size set-min-height
|
||||||
|
get-top-level)
|
||||||
(private-field
|
(private-field
|
||||||
[fixed-height? #f]
|
[fixed-height? #f]
|
||||||
[fixed-height-lines 0]
|
[fixed-height-lines 0]
|
||||||
|
@ -195,7 +199,9 @@
|
||||||
(when fixed-height? (update-size)))])
|
(when fixed-height? (update-size)))])
|
||||||
|
|
||||||
(sequence
|
(sequence
|
||||||
(super-init style parent x y w h (or name "") style spp init-buffer)
|
(super-init style parent x y w h (or name "") (cons 'deleted style) spp init-buffer)
|
||||||
|
(unless (memq 'deleted style)
|
||||||
|
(send (get-top-level) show-control this #t))
|
||||||
(when init-buffer
|
(when init-buffer
|
||||||
(let ([mred (wx->mred this)])
|
(let ([mred (wx->mred this)])
|
||||||
(when mred
|
(when mred
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
(lambda (item% x-margin-w y-margin-h stretch-x stretch-y)
|
(lambda (item% x-margin-w y-margin-h stretch-x stretch-y)
|
||||||
(class100 (wx-make-window% item% #f) (window-style . args)
|
(class100 (wx-make-window% item% #f) (window-style . args)
|
||||||
(inherit get-width get-height get-x get-y
|
(inherit get-width get-height get-x get-y
|
||||||
get-parent get-client-size)
|
get-parent get-client-size get-top-level)
|
||||||
(private-field [enabled? #t])
|
(private-field [enabled? #t])
|
||||||
(override
|
(override
|
||||||
[enable
|
[enable
|
||||||
|
@ -197,6 +197,7 @@
|
||||||
(set-min-height (init-min (get-height)))
|
(set-min-height (init-min (get-height)))
|
||||||
|
|
||||||
(unless (memq 'deleted window-style)
|
(unless (memq 'deleted window-style)
|
||||||
|
(send (get-top-level) show-control this #t)
|
||||||
;; For a pane[l], the creator must call the equivalent of the following,
|
;; For a pane[l], the creator must call the equivalent of the following,
|
||||||
;; delaying to let the panel's wx field get initialized before
|
;; delaying to let the panel's wx field get initialized before
|
||||||
;; panel-sizing methods are called
|
;; panel-sizing methods are called
|
||||||
|
@ -233,7 +234,7 @@
|
||||||
(as-exit
|
(as-exit
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(command (make-object wx:control-event% 'button)))))])
|
(command (make-object wx:control-event% 'button)))))])
|
||||||
(sequence (super-init style parent cb label x y w h style font)
|
(sequence (super-init style parent cb label x y w h (cons 'deleted style) font)
|
||||||
(when border?
|
(when border?
|
||||||
(send (get-top-level) add-border-button this))))))
|
(send (get-top-level) add-border-button this))))))
|
||||||
(define wx-check-box% (class100 (make-window-glue% (make-simple-control% wx:check-box%)) (mred proxy parent cb label x y w h style font)
|
(define wx-check-box% (class100 (make-window-glue% (make-simple-control% wx:check-box%)) (mred proxy parent cb label x y w h style font)
|
||||||
|
@ -244,17 +245,17 @@
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(set-value (not (get-value)))
|
(set-value (not (get-value)))
|
||||||
(command (make-object wx:control-event% 'check-box)))))])
|
(command (make-object wx:control-event% 'check-box)))))])
|
||||||
(sequence (super-init mred proxy style parent cb label x y w h style font))))
|
(sequence (super-init mred proxy style parent cb label x y w h (cons 'deleted style) font))))
|
||||||
(define wx-choice% (class100 (make-window-glue% (make-simple-control% wx:choice%)) (mred proxy parent cb label x y w h choices style font)
|
(define wx-choice% (class100 (make-window-glue% (make-simple-control% wx:choice%)) (mred proxy parent cb label x y w h choices style font)
|
||||||
(override
|
(override
|
||||||
[handles-key-code
|
[handles-key-code
|
||||||
(lambda (x alpha? meta?)
|
(lambda (x alpha? meta?)
|
||||||
(or (memq x '(up down))
|
(or (memq x '(up down))
|
||||||
(and alpha? (not meta?))))])
|
(and alpha? (not meta?))))])
|
||||||
(sequence (super-init mred proxy style parent cb label x y w h choices style font))))
|
(sequence (super-init mred proxy style parent cb label x y w h choices (cons 'deleted style) font))))
|
||||||
(define wx-message% (class100 (make-window-glue% (make-simple-control% wx:message%)) (mred proxy parent label x y style font)
|
(define wx-message% (class100 (make-window-glue% (make-simple-control% wx:message%)) (mred proxy parent label x y style font)
|
||||||
(override [gets-focus? (lambda () #f)])
|
(override [gets-focus? (lambda () #f)])
|
||||||
(sequence (super-init mred proxy style parent label x y style font))))
|
(sequence (super-init mred proxy style parent label x y (cons 'deleted style) font))))
|
||||||
|
|
||||||
(define wx-gauge%
|
(define wx-gauge%
|
||||||
(make-window-glue%
|
(make-window-glue%
|
||||||
|
@ -270,7 +271,7 @@
|
||||||
;; # pixels per unit of value.
|
;; # pixels per unit of value.
|
||||||
[pixels-per-value 1])
|
[pixels-per-value 1])
|
||||||
(sequence
|
(sequence
|
||||||
(super-init style parent label range -1 -1 -1 -1 style font)
|
(super-init style parent label range -1 -1 -1 -1 (cons 'deleted style) font)
|
||||||
|
|
||||||
(let-values ([(client-width client-height) (get-two-int-values
|
(let-values ([(client-width client-height) (get-two-int-values
|
||||||
(lambda (a b) (get-client-size a b)))])
|
(lambda (a b) (get-client-size a b)))])
|
||||||
|
@ -337,7 +338,7 @@
|
||||||
[(wheel-up) (scroll -1) #t]
|
[(wheel-up) (scroll -1) #t]
|
||||||
[(wheel-down) (scroll 1) #t]
|
[(wheel-down) (scroll 1) #t]
|
||||||
[else #f])))])
|
[else #f])))])
|
||||||
(sequence (super-init style parent cb label kind x y w h choices style font label-font)))))
|
(sequence (super-init style parent cb label kind x y w h choices (cons 'deleted style) font label-font)))))
|
||||||
|
|
||||||
(define wx-radio-box%
|
(define wx-radio-box%
|
||||||
(make-window-glue%
|
(make-window-glue%
|
||||||
|
@ -365,7 +366,7 @@
|
||||||
(set-selection i)
|
(set-selection i)
|
||||||
(command (make-object wx:control-event% 'radio-box)))))])
|
(command (make-object wx:control-event% 'radio-box)))))])
|
||||||
|
|
||||||
(sequence (super-init style parent cb label x y w h choices major style font))
|
(sequence (super-init style parent cb label x y w h choices major (cons 'deleted style) font))
|
||||||
|
|
||||||
(private-field [enable-vector (make-vector (number) #t)]))))
|
(private-field [enable-vector (make-vector (number) #t)]))))
|
||||||
|
|
||||||
|
@ -385,7 +386,7 @@
|
||||||
;; which looks bad.
|
;; which looks bad.
|
||||||
|
|
||||||
(sequence
|
(sequence
|
||||||
(super-init style parent func label value min-val max-val -1 -1 -1 style font)
|
(super-init style parent func label value min-val max-val -1 -1 -1 (cons 'deleted style) font)
|
||||||
|
|
||||||
(let-values ([(client-w client-h) (get-two-int-values (lambda (a b)
|
(let-values ([(client-w client-h) (get-two-int-values (lambda (a b)
|
||||||
(get-client-size a b)))])
|
(get-client-size a b)))])
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
[on-size (lambda () (void))]
|
[on-size (lambda () (void))]
|
||||||
[enable (lambda () (void))]
|
[enable (lambda () (void))]
|
||||||
[show (lambda (on?) (void))]
|
[show (lambda (on?) (void))]
|
||||||
|
[is-shown? (lambda () #f)]
|
||||||
[is-shown-to-root? (lambda () (send parent is-shown-to-root?))]
|
[is-shown-to-root? (lambda () (send parent is-shown-to-root?))]
|
||||||
[is-enabled-to-root? (lambda () (send parent is-enabled-to-root?))]
|
[is-enabled-to-root? (lambda () (send parent is-enabled-to-root?))]
|
||||||
[get-parent (lambda () parent)]
|
[get-parent (lambda () parent)]
|
||||||
|
@ -454,7 +455,9 @@
|
||||||
child-infos
|
child-infos
|
||||||
placements))])
|
placements))])
|
||||||
(sequence
|
(sequence
|
||||||
(super-init style parent -1 -1 0 0 style))))
|
(super-init style parent -1 -1 0 0 (cons 'deleted style))
|
||||||
|
(unless (memq 'deleted style)
|
||||||
|
(send (get-top-level) show-control this #t)))))
|
||||||
|
|
||||||
(define (wx-make-pane% wx:panel% stretch?)
|
(define (wx-make-pane% wx:panel% stretch?)
|
||||||
(class100 (make-container-glue% (make-glue% (wx-make-basic-panel% wx:panel% stretch?))) args
|
(class100 (make-container-glue% (make-glue% (wx-make-basic-panel% wx:panel% stretch?))) args
|
||||||
|
|
|
@ -95,7 +95,8 @@
|
||||||
|
|
||||||
[parent-for-center parent]
|
[parent-for-center parent]
|
||||||
|
|
||||||
[show-ht (make-hash-table)])
|
[show-ht (make-hash-table)]
|
||||||
|
[fake-show-ht (make-hash-table)])
|
||||||
|
|
||||||
(override
|
(override
|
||||||
[enable
|
[enable
|
||||||
|
@ -196,6 +197,13 @@
|
||||||
(when perform-updates?
|
(when perform-updates?
|
||||||
(when pending-redraws?
|
(when pending-redraws?
|
||||||
(force-redraw))
|
(force-redraw))
|
||||||
|
(when (positive? (hash-table-count fake-show-ht))
|
||||||
|
(let ([t fake-show-ht])
|
||||||
|
(set! fake-show-ht (make-hash-table))
|
||||||
|
(hash-table-for-each
|
||||||
|
t
|
||||||
|
(lambda (win v?)
|
||||||
|
(send win really-show #t)))))
|
||||||
(when (positive? (hash-table-count show-ht))
|
(when (positive? (hash-table-count show-ht))
|
||||||
(let ([t show-ht])
|
(let ([t show-ht])
|
||||||
(set! show-ht (make-hash-table))
|
(set! show-ht (make-hash-table))
|
||||||
|
@ -220,6 +228,21 @@
|
||||||
(send child show show?)
|
(send child show show?)
|
||||||
(hash-table-put! show-ht child show?)))]
|
(hash-table-put! show-ht child show?)))]
|
||||||
|
|
||||||
|
[show-control
|
||||||
|
(lambda (child on?)
|
||||||
|
(if (or perform-updates?
|
||||||
|
(not on?)
|
||||||
|
(child . is-a? . wx-frame%)
|
||||||
|
(child . is-a? . wx-dialog%))
|
||||||
|
(send child really-show on?)
|
||||||
|
(begin
|
||||||
|
(if on?
|
||||||
|
(hash-table-put! fake-show-ht child #t)
|
||||||
|
(begin
|
||||||
|
(hash-table-remove! show-ht child)
|
||||||
|
(hash-table-remove! fake-show-ht child)))
|
||||||
|
(send child fake-show on?))))]
|
||||||
|
|
||||||
;; force-redraw: receives a message from to redraw the
|
;; force-redraw: receives a message from to redraw the
|
||||||
;; entire frame.
|
;; entire frame.
|
||||||
;; input: none
|
;; input: none
|
||||||
|
|
|
@ -52,7 +52,8 @@
|
||||||
(rename [super-enable enable])
|
(rename [super-enable enable])
|
||||||
|
|
||||||
(private-field
|
(private-field
|
||||||
[can-accept-drag? #f])
|
[can-accept-drag? #f]
|
||||||
|
[fake-shown? #f])
|
||||||
|
|
||||||
(public
|
(public
|
||||||
[accept-drag? (lambda () can-accept-drag?)]
|
[accept-drag? (lambda () can-accept-drag?)]
|
||||||
|
@ -77,11 +78,24 @@
|
||||||
(set! top-level window)]
|
(set! top-level window)]
|
||||||
[else (loop (send window get-parent))])))
|
[else (loop (send window get-parent))])))
|
||||||
top-level)])
|
top-level)])
|
||||||
|
(public
|
||||||
|
[really-show
|
||||||
|
(lambda (on?)
|
||||||
|
(set! fake-shown? #f)
|
||||||
|
(super show on?))]
|
||||||
|
[fake-show
|
||||||
|
(lambda (on?)
|
||||||
|
(set! fake-shown? on?))])
|
||||||
(override
|
(override
|
||||||
[show
|
[show
|
||||||
(lambda (on?)
|
(lambda (on?)
|
||||||
(queue-visible)
|
(queue-visible)
|
||||||
(super show on?))]
|
(send (get-top-level) show-control this on?))]
|
||||||
|
[is-shown?
|
||||||
|
(lambda ()
|
||||||
|
(or fake-shown?
|
||||||
|
(super is-shown?)))]
|
||||||
|
|
||||||
[enable
|
[enable
|
||||||
(lambda (on?)
|
(lambda (on?)
|
||||||
(queue-active)
|
(queue-active)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user