editor-canvas%
Implements: canvas<%>
An editor-canvas% object manages and displays a
text% or pasteboard% object.
( -> new editor-canvas% (parent _) [(editor _)] [(style _)] [(scrolls-per-page _)] [(label _)] [(wheel-step _)] [(line-count _)] [(horizontal-inset _)] [(vertical-inset _)] [(enabled _)] [(vert-margin _)] [(horiz-margin _)] [(min-width _)] [(min-height _)] [(stretchable-width _)] [(stretchable-height _)])editor-canvas% object
parent : frame%, dialog%, panel%, or pane% object
editor = : #ftext% or pasteboard% object or #f
style = : list of symbols in null'(no-hscroll no-vscroll hide-hscroll hide-vscroll control-border deleted)
scrolls-per-page = : exact integer in [1, 10000]
100
label = : string (up to 200 characters) or #f#f
wheel-step = : exact integer in [1, 10000] or 3#f
line-count = : exact integer in [1, 1000] or #f#f
horizontal-inset = : exact integer in [1, 1000]
5
vertical-inset = : exact integer in [1, 1000]
5
enabled = : boolean
#t
vert-margin = : exact integer in [0, 1000]
0
horiz-margin = : exact integer in [0, 1000]
0
min-width = : exact integer in [0, 10000]
0
min-height = : exact integer in [0, 10000]
0
stretchable-width = : boolean
#t
stretchable-height = : boolean#t
If a canvas is initialized with #f for editor, install an
editor later with
set-editor.
The style list can contain the following flags:
'no-hscroll -- disallows horizontal scrolling
'no-vscroll -- disallows vertical scrolling
'hide-hscroll -- allows horizontal scrolling, but hides the horizontal scrollbar
'hide-vscroll -- allows vertical scrolling, but hides the vertical scrollbar
'control-border -- gives the canvas a border that is
like a text-field% control
'deleted -- creates the canvas as initially hidden and without affecting
parent's geometry; the canvas can be made active
later by calling parent's add-child
method
While vertical scrolling of text editors is based on lines,
horizontal scrolling and pasteboard vertical scrolling is based on a
fixed number of steps per horizontal page. The scrolls-per-page
argument sets this value.
If provided, the wheel-step argument is passed on to the
wheel-step method. The default wheel step can be overridden globally though the
'|MrEd:wheelStep| preference; see Preferences.
If line-count is not #f, it is passed on to the
set-line-count method.
If horizontal-inset is not 5, it is passed on to the
horizontal-inset method. Similarly, if vertical-inset is not 5, it is passed on to the
vertical-inset method.
For information about the
enabled
argument, see window<%>. For information about the
horiz-margin and vert-margin
arguments, see subarea<%>. For information about the
min-width, min-height, stretchable-width, and stretchable-height
arguments, see area<%>.
Methods
allow-scroll-to-last
allow-tab-exit
call-as-primary-owner
force-display-focus
get-editor
get-line-count
horizontal-inset
lazy-refresh
on-char
on-event
on-focus
on-paint
on-scroll
on-size
scroll-to
scroll-with-bottom-base
set-editor
set-line-count
vertical-inset
wheel-step
All Methods
accept-drop-files from window<%>
allow-scroll-to-last from editor-canvas%
allow-tab-exit from editor-canvas%
call-as-primary-owner from editor-canvas%
client->screen from window<%>
enable from window<%>
focus from window<%>
force-display-focus from editor-canvas%
get-client-size from window<%>
get-cursor from window<%>
get-dc from canvas<%>
get-editor from editor-canvas%
get-graphical-min-size from area<%>
get-height from window<%>
get-label from window<%>
get-line-count from editor-canvas%
get-parent from area<%>
get-plain-label from window<%>
get-size from window<%>
get-top-level-window from area<%>
get-width from window<%>
get-x from window<%>
get-y from window<%>
has-focus? from window<%>
horiz-margin from subarea<%>
horizontal-inset from editor-canvas%
is-enabled? from window<%>
is-shown? from window<%>
lazy-refresh from editor-canvas%
min-client-height from canvas<%>
min-client-width from canvas<%>
min-height from area<%>
min-width from area<%>
on-char from editor-canvas%
overrides on-char from canvas<%>
on-drop-file from window<%>
on-event from editor-canvas%
overrides on-event from canvas<%>
on-focus from editor-canvas%
overrides on-focus from window<%>
on-move from window<%>
on-paint from editor-canvas%
overrides on-paint from canvas<%>
on-scroll from editor-canvas%
overrides on-scroll from canvas<%>
on-size from editor-canvas%
overrides on-size from window<%>
on-subwindow-char from window<%>
on-subwindow-event from window<%>
on-superwindow-enable from window<%>
on-superwindow-show from window<%>
on-tab-in from canvas<%>
popup-menu from window<%>
refresh from window<%>
screen->client from window<%>
scroll-to from editor-canvas%
scroll-with-bottom-base from editor-canvas%
set-cursor from window<%>
set-editor from editor-canvas%
set-label from window<%>
set-line-count from editor-canvas%
show from window<%>
stretchable-height from area<%>
stretchable-width from area<%>
vert-margin from subarea<%>
vertical-inset from editor-canvas%
warp-pointer from canvas<%>
wheel-step from editor-canvas%