aligned-pasteboard and cue-text% repairs

svn: r14463
This commit is contained in:
Matthew Flatt 2009-04-08 12:59:22 +00:00
parent 406d0774c9
commit 52d6fb4e1d
2 changed files with 10 additions and 2 deletions

View File

@ -19,7 +19,8 @@
(define cue-text-mixin
(mixin ((class->interface text%)) ()
(inherit insert change-style erase clear-undos)
(inherit insert change-style erase clear-undos
copy-self-to get-line-spacing)
(init [cue-text ""]
[color "gray"])
(init-field
@ -47,6 +48,13 @@
(when (member 'on-char behavior)
(clear-cue-text))
(super on-local-char akeyevent))
(define/override (copy-self)
(let ([m (new cue-text%
[behavior behavior]
[line-spacing (get-line-spacing)])])
(copy-self-to m)
m))
;; Insert the cue text into the text% on instantiation
(super-new)

View File

@ -80,7 +80,7 @@
(define/public (realign-to-alloted)
(when (and alloted-width alloted-height)
(when (not (and (positive? alloted-width) (positive? alloted-height)))
(error 'here "I am"))
(error "allotted width or height is not positive"))
(dynamic-let ([ignore-resizing? true])
(let* ([first-snip (find-first-snip)]
[aligned-rects