3.3.4 Canvases
3.3.4.1 Canvas
3.3.4.2 Editor  Canvas
On this page:
Editor  Canvas
Editor  Canvas  Child
Editor  Canvas.Style
Editor  Canvas.Style.no_  boder
Editor  Canvas.Style.choice
Editor  Canvas.Style.no_  hscroll
Editor  Canvas.Style.auto_  hscroll
Editor  Canvas.Style.hide_  hscroll
Editor  Canvas.Style.no_  vscroll
Editor  Canvas.Style.auto_  vscroll
Editor  Canvas.Style.hide_  vscroll
Editor  Canvas.Style.resize_  corner
Editor  Canvas.Style.transparent
Editor  Canvas.Style.no_  focus

image

class

class gui.EditorCanvas():

  implements WindowChildView

  constructor (

    editor :: ObsOrValue.of(maybe(EditorCanvasChild)),

    ~label: label :: ObsOrValue.of(maybe(View.LabelString)) = #false,

    ~enable: enable :: ObsOrValue.of(Boolean) = #true,

    ~styles: style :: ObsOrValue.of(List.of(EditorCanvas.Style)) = [],

    ~scrolls_per_page: scrolls_per_page :: Int.in(1..=10000) = 100,

    ~wheel_step: wheel_step :: ObsOrValue.of(maybe(Int.in(1..=10000))) = #false,

    ~line_count: line_count ::  ObsOrValue.of(maybe(Int.in(1..=1000))) = #false,

    ~inset: inset :: ObsOrValue.of(View.Margin) = [5, 5],

    ~margin: margin :: ObsOrValue.of(View.Margin) = [0, 0],

    ~min_size: min_size :: ObsOrValue.of(View.Size) = [#false, #false],

    ~stretch: stretch :: ObsOrValue.of(View.Stretch) = [#true, #true],

    ~window_callbacks: wcb :: WindowCallbacks = WindowCallbacks()

  )

 

interface

interface gui.EditorCanvasChild:

  implementable unexported

Creates a canvas view to hold an editor. An editor is implemented as an instance of EditorCanvasChild by libraries that cooperate with the gui library.

An editor canvas style symbol:

  • #'no_border: Omits a border around the editor canvas.

  • #'choice: Gives the editor canvas a popup button that is like an Input with a ~choices list.

  • #'no_hscroll: Disables horizontal scrolling and hides the horizontal scrollbar.

  • #'auto_hscroll: Automatically hides the horizontal scrollbar when unneeded (unless #'no_hscroll or #'hide_hscroll is also specified).

  • #'hide_hscroll: Allows horizontal scrolling, but hides the horizontal scrollbar.

  • #'no_vscroll: Disables vertical scrolling and hides the vertical scrollbar.

  • #'auto_vscroll: Automatically hides the vertical scrollbar when unneeded (unless #'no_vscroll or #'hide_vscroll is also specified).

  • #'hide_vscroll: Allows vertical scrolling, but hides the vertical scrollbar.

  • #'resize_corner: Leaves room for a resize control at the editor canvas’s bottom right when only one scrollbar is visible.

  • #'transparent: The editor canvas is “erased” by the windowing system by letting its parent show through.

  • #'no_focus: Prevents the editor canvas from accepting the keyboard focus when the canvas is clicked or when the WindowChildView.focus method is called.