more consistent on-size' and
on-move'
This commit is contained in:
parent
c9d2f43398
commit
ae5093a134
|
@ -238,7 +238,6 @@
|
||||||
is-window-enabled?
|
is-window-enabled?
|
||||||
block-mouse-events
|
block-mouse-events
|
||||||
move get-x get-y
|
move get-x get-y
|
||||||
on-size
|
|
||||||
register-as-child
|
register-as-child
|
||||||
get-size get-position
|
get-size get-position
|
||||||
set-focus
|
set-focus
|
||||||
|
@ -456,7 +455,9 @@
|
||||||
(fix-dc)
|
(fix-dc)
|
||||||
(when (is-auto-scroll?)
|
(when (is-auto-scroll?)
|
||||||
(reset-auto-scroll 0 0))
|
(reset-auto-scroll 0 0))
|
||||||
(on-size 0 0))
|
(on-size))
|
||||||
|
|
||||||
|
(define/public (on-size) (void))
|
||||||
|
|
||||||
(define/public (show-scrollbars h? v?)
|
(define/public (show-scrollbars h? v?)
|
||||||
(let ([h? (and h? hscroll-ok?)]
|
(let ([h? (and h? hscroll-ok?)]
|
||||||
|
|
|
@ -63,7 +63,7 @@
|
||||||
(let ([wx (->wx wxb)])
|
(let ([wx (->wx wxb)])
|
||||||
(when wx
|
(when wx
|
||||||
(queue-window-event wx (lambda ()
|
(queue-window-event wx (lambda ()
|
||||||
(send wx on-size 0 0)
|
(send wx queue-on-size)
|
||||||
(send wx clean-up)))
|
(send wx clean-up)))
|
||||||
;; Live resize:
|
;; Live resize:
|
||||||
(constrained-reply (send wx get-eventspace)
|
(constrained-reply (send wx get-eventspace)
|
||||||
|
@ -74,7 +74,7 @@
|
||||||
[-a _void (windowDidMove: [_id notification])
|
[-a _void (windowDidMove: [_id notification])
|
||||||
(when wxb
|
(when wxb
|
||||||
(queue-window*-event wxb (lambda (wx)
|
(queue-window*-event wxb (lambda (wx)
|
||||||
(send wx on-size 0 0))))]
|
(send wx queue-on-size))))]
|
||||||
[-a _void (windowDidBecomeMain: [_id notification])
|
[-a _void (windowDidBecomeMain: [_id notification])
|
||||||
;; We check whether the window is visible because
|
;; We check whether the window is visible because
|
||||||
;; clicking the dock item tries to resurrect a hidden
|
;; clicking the dock item tries to resurrect a hidden
|
||||||
|
|
|
@ -591,7 +591,9 @@
|
||||||
[y (if (= y -11111) (get-y) y)])
|
[y (if (= y -11111) (get-y) y)])
|
||||||
(tellv cocoa setNeedsDisplay: #:type _BOOL #t)
|
(tellv cocoa setNeedsDisplay: #:type _BOOL #t)
|
||||||
(tellv cocoa setFrame: #:type _NSRect (make-NSRect (make-NSPoint x (flip y h))
|
(tellv cocoa setFrame: #:type _NSRect (make-NSRect (make-NSPoint x (flip y h))
|
||||||
(make-NSSize w h)))))
|
(make-NSSize w h))))
|
||||||
|
(queue-on-size))
|
||||||
|
|
||||||
(define/public (internal-move x y)
|
(define/public (internal-move x y)
|
||||||
(set-size x y (get-width) (get-height)))
|
(set-size x y (get-width) (get-height)))
|
||||||
(define/public (move x y)
|
(define/public (move x y)
|
||||||
|
@ -702,7 +704,7 @@
|
||||||
|
|
||||||
(define/public (on-char s) (void))
|
(define/public (on-char s) (void))
|
||||||
(define/public (on-event m) (void))
|
(define/public (on-event m) (void))
|
||||||
(define/public (on-size x y) (void))
|
(define/public (queue-on-size) (void))
|
||||||
|
|
||||||
(define last-l? #f)
|
(define last-l? #f)
|
||||||
(define last-m? #f)
|
(define last-m? #f)
|
||||||
|
|
|
@ -194,7 +194,7 @@
|
||||||
[gl-config #f])
|
[gl-config #f])
|
||||||
|
|
||||||
(inherit get-gtk set-size get-size get-client-size
|
(inherit get-gtk set-size get-size get-client-size
|
||||||
on-size get-top-win
|
get-top-win
|
||||||
set-auto-size
|
set-auto-size
|
||||||
adjust-client-delta infer-client-delta
|
adjust-client-delta infer-client-delta
|
||||||
is-auto-scroll? get-virtual-width get-virtual-height
|
is-auto-scroll? get-virtual-width get-virtual-height
|
||||||
|
@ -438,10 +438,9 @@
|
||||||
(define/override (internal-on-client-size w h)
|
(define/override (internal-on-client-size w h)
|
||||||
(reset-dc))
|
(reset-dc))
|
||||||
(define/override (on-client-size w h)
|
(define/override (on-client-size w h)
|
||||||
(let ([xb (box 0)]
|
(on-size))
|
||||||
[yb (box 0)])
|
|
||||||
(get-size xb yb)
|
(define/public (on-size) (void))
|
||||||
(on-size (unbox xb) (unbox yb))))
|
|
||||||
|
|
||||||
(define/public (show-scrollbars h? v?)
|
(define/public (show-scrollbars h? v?)
|
||||||
(when hscroll-gtk
|
(when hscroll-gtk
|
||||||
|
|
|
@ -139,7 +139,7 @@
|
||||||
style)
|
style)
|
||||||
(init [is-dialog? #f])
|
(init [is-dialog? #f])
|
||||||
|
|
||||||
(inherit get-gtk set-size on-size
|
(inherit get-gtk set-size
|
||||||
pre-on-char pre-on-event
|
pre-on-char pre-on-event
|
||||||
get-client-delta get-size
|
get-client-delta get-size
|
||||||
get-parent get-eventspace
|
get-parent get-eventspace
|
||||||
|
|
|
@ -420,7 +420,8 @@
|
||||||
(unless (= h -1) (set! save-h h))
|
(unless (= h -1) (set! save-h h))
|
||||||
(set! save-w (max save-w client-delta-w))
|
(set! save-w (max save-w client-delta-w))
|
||||||
(set! save-h (max save-h client-delta-h))
|
(set! save-h (max save-h client-delta-h))
|
||||||
(really-set-size gtk x y save-x save-y save-w save-h)))
|
(really-set-size gtk x y save-x save-y save-w save-h)
|
||||||
|
(queue-on-size)))
|
||||||
|
|
||||||
(define/public (save-size x y w h)
|
(define/public (save-size x y w h)
|
||||||
(set! save-w w)
|
(set! save-w w)
|
||||||
|
@ -441,13 +442,7 @@
|
||||||
(set! save-h h)
|
(set! save-h h)
|
||||||
(queue-on-size)))
|
(queue-on-size)))
|
||||||
|
|
||||||
(define on-size-queued? #f)
|
(define/public (queue-on-size) (void))
|
||||||
(define/public (queue-on-size)
|
|
||||||
(unless on-size-queued?
|
|
||||||
(set! on-size-queued? #t)
|
|
||||||
(queue-window-event this (lambda ()
|
|
||||||
(set! on-size-queued? #f)
|
|
||||||
(on-size 0 0)))))
|
|
||||||
|
|
||||||
(define client-delta-w 0)
|
(define client-delta-w 0)
|
||||||
(define client-delta-h 0)
|
(define client-delta-h 0)
|
||||||
|
@ -605,8 +600,6 @@
|
||||||
(define/public (on-char e) (void))
|
(define/public (on-char e) (void))
|
||||||
(define/public (on-event e) (void))
|
(define/public (on-event e) (void))
|
||||||
|
|
||||||
(define/public (on-size w h) (void))
|
|
||||||
|
|
||||||
(define/public (register-child child on?)
|
(define/public (register-child child on?)
|
||||||
(void))
|
(void))
|
||||||
(define/public (register-child-in-parent on?)
|
(define/public (register-child-in-parent on?)
|
||||||
|
|
|
@ -86,8 +86,7 @@
|
||||||
set-control-font
|
set-control-font
|
||||||
is-auto-scroll? get-virtual-width get-virtual-height
|
is-auto-scroll? get-virtual-width get-virtual-height
|
||||||
reset-auto-scroll
|
reset-auto-scroll
|
||||||
refresh-for-autoscroll
|
refresh-for-autoscroll)
|
||||||
on-size)
|
|
||||||
|
|
||||||
(define hscroll? (memq 'hscroll style))
|
(define hscroll? (memq 'hscroll style))
|
||||||
(define vscroll? (memq 'vscroll style))
|
(define vscroll? (memq 'vscroll style))
|
||||||
|
@ -241,7 +240,9 @@
|
||||||
[h (if (= h -1) (- (RECT-bottom r) (RECT-top r)) h)])
|
[h (if (= h -1) (- (RECT-bottom r) (RECT-top r)) h)])
|
||||||
(MoveWindow canvas-hwnd 0 0 (max 1 (- w COMBO-WIDTH)) h #t)
|
(MoveWindow canvas-hwnd 0 0 (max 1 (- w COMBO-WIDTH)) h #t)
|
||||||
(MoveWindow combo-hwnd 0 0 (max 1 w) (- h 2) #t)))
|
(MoveWindow combo-hwnd 0 0 (max 1 w) (- h 2) #t)))
|
||||||
(on-size 0 0))
|
(on-size))
|
||||||
|
|
||||||
|
(define/public (on-size) (void))
|
||||||
|
|
||||||
;; The `queue-paint' and `paint-children' methods
|
;; The `queue-paint' and `paint-children' methods
|
||||||
;; are defined by `canvas-mixin' from ../common/canvas-mixin
|
;; are defined by `canvas-mixin' from ../common/canvas-mixin
|
||||||
|
|
|
@ -244,7 +244,7 @@
|
||||||
(unless (memq 'deleted style)
|
(unless (memq 'deleted style)
|
||||||
(show #t))
|
(show #t))
|
||||||
|
|
||||||
(define/public (on-size w h) (void))
|
(define/public (queue-on-size) (void))
|
||||||
|
|
||||||
(define/public (on-set-focus) (void))
|
(define/public (on-set-focus) (void))
|
||||||
(define/public (on-kill-focus) (void))
|
(define/public (on-kill-focus) (void))
|
||||||
|
@ -314,6 +314,7 @@
|
||||||
(MoveWindow hwnd x y w h #t))
|
(MoveWindow hwnd x y w h #t))
|
||||||
(unless (and (= w -1) (= h -1))
|
(unless (and (= w -1) (= h -1))
|
||||||
(on-resized))
|
(on-resized))
|
||||||
|
(queue-on-size)
|
||||||
(refresh))
|
(refresh))
|
||||||
(define/public (move x y)
|
(define/public (move x y)
|
||||||
(set-size x y -1 -1))
|
(set-size x y -1 -1))
|
||||||
|
|
|
@ -288,13 +288,16 @@
|
||||||
(send admin set-canvas #f)
|
(send admin set-canvas #f)
|
||||||
#|(super ~)|#)
|
#|(super ~)|#)
|
||||||
|
|
||||||
(define/override (on-size w h)
|
(define/override (on-size)
|
||||||
(unless noloop?
|
(unless noloop?
|
||||||
(unless (and (= w lastwidth)
|
|
||||||
(= h lastheight))
|
|
||||||
(unless (and media
|
(unless (and media
|
||||||
(send media get-printing))
|
(send media get-printing))
|
||||||
(reset-size)))))
|
(let-boxes ([w 0]
|
||||||
|
[h 0])
|
||||||
|
(get-size w h)
|
||||||
|
(unless (and (= w lastwidth)
|
||||||
|
(= h lastheight))
|
||||||
|
(reset-size))))))
|
||||||
|
|
||||||
(define/private (reset-size)
|
(define/private (reset-size)
|
||||||
(reset-visual #f)
|
(reset-visual #f)
|
||||||
|
|
|
@ -34,7 +34,6 @@
|
||||||
[on-set-focus (lambda () (void))]
|
[on-set-focus (lambda () (void))]
|
||||||
[on-kill-focus (lambda () (void))]
|
[on-kill-focus (lambda () (void))]
|
||||||
[set-focus (lambda () (void))]
|
[set-focus (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? (lambda () #f)]
|
||||||
|
|
|
@ -395,8 +395,8 @@
|
||||||
;; aren't stretchable, frame resized to size of
|
;; aren't stretchable, frame resized to size of
|
||||||
;; contents. Each direction is handled
|
;; contents. Each direction is handled
|
||||||
;; independently.
|
;; independently.
|
||||||
[on-size
|
[queue-on-size
|
||||||
(lambda (bad-width bad-height)
|
(lambda ()
|
||||||
(unless (and already-trying? (not (eq? 'unix (system-type))))
|
(unless (and already-trying? (not (eq? 'unix (system-type))))
|
||||||
(parameterize ([wx:current-eventspace (get-eventspace)])
|
(parameterize ([wx:current-eventspace (get-eventspace)])
|
||||||
(wx:queue-callback (lambda () (resized)) #t))))])
|
(wx:queue-callback (lambda () (resized)) #t))))])
|
||||||
|
|
|
@ -190,10 +190,9 @@
|
||||||
(as-exit
|
(as-exit
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(send (get-proxy) on-drop-file f)))))]
|
(send (get-proxy) on-drop-file f)))))]
|
||||||
[on-size (lambda (bad-w bad-h)
|
[queue-on-size
|
||||||
(super on-size bad-w bad-h)
|
(lambda ()
|
||||||
;; Delay callback to make sure X structures (position) are updated, first.
|
(super queue-on-size)
|
||||||
;; Also, Windows needs a trampoline.
|
|
||||||
(queue-window-callback
|
(queue-window-callback
|
||||||
this
|
this
|
||||||
(entry-point
|
(entry-point
|
||||||
|
|
Loading…
Reference in New Issue
Block a user