add support and docs for the snip flag HANDLES-BETWEEN-EVENTS

This commit is contained in:
Robby Findler 2015-12-17 16:16:40 -06:00
parent 23f22a8bcf
commit 759d89443f
3 changed files with 12 additions and 4 deletions

View File

@ -312,6 +312,12 @@ following symbols:
not have the keyboard focus (see also
@method[snip% on-goodbye-event])}
@item{@indexed-racket['handles-between-events] --- this snip wishes
to handle mouse events that are between items in the snip
(instead of defaulting to treating mouse clicks as
setting the position or other event handling that happens
at the @racket[text%] or @racket[pasteboard%] level}
@item{@indexed-racket['width-depends-on-x] --- this snip's display
width depends on the snip's x-@techlink{location} within the
editor; e.g.: tab}

View File

@ -7,7 +7,7 @@
["base" #:version "6.2.900.17"]
"syntax-color-lib"
["draw-lib" #:version "1.11"]
"snip-lib"
["snip-lib" #:version "1.2"]
"wxme-lib"
"pict-lib"
"scheme-lib"
@ -30,4 +30,4 @@
(define pkg-authors '(mflatt robby))
(define version "1.20")
(define version "1.21")

View File

@ -470,8 +470,10 @@
(set-box! now (find-position x y #f onit? how-close))
;; FIXME: the following refinement of `onit?' seems pointless
(let ([onit? (and onit?
(not (zero? how-close))
((abs how-close) . > . between-threshold))])
(or (and (not (zero? how-close))
((abs how-close) . > . between-threshold))
(has-flag? (snip->flags s-caret-snip)
HANDLES-BETWEEN-EVENTS)))])
(if onit?
;; we're in the snip's horizontal region...
(let ([snip (do-find-snip now 'after)])