|
superclass: snip% |
constructor
(new editor-snip% [ [editor editor] [with-border? with-border?] [left-margin left-margin] [top-margin top-margin] [right-margin right-margin] [bottom-margin bottom-margin] [left-inset left-inset] [top-inset top-inset] [right-inset right-inset] [bottom-inset bottom-inset] [min-width min-width] [max-width max-width] [min-height min-height] [max-height max-height]]) → (is-a?/c editor-snip%) editor : (or/c (is-a?/c editor<%>) #f) = #f with-border? : any/c = #t left-margin : exact-nonnegative-integer? = 5 top-margin : exact-nonnegative-integer? = 5 right-margin : exact-nonnegative-integer? = 5 bottom-margin : exact-nonnegative-integer? = 5 left-inset : exact-nonnegative-integer? = 1 top-inset : exact-nonnegative-integer? = 1 right-inset : exact-nonnegative-integer? = 1 bottom-inset : exact-nonnegative-integer? = 1
min-width : (or/c (and/c real? (not/c negative?)) 'none) = 'none
max-width : (or/c (and/c real? (not/c negative?)) 'none) = 'none
min-height : (or/c (and/c real? (not/c negative?)) 'none) = 'none
max-height : (or/c (and/c real? (not/c negative?)) 'none) = 'none
If with-border? is not #f, then a border will be drawn around the snip. The editor display will be inset in the snip area by the amounts specified in the -margin arguments. The border will be drawn with an inset specified by the -inset arguments.
See get-inset and get-margin for information about the inset and margin arguments.
method
(send an-editor-snip adjust-cursor dc x y editorx editory event) → (or/c (is-a?/c cursor%) #f) dc : (is-a?/c dc<%>) x : real? y : real? editorx : real? editory : real? event : (is-a?/c mouse-event%)
method
(send an-editor-snip border-visible?) → boolean?
See also show-border.
method
(send an-editor-snip get-align-top-line) → boolean?
See also set-align-top-line.
method
(send an-editor-snip get-editor)
→ (or/c (or/c (is-a?/c text%) (is-a?/c pasteboard%)) #f)
method
(send an-editor-snip get-extent dc x y [ w h descent space lspace rspace]) → void? dc : (is-a?/c dc<%>) x : real? y : real? w : (or/c (box/c (and/c real? (not/c negative?))) #f) = #f h : (or/c (box/c (and/c real? (not/c negative?))) #f) = #f
descent : (or/c (box/c (and/c real? (not/c negative?))) #f) = #f space : (or/c (box/c (and/c real? (not/c negative?))) #f) = #f
lspace : (or/c (box/c (and/c real? (not/c negative?))) #f) = #f
rspace : (or/c (box/c (and/c real? (not/c negative?))) #f) = #f
The top space always corresponds to the space of the editor’s top line, plus the snip’s top margin. Normally, the descent corresponds to the descent of the editor’s last line plus the snip’s bottom margin. However, if the snip is in align-top-line mode (see set-align-top-line), the descent corresponds to the descent of the top line, plus the height rest of the editor’s lines, plus the snip’s bottom margin.
If the editor is a text editor, then 1 is normally subtracted from the editor’s width as returned by get-extent, because the result looks better for editing. If the snip is in tight-text-fit mode (see set-tight-text-fit) then 2 is subtracted from a text editor’s width, eliminating the two pixels that the text editor reserves for the blinking caret. In addition, tight-text-fit mode subtracts an amount equal to the line spacing from the editor’s height. By default, tight-text-fit mode is disabled.
method
l : (box/c exact-nonnegative-integer?) t : (box/c exact-nonnegative-integer?) r : (box/c exact-nonnegative-integer?) b : (box/c exact-nonnegative-integer?)
The l box is filled with left inset. The t box is filled with top inset. The r box is filled with right inset. The b box is filled with bottom inset.
method
(send an-editor-snip get-margin l t r b) → void?
l : (box/c exact-nonnegative-integer?) t : (box/c exact-nonnegative-integer?) r : (box/c exact-nonnegative-integer?) b : (box/c exact-nonnegative-integer?)
The l box is filled with left margin. The t box is filled with top margin. The r box is filled with right margin. The b box is filled with bottom margin.
method
(send an-editor-snip get-tight-text-fit) → boolean?
See also set-tight-text-fit.
Also sets the minimum and maximum width of the editor owned by the snip to the given width (minus the snip border space) via set-max-width and set-min-width.
method
(send an-editor-snip set-align-top-line tight?) → void?
tight? : any/c
See also get-align-top-line.
method
(send an-editor-snip set-editor editor) → void?
editor : (or/c (or/c (is-a?/c text%) (is-a?/c pasteboard%)) #f)
When an editor-snip% object is not inserted in an editor, it does not have an administrator. During this time, it does not give its contained editor an administrator, either. The administratorless contained editor can therefore “defect” to some other display with an administrator. When a contained editor defects and the snip is eventually inserted into a different editor, the snip drops the traitor contained editor, setting its contained editor to #f.
method
l : exact-nonnegative-integer? t : exact-nonnegative-integer? r : exact-nonnegative-integer? b : exact-nonnegative-integer?
method
(send an-editor-snip set-margin l t r b) → void?
l : exact-nonnegative-integer? t : exact-nonnegative-integer? r : exact-nonnegative-integer? b : exact-nonnegative-integer?
method
(send an-editor-snip set-max-height h) → void?
h : (or/c (and/c real? (not/c negative?)) 'none)
Zero or 'none disables the limit.
method
(send an-editor-snip set-max-width w) → void?
w : (or/c (and/c real? (not/c negative?)) 'none)
Zero or 'none disables the limit.
method
(send an-editor-snip set-min-height h) → void?
h : (or/c (and/c real? (not/c negative?)) 'none)
Zero or 'none disables the limit.
method
(send an-editor-snip set-min-width w) → void?
w : (or/c (and/c real? (not/c negative?)) 'none)
Zero or 'none disables the limit.
method
(send an-editor-snip set-tight-text-fit tight?) → void?
tight? : any/c
See also get-tight-text-fit.
method
(send an-editor-snip show-border show?) → void?
show? : any/c
method
(send an-editor-snip style-background-used?) → boolean?
See also use-style-background.
method
(send an-editor-snip use-style-background use?) → void?
use? : any/c