class

Tui::Panel

Inherits Tui::Widget / Tui::Reactive / Reference / Object

Constants

BORDERS = {BorderStyle::Light => {h: '─', v: '│', tl: '┌', tr: '┐', bl: '└', br: '┘', tl_title: '┤', tr_title: '├'}, BorderStyle::Heavy => {h: '━', v: '┃', tl: '┏', tr: '┓', bl: '┗', br: '┛', tl_title: '┫', tr_title: '┣'}, BorderStyle::Double => {h: '═', v: '║', tl: '╔', tr: '╗', bl: '╚', br: '╝', tl_title: '╡', tr_title: '╞'}, BorderStyle::Round => {h: '─', v: '│', tl: '╭', tr: '╮', bl: '╰', br: '╯', tl_title: '┤', tr_title: '├'}, BorderStyle::Ascii => {h: '-', v: '|', tl: '+', tr: '+', bl: '+', br: '+', tl_title: ']', tr_title: '['}}

Border characters: tl_title = left of title, tr_title = right of title ┤ receives line from left, ├ sends line to right

Constructors

new(title : String = "", id : String | Nil = nil, border_style : BorderStyle = BorderStyle::Light, border_color : Color = Color.white, &block : Panel -> Nil)

Initialize and configure content through a block.

Source
new(title : String = "", id : String | Nil = nil, border_style : BorderStyle = BorderStyle::Light, border_color : Color = Color.white)
Source

Instance methods

apply_css_style(css_style : Hash(String, CSS::Value)) : Nil

Override to handle Panel-specific CSS properties

Source
border_color
Source
border_color=(border_color : Color)
Source
border_style
Source
border_style=(border_style : BorderStyle)
Source
content
Source
content

Convenience: set content via block

Source
content=(widget : Widget) : Nil

Set content widget

Source
content_height
Source
content_height=(value : Int32) : Nil
Source
focus_border_color

Focus highlighting (when widget is focused)

Source
focus_border_color=(focus_border_color : Color | Nil)

Focus highlighting (when widget is focused)

Source
focus_highlight
Source
focus_highlight=(focus_highlight : Bool)
Source
focus_title_color
Source
focus_title_color=(focus_title_color : Color | Nil)
Source
inner_rect

Get inner rectangle (excluding border and padding)

Source
max_scroll_y
Source
on_event(event : Event) : Bool

Override to handle events for this widget (target/bubble phase) Called after children have had a chance to handle the event

Source
padding=(value : Int32) : Nil

Legacy uniform padding setter (use inherited BoxModel padding property)

Source
render(buffer : Buffer, clip : Rect) : Nil

Override to render widget content

Source
scroll_down(lines : Int32 = @scroll_lines) : Nil
Source
scroll_lines
Source
scroll_lines=(scroll_lines : Int32)
Source
scroll_up(lines : Int32 = @scroll_lines) : Nil
Source
scroll_y

Scrolling methods

Source
scroll_y=(value : Int32) : Nil
Source
scrollable

Scrolling

Source
scrollable=(scrollable : Bool)

Scrolling

Source
show_borders
Source
show_borders=(show_borders : BorderSides)
Source
title
Source
title=(title : String)
Source
title_align
Source
title_align=(title_align : Label::Align)
Source
title_color
Source
title_color=(title_color : Color)
Source
title_decor
Source
title_decor=(title_decor : TitleStyle)
Source
title_offset
Source
title_offset=(title_offset : Int32 | Nil)
Source
title_truncate
Source
title_truncate=(title_truncate : TitleTruncate)
Source

Nested types