editor-admin% : class? |
superclass: object% |
To create a new editor-admin% class, all methods described here must be overridden. They are all invoked by the administrator’s editor.
(new editor-admin%) → (is-a?/c editor-admin%)
(send an-editor-admin get-dc [x y]) → (or/c (is-a?/c dc<%>) false/c) x : (or/c (box/c real?) false/c) = #f y : (or/c (box/c real?) false/c) = #f
The origin of the drawing context is also returned, translated into the local coordinates of the editor. For an embedded editor, the returned origin is reliable only while the editor is being drawn, or while it receives a mouse or keyboard event.
The x box is filled with the x-origin of the DC in editor coordinates, unless x is #f. The y box is filled with the y-origin of the DC in editor coordinates, unless y is #f.
See also editor-location-to-dc-location in editor<%> and dc-location-to-editor-location in editor<%>.
Default implementation: Fills all boxes with 0.0 and returns #f.
(send an-editor-admin get-max-view x y w h [ full?]) → void? x : (or/c (box/c real?) false/c) y : (or/c (box/c real?) false/c) w : (or/c (box/c (and/c real? (not/c negative?))) false/c) h : (or/c (box/c (and/c real? (not/c negative?))) false/c) full? : any/c = #f
See get-view.
Default implementation: Fills all boxes with 0.0.
(send an-editor-admin get-view x y w h [full?]) → void? x : (or/c (box/c real?) false/c) y : (or/c (box/c real?) false/c) w : (or/c (box/c (and/c real? (not/c negative?))) false/c) h : (or/c (box/c (and/c real? (not/c negative?))) false/c) full? : any/c = #f
If the display is an editor canvas, see also reflow-container. The viewing area within an editor canvas is not the full client area of the canvas, because an editor canvas installs a whitespace border around a displayed editor within the client area.
The calculation of the editor’s visible region is based on the current size and scrollbar values of the top-level display. For an editor canvas display, the region reported by get-view does not depend on whether the canvas is hidden, obscured by other windows, or moved off the edge of the screen.
The x box is filled with the left edge of the visible region in editor coordinates, unless x is #f. The y box is filled with the top edge of the visible region in editor coordinates, unless y is #f. The w box is filled with the width of the visible region, which may be larger than the editor itself, unless w is #f. The h box is filled with the height of the visible region, which may be larger than the editor itself, unless h is #f.
If an editor is fully visible and full? is #f, then x and y will both be filled with 0.
If full? is a true value, then the returned area is the view area of the top-level display for the editor. This result is different only when the editor is embedded in another editor; in that case, the x and y values may be meaningless, because they are in the coordinate system of the immediate editor within the top-level display.
Default implementation: Fills all boxes with 0.0.
(send an-editor-admin grab-caret [domain]) → void? domain : (one-of/c 'immediate 'display 'global) = 'global
See set-caret-owner for information about the possible values of domain.
Default implementation: Does nothing.
See also set-modified in editor<%>.
Default implementation: Does nothing.
(send an-editor-admin needs-update localx localy w h) → void? localx : real? localy : real? w : (and/c real? (not/c negative?)) h : (and/c real? (not/c negative?))
The localx, localy, w, and h arguments specify a region of the editor to be updated (in editor coordinates).
Default implementation: Does nothing.
(send an-editor-admin popup-menu menu x y) → boolean? menu : (is-a?/c popup-menu%) x : real? y : real?
The menu is displayed at x and y in editor coordinates.
Default implementation: Returns #f.
(send an-editor-admin refresh-delayed?) → boolean?
Default implementation: Returns #f.
Default implementation: Does nothing.
(send an-editor-admin scroll-to localx localy w h [ refresh? bias]) → boolean? localx : real? localy : real? w : (and/c real? (not/c negative?)) h : (and/c real? (not/c negative?)) refresh? : any/c = #t bias : (one-of/c 'start 'end 'none) = 'none
The localx, localy, w, and h arguments specify a region of the editor to be made visible by the scroll (in editor coordinates).
If refresh? is not #f, then the editor is requesting to be updated immediately.
'start —
if the range doesn’t fit in the visible area, show the top-left region 'none —
no special scrolling instructions 'end —
if the range doesn’t fit in the visible area, show the bottom-right region
The return value is #t if the display is scrolled, #f if not (either because the requested region is already visible, because the display has zero size, or because the editor is currently printing).
If an editor has multiple displays, then if any display currently has the keyboard focus, it is scrolled. Otherwise, the “primary owner” of the editor (see call-as-primary-owner) is scrolled.
Default implementation: Return #f
(send an-editor-admin update-cursor) → void?