From 875244719be741f1849a554c4e9b81262a492a0b Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Tue, 23 Mar 2010 01:49:08 +0000 Subject: [PATCH] bug fixes from random testing svn: r18602 original commit: fb37601b558516610d9e2058433aa43ebcfa62e5 --- collects/mred/private/seqcontract.ss | 8 +++++++- collects/mred/private/wxme/text.ss | 6 +++--- collects/scribblings/gui/editor-wordbreak-map-class.scrbl | 4 ++-- collects/scribblings/gui/image-snip-class.scrbl | 2 +- collects/scribblings/gui/style-list-class.scrbl | 2 +- collects/scribblings/gui/text-class.scrbl | 5 +++-- 6 files changed, 17 insertions(+), 10 deletions(-) diff --git a/collects/mred/private/seqcontract.ss b/collects/mred/private/seqcontract.ss index aebd8712..34fad331 100644 --- a/collects/mred/private/seqcontract.ss +++ b/collects/mred/private/seqcontract.ss @@ -264,6 +264,7 @@ Matthew unlocked) (get-text [() (x) (x y) (x y z) (x y z p)] unlocked) + (get-flattened-text [()] unlocked) (get-character [(start)] unlocked) (find-wordbreak [(start end reason)] unlocked) (save-file [() (filename) (filename format) (filename format show-errors?)] unlocked) @@ -273,7 +274,10 @@ Matthew (num-scroll-lines [()] unlocked) (find-scroll-line [(location)] unlocked) (style-has-changed [(style)] unlocked) - + + (set-paragraph-margins [(para fl l r)] unlocked) + (set-paragraph-alignment [(para align)] unlocked) + (change-style [(x) (x y) (x y z) (x y z w)] unlocked) (insert [(x) (x y) (x y z) (x y z p) (x y z p q)] unlocked) (delete [() (start) (start end) (start end scroll-ok?)] unlocked) @@ -306,6 +310,7 @@ Matthew write-lock) (get-text [() (x) (x y) (x y z) (x y z p)] write-lock) + (get-flattened-text [()] write-lock) (get-character [(start)] write-lock) (find-wordbreak [(start end reason)] write-lock) (save-file [() (filename) (filename format) (filename format show-errors?)] write-lock) @@ -321,6 +326,7 @@ Matthew (not (locked-for-read?))) (get-text [() (x) (x y) (x y z) (x y z p)] flow-lock) + (get-flattened-text [()] flow-lock) (get-character [(start)] flow-lock) (find-wordbreak [(start end reason)] flow-lock) (save-file [() (filename) (filename format) (filename format show-errors?)] flow-lock) diff --git a/collects/mred/private/wxme/text.ss b/collects/mred/private/wxme/text.ss index 1fc4a463..092fa205 100644 --- a/collects/mred/private/wxme/text.ss +++ b/collects/mred/private/wxme/text.ss @@ -170,14 +170,14 @@ (define sticky-styles? #t) (define overwrite-mode? #f) - (def/public (set-styles-sticky [bool? s?]) (set! sticky-styles? s?)) + (def/public (set-styles-sticky [bool? s?]) (set! sticky-styles? (and s? #t))) (def/public (get-styles-sticky) sticky-styles?) (def/public (get-overwrite-mode) overwrite-mode?) - (def/public (set-overwrite-mode [bool? v]) (set! overwrite-mode? v)) + (def/public (set-overwrite-mode [bool? v]) (set! overwrite-mode? (and v #t))) (def/public (get-sticky-styles) sticky-styles?) - (def/public (set-sticky-styles [bool? v]) (set! sticky-styles? v)) + (def/public (set-sticky-styles [bool? v]) (set! sticky-styles? (and v #t))) (define need-x-copy? #f) diff --git a/collects/scribblings/gui/editor-wordbreak-map-class.scrbl b/collects/scribblings/gui/editor-wordbreak-map-class.scrbl index d20d2c9e..ca5c87fd 100644 --- a/collects/scribblings/gui/editor-wordbreak-map-class.scrbl +++ b/collects/scribblings/gui/editor-wordbreak-map-class.scrbl @@ -43,7 +43,7 @@ All ASCII alpha-numeric characters are initialized with } @defmethod[(get-map [char char?]) - (listof symbol?)]{ + (listof (one-of/c 'caret 'line 'selection 'user1 'user2))]{ Gets the mapping value for @scheme[char]. See @scheme[editor-wordbreak-map%] for more information. @@ -51,7 +51,7 @@ Gets the mapping value for @scheme[char]. See } @defmethod[(set-map [char char?] - [value (listof symbol?)]) + [value (listof (one-of/c 'caret 'line 'selection 'user1 'user2))]) void?]{ diff --git a/collects/scribblings/gui/image-snip-class.scrbl b/collects/scribblings/gui/image-snip-class.scrbl index d8cc0cf3..5d34edf3 100644 --- a/collects/scribblings/gui/image-snip-class.scrbl +++ b/collects/scribblings/gui/image-snip-class.scrbl @@ -154,7 +154,7 @@ used.} @defmethod[#:mode override (resize [w (and/c real? (not/c negative?))] [h (and/c real? (not/c negative?))]) - void?]{ + boolean?]{ The bitmap will be cropped to fit in the given dimensions. diff --git a/collects/scribblings/gui/style-list-class.scrbl b/collects/scribblings/gui/style-list-class.scrbl index 7323ee34..7a05a175 100644 --- a/collects/scribblings/gui/style-list-class.scrbl +++ b/collects/scribblings/gui/style-list-class.scrbl @@ -123,7 +123,7 @@ The @scheme[like-style] style must be in this style list, otherwise } -@defmethod[(notify-on-change [f ((or/c (is-a?/c style<%> false/c)) . -> . any)]) +@defmethod[(notify-on-change [f ((or/c (is-a?/c style<%>) #f) . -> . any)]) any/c]{ Attaches a callback to the style list. The callback is invoked diff --git a/collects/scribblings/gui/text-class.scrbl b/collects/scribblings/gui/text-class.scrbl index d4958502..552901e6 100644 --- a/collects/scribblings/gui/text-class.scrbl +++ b/collects/scribblings/gui/text-class.scrbl @@ -1020,10 +1020,11 @@ If the editor is displayed by multiple canvases and @scheme[all?] is @defmethod[(get-wordbreak-map) - (is-a?/c editor-wordbreak-map%)]{ + (or/c (is-a?/c editor-wordbreak-map%) #f)]{ Returns the wordbreaking map that is used by the standard wordbreaking - function. See @scheme[editor-wordbreak-map%] for more information. + function. See @method[text% set-wordbreak-map] and + @scheme[editor-wordbreak-map%] for more information. }