Skip to content
FutureBlitz

    Install

    Import std.term.widgets

    Box

    std.term.widgets

    class

    Public Class Box

    Text in a box, with a Title in its top line or not, which Render draws with a BorderStyle's lines. It's as wide as its widest line, or Width wide inside its lines, where the lines wider than that wrap.

    std/term/widgets.fb, line 351

    • Public Field Content: String field #

      Its text.

    • Public Field Title: String field #

      What's in its top line, or "" for nothing.

    • Public Field Border: BorderStyle field #

      The lines it's drawn with.

    • Public Field BorderColor: Style field #

      How the lines look.

    • Public Field TitleStyle: Style field #

      How the title looks.

    • Public Field Align: Alignment field #

      Where the content's lines go inside it.

    • Public Field Padding: Int field #

      The spaces on each side of the content.

    • Public Field Width: Int field #

      The columns inside its lines, padding and all, or 0 for as many as the content needs.

    • Public New(content: String, title: String = "") constructor #

      A Box of content, with title in its top line.

    • Public Method Render(colors: ColorLevel = ColorLevel.NONE): String method #

      Its lines, with a line break between each two, styled as colors shows them, or plain for NONE.

    • Public Method Print() method #

      Writes it to stdout, with a line break after, as stdout shows colors.

    • Public Method Draw(terminal: Terminal) method #

      Writes it to terminal, with a line break after, as it shows colors.

    Report an issue with this page or with FutureBlitz on GitHub.