racket/gui: fix problems with canvas autoscroll
This commit is contained in:
parent
c61a4714e8
commit
39eae2e647
|
@ -532,7 +532,7 @@
|
|||
(fix-dc)
|
||||
(when (and (is-auto-scroll?)
|
||||
(not (is-panel?)))
|
||||
(reset-auto-scroll 0 0))
|
||||
(reset-auto-scroll))
|
||||
(on-size))
|
||||
|
||||
;; this `on-size' method is for `editor-canvas%', only:
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
h-pos v-pos)
|
||||
(void))
|
||||
|
||||
(define/public (reset-auto-scroll h-pos v-pos)
|
||||
(define/public (reset-auto-scroll [h-pos -1] [v-pos -1])
|
||||
(let ([xb (box 0)]
|
||||
[yb (box 0)])
|
||||
(get-client-size xb yb)
|
||||
|
|
|
@ -242,6 +242,7 @@
|
|||
is-auto-scroll? is-disabled-scroll?
|
||||
get-virtual-width get-virtual-height
|
||||
refresh-for-autoscroll refresh-all-children
|
||||
reset-auto-scroll
|
||||
get-eventspace
|
||||
register-extra-gtk)
|
||||
|
||||
|
@ -368,6 +369,9 @@
|
|||
|
||||
(define/override (set-size x y w h)
|
||||
(super set-size x y w h)
|
||||
(when (and (is-auto-scroll?)
|
||||
(not (is-panel?)))
|
||||
(reset-auto-scroll))
|
||||
(on-size))
|
||||
|
||||
(set! dc (new dc% [canvas this] [transparent? (memq 'transparent style)]))
|
||||
|
|
|
@ -286,6 +286,9 @@
|
|||
[h (if (= h -1) (- (RECT-bottom r) (RECT-top r)) h)])
|
||||
(MoveWindow canvas-hwnd 0 0 (max 1 (- w COMBO-WIDTH)) h #t)
|
||||
(MoveWindow combo-hwnd 0 0 (max 1 w) (- h 2) #t)))
|
||||
(when (and (is-auto-scroll?)
|
||||
(not (is-panel?)))
|
||||
(reset-auto-scroll))
|
||||
(on-size))
|
||||
|
||||
;; this `on-size' method is for `editor-canvas%', only:
|
||||
|
|
2
tmp1
Normal file
2
tmp1
Normal file
|
@ -0,0 +1,2 @@
|
|||
;(#t #f a () 9739 -3 . #((test) te " " st test #() b c))
|
||||
(define foo (quote (#t #f #\a () 9739 -3 . #((test) "te \" \" st" "" test #() b c))))
|
2
tmp2
Normal file
2
tmp2
Normal file
|
@ -0,0 +1,2 @@
|
|||
;(#t #f a () 9739 -3 . #((test) te " " st test #() b c))
|
||||
(define foo (quote (#t #f #\a () 9739 -3 . #((test) "te \" \" st" "" test #() b c))))
|
Loading…
Reference in New Issue
Block a user