Documentation ¶
Index ¶
- Constants
- func AlignText(txt string, width int, align TextAlignment) string
- func AlignTextWithFill(txt string, width int, align TextAlignment, fill rune) string
- func DrawBorder(x1, y1, x2, y2 int, fg, bg termbox.Attribute)
- func DrawBorderWithPct(x1, y1, x2, y2 int, pct float64, fg, bg termbox.Attribute)
- func DrawBorderWithTitle(x1, y1, x2, y2 int, title string, fg, bg termbox.Attribute)
- func DrawBorderWithTitleAndPct(x1, y1, x2, y2 int, title string, pct float64, fg, bg termbox.Attribute)
- func DrawStringAtPoint(str string, x int, y int, fg termbox.Attribute, bg termbox.Attribute) (int, int)
- func FillWithChar(r rune, x1, y1, x2, y2 int, fg termbox.Attribute, bg termbox.Attribute)
- func KeyIsAlpha(event termbox.Event) bool
- func KeyIsAlphaNumeric(event termbox.Event) bool
- func KeyIsNumeric(event termbox.Event) bool
- func KeyIsSymbol(event termbox.Event) bool
- type ASCIIArt
- func (i *ASCIIArt) Align(a TextAlignment, width int)
- func (i *ASCIIArt) Draw()
- func (i *ASCIIArt) GetBgColor() termbox.Attribute
- func (i *ASCIIArt) GetContents() []string
- func (i *ASCIIArt) GetFgColor() termbox.Attribute
- func (i *ASCIIArt) GetHeight() int
- func (i *ASCIIArt) GetID() string
- func (i *ASCIIArt) GetWidth() int
- func (i *ASCIIArt) GetX() int
- func (i *ASCIIArt) GetY() int
- func (i *ASCIIArt) HandleEvent(event termbox.Event) bool
- func (i *ASCIIArt) IsActive() bool
- func (i *ASCIIArt) IsBordered() bool
- func (i *ASCIIArt) IsTabSkipped() bool
- func (i *ASCIIArt) SetActive(a bool)
- func (i *ASCIIArt) SetActiveBgColor(bg termbox.Attribute)
- func (i *ASCIIArt) SetActiveFgColor(fg termbox.Attribute)
- func (i *ASCIIArt) SetBgColor(bg termbox.Attribute)
- func (i *ASCIIArt) SetBordered(b bool)
- func (i *ASCIIArt) SetContentLine(s string, idx int)
- func (i *ASCIIArt) SetContents(c []string)
- func (i *ASCIIArt) SetFgColor(fg termbox.Attribute)
- func (i *ASCIIArt) SetHeight(h int)
- func (i *ASCIIArt) SetID(newID string)
- func (i *ASCIIArt) SetTabSkip(b bool)
- func (i *ASCIIArt) SetWidth(w int)
- func (i *ASCIIArt) SetX(x int)
- func (i *ASCIIArt) SetY(y int)
- type AlertModal
- func (i *AlertModal) Clear()
- func (i *AlertModal) Draw()
- func (i *AlertModal) GetBackground() termbox.Attribute
- func (i *AlertModal) GetBgColor() termbox.Attribute
- func (i *AlertModal) GetFgColor() termbox.Attribute
- func (i *AlertModal) GetForeground() termbox.Attribute
- func (i *AlertModal) GetHeight() int
- func (i *AlertModal) GetID() string
- func (i *AlertModal) GetText() string
- func (i *AlertModal) GetTitle() string
- func (i *AlertModal) GetWidth() int
- func (i *AlertModal) GetX() int
- func (i *AlertModal) GetY() int
- func (i *AlertModal) HandleEvent(event termbox.Event) bool
- func (i *AlertModal) HelpIsShown() bool
- func (i *AlertModal) Hide()
- func (i *AlertModal) IsAccepted() bool
- func (i *AlertModal) IsActive() bool
- func (i *AlertModal) IsBordered() bool
- func (i *AlertModal) IsDone() bool
- func (i *AlertModal) IsTabSkipped() bool
- func (i *AlertModal) SetActive(a bool)
- func (i *AlertModal) SetActiveBgColor(bg termbox.Attribute)
- func (i *AlertModal) SetActiveFgColor(fg termbox.Attribute)
- func (i *AlertModal) SetBackground(bg termbox.Attribute)
- func (i *AlertModal) SetBgColor(bg termbox.Attribute)
- func (i *AlertModal) SetBordered(b bool)
- func (i *AlertModal) SetDone(b bool)
- func (i *AlertModal) SetFgColor(fg termbox.Attribute)
- func (i *AlertModal) SetForeground(fg termbox.Attribute)
- func (i *AlertModal) SetHeight(height int)
- func (i *AlertModal) SetID(newID string)
- func (i *AlertModal) SetTabSkip(b bool)
- func (i *AlertModal) SetText(s string)
- func (i *AlertModal) SetTitle(s string)
- func (i *AlertModal) SetWidth(width int)
- func (i *AlertModal) SetX(x int)
- func (i *AlertModal) SetY(y int)
- func (i *AlertModal) Show()
- func (i *AlertModal) ShowHelp(b bool)
- type Button
- func (c *Button) Draw()
- func (c *Button) GetBgColor() termbox.Attribute
- func (c *Button) GetFgColor() termbox.Attribute
- func (c *Button) GetHeight() int
- func (c *Button) GetID() string
- func (c *Button) GetWidth() int
- func (c *Button) GetX() int
- func (c *Button) GetY() int
- func (c *Button) HandleEvent(e termbox.Event) bool
- func (c *Button) IsActive() bool
- func (c *Button) IsBordered() bool
- func (c *Button) IsTabSkipped() bool
- func (c *Button) SetActive(a bool)
- func (c *Button) SetActiveBgColor(bg termbox.Attribute)
- func (c *Button) SetActiveFgColor(fg termbox.Attribute)
- func (c *Button) SetBgColor(bg termbox.Attribute)
- func (c *Button) SetBordered(bordered bool)
- func (c *Button) SetFgColor(fg termbox.Attribute)
- func (c *Button) SetHeight(h int)
- func (c *Button) SetID(newID string)
- func (c *Button) SetTabSkip(skip bool)
- func (c *Button) SetWidth(w int)
- func (c *Button) SetX(x int)
- func (c *Button) SetY(y int)
- type Checkbox
- func (c *Checkbox) Draw()
- func (c *Checkbox) GetBgColor() termbox.Attribute
- func (c *Checkbox) GetFgColor() termbox.Attribute
- func (c *Checkbox) GetHeight() int
- func (c *Checkbox) GetID() string
- func (c *Checkbox) GetWidth() int
- func (c *Checkbox) GetX() int
- func (c *Checkbox) GetY() int
- func (c *Checkbox) HandleEvent(event termbox.Event) bool
- func (c *Checkbox) IsActive() bool
- func (c *Checkbox) IsBordered() bool
- func (c *Checkbox) IsTabSkipped() bool
- func (c *Checkbox) SetActive(a bool)
- func (c *Checkbox) SetActiveBgColor(bg termbox.Attribute)
- func (c *Checkbox) SetActiveFgColor(fg termbox.Attribute)
- func (c *Checkbox) SetBgColor(bg termbox.Attribute)
- func (c *Checkbox) SetBordered(b bool)
- func (c *Checkbox) SetFgColor(fg termbox.Attribute)
- func (c *Checkbox) SetHeight(h int)
- func (c *Checkbox) SetID(newID string)
- func (c *Checkbox) SetTabSkip(b bool)
- func (c *Checkbox) SetTitle(title string)
- func (c *Checkbox) SetWidth(w int)
- func (c *Checkbox) SetX(x int)
- func (c *Checkbox) SetY(y int)
- type ConfirmModal
- func (i *ConfirmModal) Clear()
- func (i *ConfirmModal) Draw()
- func (i *ConfirmModal) GetBgColor() termbox.Attribute
- func (i *ConfirmModal) GetFgColor() termbox.Attribute
- func (i *ConfirmModal) GetHeight() int
- func (i *ConfirmModal) GetID() string
- func (i *ConfirmModal) GetText() string
- func (i *ConfirmModal) GetTitle() string
- func (i *ConfirmModal) GetWidth() int
- func (i *ConfirmModal) GetX() int
- func (i *ConfirmModal) GetY() int
- func (i *ConfirmModal) HandleEvent(event termbox.Event) bool
- func (i *ConfirmModal) HelpIsShown() bool
- func (i *ConfirmModal) Hide()
- func (i *ConfirmModal) IsAccepted() bool
- func (i *ConfirmModal) IsBordered() bool
- func (i *ConfirmModal) IsDone() bool
- func (i *ConfirmModal) IsTabSkipped() bool
- func (i *ConfirmModal) SetBgColor(bg termbox.Attribute)
- func (i *ConfirmModal) SetBordered(b bool)
- func (i *ConfirmModal) SetDone(b bool)
- func (i *ConfirmModal) SetFgColor(fg termbox.Attribute)
- func (i *ConfirmModal) SetHeight(height int)
- func (i *ConfirmModal) SetID(newID string)
- func (i *ConfirmModal) SetTabSkip(b bool)
- func (i *ConfirmModal) SetText(s string)
- func (i *ConfirmModal) SetTitle(s string)
- func (i *ConfirmModal) SetWidth(width int)
- func (i *ConfirmModal) SetX(x int)
- func (i *ConfirmModal) SetY(y int)
- func (i *ConfirmModal) Show()
- func (i *ConfirmModal) ShowHelp(b bool)
- type DropMenu
- func (c *DropMenu) Draw()
- func (c *DropMenu) GetBgColor() termbox.Attribute
- func (c *DropMenu) GetFgColor() termbox.Attribute
- func (c *DropMenu) GetHeight() int
- func (c *DropMenu) GetID() string
- func (c *DropMenu) GetMenu() *Menu
- func (c *DropMenu) GetTitle() string
- func (c *DropMenu) GetWidth() int
- func (c *DropMenu) GetX() int
- func (c *DropMenu) GetY() int
- func (c *DropMenu) HandleEvent(event termbox.Event) bool
- func (c *DropMenu) HideMenu()
- func (c *DropMenu) IsActive() bool
- func (c *DropMenu) IsBordered() bool
- func (c *DropMenu) IsDone() bool
- func (c *DropMenu) IsTabSkipped() bool
- func (c *DropMenu) SetActive(a bool)
- func (c *DropMenu) SetActiveBgColor(bg termbox.Attribute)
- func (c *DropMenu) SetActiveFgColor(fg termbox.Attribute)
- func (c *DropMenu) SetBgColor(bg termbox.Attribute)
- func (c *DropMenu) SetBordered(b bool)
- func (c *DropMenu) SetDone(b bool)
- func (c *DropMenu) SetFgColor(fg termbox.Attribute)
- func (c *DropMenu) SetHeight(height int)
- func (c *DropMenu) SetID(newID string)
- func (c *DropMenu) SetTabSkip(b bool)
- func (c *DropMenu) SetTitle(s string)
- func (c *DropMenu) SetWidth(width int)
- func (c *DropMenu) SetX(x int)
- func (c *DropMenu) SetY(y int)
- func (c *DropMenu) ShowMenu()
- type Frame
- func (c *Frame) AddControl(t termboxControl)
- func (c *Frame) Draw()
- func (c *Frame) DrawControl(t termboxControl)
- func (c *Frame) FindNextTabStop() bool
- func (c *Frame) GetActiveControl() termboxControl
- func (c *Frame) GetBgColor() termbox.Attribute
- func (c *Frame) GetBottomY() int
- func (c *Frame) GetControl(idx int) termboxControl
- func (c *Frame) GetControlCount() int
- func (c *Frame) GetControls() []termboxControl
- func (c *Frame) GetFgColor() termbox.Attribute
- func (c *Frame) GetHeight() int
- func (c *Frame) GetID() string
- func (c *Frame) GetLastControl() termboxControl
- func (c *Frame) GetWidth() int
- func (c *Frame) GetX() int
- func (c *Frame) GetY() int
- func (c *Frame) HandleEvent(event termbox.Event) bool
- func (c *Frame) IsActive() bool
- func (c *Frame) IsBordered() bool
- func (c *Frame) IsOnLastControl() bool
- func (c *Frame) IsTabSkipped() bool
- func (c *Frame) RemoveAllControls()
- func (c *Frame) ResetTabIndex()
- func (c *Frame) SetActive(a bool)
- func (c *Frame) SetActiveBgColor(bg termbox.Attribute)
- func (c *Frame) SetActiveFgColor(fg termbox.Attribute)
- func (c *Frame) SetBgColor(bg termbox.Attribute)
- func (c *Frame) SetBordered(b bool)
- func (c *Frame) SetFgColor(fg termbox.Attribute)
- func (c *Frame) SetHeight(h int)
- func (c *Frame) SetID(newID string)
- func (c *Frame) SetStatus(status string)
- func (c *Frame) SetTabSkip(b bool)
- func (c *Frame) SetTitle(title string)
- func (c *Frame) SetWidth(w int)
- func (c *Frame) SetX(x int)
- func (c *Frame) SetY(y int)
- type InputField
- func (c *InputField) DoesWrap() bool
- func (c *InputField) Draw()
- func (c *InputField) GetBgColor() termbox.Attribute
- func (c *InputField) GetCursorBg() termbox.Attribute
- func (c *InputField) GetCursorFg() termbox.Attribute
- func (c *InputField) GetFgColor() termbox.Attribute
- func (c *InputField) GetHeight() int
- func (c *InputField) GetID() string
- func (c *InputField) GetValue() string
- func (c *InputField) GetWidth() int
- func (c *InputField) GetX() int
- func (c *InputField) GetY() int
- func (c *InputField) HandleEvent(event termbox.Event) bool
- func (c *InputField) InputFieldNumberFilter(fld *InputField, o, n string) string
- func (c *InputField) IsActive() bool
- func (c *InputField) IsBordered() bool
- func (c *InputField) IsMultiline() bool
- func (c *InputField) IsTabSkipped() bool
- func (c *InputField) SetActive(a bool)
- func (c *InputField) SetActiveBgColor(bg termbox.Attribute)
- func (c *InputField) SetActiveFgColor(fg termbox.Attribute)
- func (c *InputField) SetBgColor(bg termbox.Attribute)
- func (c *InputField) SetBordered(b bool)
- func (c *InputField) SetCursorBg(bg termbox.Attribute)
- func (c *InputField) SetCursorFg(fg termbox.Attribute)
- func (c *InputField) SetFgColor(fg termbox.Attribute)
- func (c *InputField) SetHeight(h int)
- func (c *InputField) SetID(newID string)
- func (c *InputField) SetJustified(b bool)
- func (c *InputField) SetMultiline(b bool)
- func (c *InputField) SetTabSkip(b bool)
- func (c *InputField) SetTextFilter(filter func(*InputField, string, string) string)
- func (c *InputField) SetTitle(title string)
- func (c *InputField) SetValue(s string)
- func (c *InputField) SetWidth(w int)
- func (c *InputField) SetWrap(b bool)
- func (c *InputField) SetX(x int)
- func (c *InputField) SetY(y int)
- type InputModal
- func (c *InputModal) Clear()
- func (c *InputModal) Draw()
- func (c *InputModal) GetBgColor() termbox.Attribute
- func (c *InputModal) GetFgColor() termbox.Attribute
- func (c *InputModal) GetHeight() int
- func (c *InputModal) GetID() string
- func (c *InputModal) GetText() string
- func (c *InputModal) GetTitle() string
- func (c *InputModal) GetValue() string
- func (c *InputModal) GetWidth() int
- func (c *InputModal) GetX() int
- func (c *InputModal) GetY() int
- func (c *InputModal) HandleEvent(event termbox.Event) bool
- func (c *InputModal) HelpIsShown() bool
- func (c *InputModal) Hide()
- func (c *InputModal) IsAccepted() bool
- func (c *InputModal) IsActive() bool
- func (c *InputModal) IsBordered() bool
- func (c *InputModal) IsDone() bool
- func (c *InputModal) IsMultiline() bool
- func (c *InputModal) IsTabSkipped() bool
- func (c *InputModal) IsVisible() bool
- func (c *InputModal) SetActive(a bool)
- func (c *InputModal) SetActiveBgColor(bg termbox.Attribute)
- func (c *InputModal) SetActiveFgColor(fg termbox.Attribute)
- func (c *InputModal) SetBgColor(bg termbox.Attribute)
- func (c *InputModal) SetBordered(b bool)
- func (c *InputModal) SetDone(b bool)
- func (c *InputModal) SetFgColor(fg termbox.Attribute)
- func (c *InputModal) SetHeight(height int)
- func (c *InputModal) SetID(newID string)
- func (c *InputModal) SetInputWrap(b bool)
- func (c *InputModal) SetMultiline(m bool)
- func (c *InputModal) SetTabSkip(b bool)
- func (c *InputModal) SetText(s string)
- func (c *InputModal) SetTitle(s string)
- func (c *InputModal) SetValue(s string)
- func (c *InputModal) SetWidth(width int)
- func (c *InputModal) SetX(x int)
- func (c *InputModal) SetY(y int)
- func (c *InputModal) Show()
- func (c *InputModal) ShowHelp(b bool)
- type Label
- func (c *Label) DoesWrap() bool
- func (c *Label) Draw()
- func (c *Label) GetBgColor() termbox.Attribute
- func (c *Label) GetFgColor() termbox.Attribute
- func (c *Label) GetHeight() int
- func (c *Label) GetID() string
- func (c *Label) GetValue() string
- func (c *Label) GetWidth() int
- func (c *Label) GetX() int
- func (c *Label) GetY() int
- func (c *Label) HandleEvent(event termbox.Event) bool
- func (c *Label) IsActive() bool
- func (c *Label) IsBordered() bool
- func (c *Label) IsMultiline() bool
- func (c *Label) IsTabSkipped() bool
- func (c *Label) SetActive(a bool)
- func (c *Label) SetActiveBgColor(bg termbox.Attribute)
- func (c *Label) SetActiveFgColor(fg termbox.Attribute)
- func (c *Label) SetBgColor(bg termbox.Attribute)
- func (c *Label) SetBordered(b bool)
- func (c *Label) SetFgColor(fg termbox.Attribute)
- func (c *Label) SetHeight(h int)
- func (c *Label) SetID(newID string)
- func (c *Label) SetMultiline(b bool)
- func (c *Label) SetTabSkip(b bool)
- func (c *Label) SetValue(s string)
- func (c *Label) SetWidth(w int)
- func (c *Label) SetWrap(b bool)
- func (c *Label) SetX(x int)
- func (c *Label) SetY(y int)
- type Menu
- func (c *Menu) DisableVimMode()
- func (c *Menu) Draw()
- func (c *Menu) EnableVimMode()
- func (c *Menu) GetBgColor() termbox.Attribute
- func (c *Menu) GetDisabledBgColor() termbox.Attribute
- func (c *Menu) GetDisabledFgColor() termbox.Attribute
- func (c *Menu) GetFgColor() termbox.Attribute
- func (c *Menu) GetHeight() int
- func (c *Menu) GetID() string
- func (c *Menu) GetOptionFromIndex(idx int) *MenuOption
- func (c *Menu) GetOptionFromText(v string) *MenuOption
- func (c *Menu) GetOptions() []MenuOption
- func (c *Menu) GetSelectedBgColor() termbox.Attribute
- func (c *Menu) GetSelectedDisabledBgColor() termbox.Attribute
- func (c *Menu) GetSelectedDisabledFgColor() termbox.Attribute
- func (c *Menu) GetSelectedFgColor() termbox.Attribute
- func (c *Menu) GetSelectedIndex() int
- func (c *Menu) GetSelectedOption() *MenuOption
- func (c *Menu) GetTitle() string
- func (c *Menu) GetWidth() int
- func (c *Menu) GetX() int
- func (c *Menu) GetY() int
- func (c *Menu) HandleEvent(event termbox.Event) bool
- func (c *Menu) HelpIsShown() bool
- func (c *Menu) IsActive() bool
- func (c *Menu) IsBordered() bool
- func (c *Menu) IsDone() bool
- func (c *Menu) IsTabSkipped() bool
- func (c *Menu) SelectFirstOption()
- func (c *Menu) SelectLastOption()
- func (c *Menu) SelectNextOption()
- func (c *Menu) SelectPageDownOption()
- func (c *Menu) SelectPageUpOption()
- func (c *Menu) SelectPrevOption()
- func (c *Menu) SetActive(a bool)
- func (c *Menu) SetActiveBgColor(bg termbox.Attribute)
- func (c *Menu) SetActiveFgColor(fg termbox.Attribute)
- func (c *Menu) SetBgColor(bg termbox.Attribute)
- func (c *Menu) SetBordered(b bool)
- func (c *Menu) SetCanSelectDisabled(b bool)
- func (c *Menu) SetDisabledBgColor(bg termbox.Attribute)
- func (c *Menu) SetDisabledFgColor(fg termbox.Attribute)
- func (c *Menu) SetDone(b bool)
- func (c *Menu) SetFgColor(fg termbox.Attribute)
- func (c *Menu) SetHeight(height int)
- func (c *Menu) SetID(newID string)
- func (c *Menu) SetOptionDisabled(idx int)
- func (c *Menu) SetOptionEnabled(idx int)
- func (c *Menu) SetOptions(opts []MenuOption)
- func (c *Menu) SetOptionsFromStrings(opts []string)
- func (c *Menu) SetSelectedBgColor(bg termbox.Attribute)
- func (c *Menu) SetSelectedDisabledBgColor(bg termbox.Attribute)
- func (c *Menu) SetSelectedDisabledFgColor(fg termbox.Attribute)
- func (c *Menu) SetSelectedFgColor(fg termbox.Attribute)
- func (c *Menu) SetSelectedIndex(idx int)
- func (c *Menu) SetSelectedOption(v *MenuOption)
- func (c *Menu) SetTabSkip(b bool)
- func (c *Menu) SetTitle(s string)
- func (c *Menu) SetWidth(width int)
- func (c *Menu) SetX(x int)
- func (c *Menu) SetY(y int)
- func (c *Menu) ShowHelp(b bool)
- type MenuOption
- func (c *MenuOption) AddToSubMenu(sub *MenuOption)
- func (c *MenuOption) Disable()
- func (c *MenuOption) Enable()
- func (c *MenuOption) GetHelpText() string
- func (c *MenuOption) GetText() string
- func (c *MenuOption) IsDisabled() bool
- func (c *MenuOption) IsSelected() bool
- func (c *MenuOption) Select()
- func (c *MenuOption) SetHelpText(s string)
- func (c *MenuOption) SetText(s string)
- func (c *MenuOption) Unselect()
- type ProgressBar
- func (c *ProgressBar) Align(a TextAlignment)
- func (c *ProgressBar) DecrProgress()
- func (c *ProgressBar) DisableOverflow()
- func (c *ProgressBar) DisableUnderflow()
- func (c *ProgressBar) Draw()
- func (c *ProgressBar) EnableOverflow()
- func (c *ProgressBar) EnableUnderflow()
- func (c *ProgressBar) GetBgColor() termbox.Attribute
- func (c *ProgressBar) GetEmptyChar() rune
- func (c *ProgressBar) GetFgColor() termbox.Attribute
- func (c *ProgressBar) GetFullChar() rune
- func (c *ProgressBar) GetHeight() int
- func (c *ProgressBar) GetID() string
- func (c *ProgressBar) GetPercent() int
- func (c *ProgressBar) GetProgress() int
- func (c *ProgressBar) GetWidth() int
- func (c *ProgressBar) GetX() int
- func (c *ProgressBar) GetY() int
- func (c *ProgressBar) HandleEvent(event termbox.Event) bool
- func (c *ProgressBar) IncrProgress()
- func (c *ProgressBar) IsActive() bool
- func (c *ProgressBar) SetActive(a bool)
- func (c *ProgressBar) SetActiveBgColor(bg termbox.Attribute)
- func (c *ProgressBar) SetActiveFgColor(fg termbox.Attribute)
- func (c *ProgressBar) SetBgColor(bg termbox.Attribute)
- func (c *ProgressBar) SetColorized(color bool)
- func (c *ProgressBar) SetEmptyChar(f rune)
- func (c *ProgressBar) SetFgColor(fg termbox.Attribute)
- func (c *ProgressBar) SetFullChar(f rune)
- func (c *ProgressBar) SetHeight(h int)
- func (c *ProgressBar) SetID(newID string)
- func (c *ProgressBar) SetProgress(p int)
- func (c *ProgressBar) SetWidth(w int)
- func (c *ProgressBar) SetX(x int)
- func (c *ProgressBar) SetY(y int)
- type ScrollFrame
- func (c *ScrollFrame) AddControl(t termboxControl)
- func (c *ScrollFrame) Draw()
- func (c *ScrollFrame) DrawControl(t termboxControl)
- func (c *ScrollFrame) DrawToStrings() []string
- func (c *ScrollFrame) GetBgColor() termbox.Attribute
- func (c *ScrollFrame) GetFgColor() termbox.Attribute
- func (c *ScrollFrame) GetHeight() int
- func (c *ScrollFrame) GetID() string
- func (c *ScrollFrame) GetScrollX() int
- func (c *ScrollFrame) GetScrollY() int
- func (c *ScrollFrame) GetWidth() int
- func (c *ScrollFrame) GetX() int
- func (c *ScrollFrame) GetY() int
- func (c *ScrollFrame) HandleEvent(event termbox.Event) bool
- func (c *ScrollFrame) IsBordered() bool
- func (c *ScrollFrame) IsVisible(t termboxControl) bool
- func (c *ScrollFrame) ScrollDown()
- func (c *ScrollFrame) ScrollLeft()
- func (c *ScrollFrame) ScrollRight()
- func (c *ScrollFrame) ScrollUp()
- func (c *ScrollFrame) SetBgColor(bg termbox.Attribute)
- func (c *ScrollFrame) SetBordered(b bool)
- func (c *ScrollFrame) SetFgColor(fg termbox.Attribute)
- func (c *ScrollFrame) SetHeight(h int)
- func (c *ScrollFrame) SetID(newID string)
- func (c *ScrollFrame) SetWidth(w int)
- func (c *ScrollFrame) SetX(x int)
- func (c *ScrollFrame) SetY(y int)
- type TextAlignment
Constants ¶
const ( // AlignLeft Aligns text to the left AlignLeft = iota // AlignCenter Aligns text to the center AlignCenter // AlignRight Aligns text to the right AlignRight )
Variables ¶
This section is empty.
Functions ¶
func AlignText ¶
func AlignText(txt string, width int, align TextAlignment) string
AlignText Aligns the text txt within width characters using the specified alignment
func AlignTextWithFill ¶
func AlignTextWithFill(txt string, width int, align TextAlignment, fill rune) string
AlignTextWithFill Aligns the text txt within width characters using the specified alignment filling any spaces with the 'fill' character
func DrawBorder ¶
func DrawBorder(x1, y1, x2, y2 int, fg, bg termbox.Attribute)
DrawBorder Draw a border around the area inside x1,y1 -> x2, y2
func DrawBorderWithPct ¶
func DrawBorderWithTitle ¶
func DrawStringAtPoint ¶
func DrawStringAtPoint(str string, x int, y int, fg termbox.Attribute, bg termbox.Attribute) (int, int)
DrawStringAtPoint Draw a string of text at x, y with foreground color fg, background color bg
func FillWithChar ¶
FillWithChar Fills from x1,y1 through x2,y2 with the rune r, foreground color fg, background bg
func KeyIsAlpha ¶
func KeyIsAlpha(event termbox.Event) bool
KeyIsAlpha Returns whether the termbox event is a alphabetic Key press
func KeyIsAlphaNumeric ¶
func KeyIsAlphaNumeric(event termbox.Event) bool
KeyIsAlphaNumeric Returns whether the termbox event is an Alpha-Numeric Key Press
func KeyIsNumeric ¶
func KeyIsNumeric(event termbox.Event) bool
KeyIsNumeric Returns whether the termbox event is a numeric Key press
func KeyIsSymbol ¶
func KeyIsSymbol(event termbox.Event) bool
KeyIsSymbol Returns whether the termbox event is a symbol Key press
Types ¶
type ASCIIArt ¶
type ASCIIArt struct {
// contains filtered or unexported fields
}
ASCIIArt is a []string with more functions
func CreateASCIIArt ¶
CreateASCIIArt Create an ASCII art object from a string slice
func (*ASCIIArt) Align ¶
func (i *ASCIIArt) Align(a TextAlignment, width int)
Align Align the Ascii art over width width with alignment a
func (*ASCIIArt) GetBgColor ¶
func (i *ASCIIArt) GetBgColor() termbox.Attribute
GetBgColor returns the background color
func (*ASCIIArt) GetContents ¶
GetContents returns the ascii art
func (*ASCIIArt) GetFgColor ¶
func (i *ASCIIArt) GetFgColor() termbox.Attribute
GetFgColor returns the foreground color
func (*ASCIIArt) HandleEvent ¶
HandleEvent accepts the termbox event and returns whether it was consumed
func (*ASCIIArt) IsBordered ¶
IsBordered returns whether this modal is bordered or not
func (*ASCIIArt) IsTabSkipped ¶
IsTabSkipped returns whether this modal has it's tabskip flag set
func (*ASCIIArt) SetActiveBgColor ¶
func (i *ASCIIArt) SetActiveBgColor(bg termbox.Attribute)
func (*ASCIIArt) SetActiveFgColor ¶
func (i *ASCIIArt) SetActiveFgColor(fg termbox.Attribute)
func (*ASCIIArt) SetBgColor ¶
func (i *ASCIIArt) SetBgColor(bg termbox.Attribute)
SetBgColor sets the current background color
func (*ASCIIArt) SetBordered ¶
SetBordered sets whether we render a border around the frame
func (*ASCIIArt) SetContentLine ¶
SetContentLine Sets a specific line of the contents to s
func (*ASCIIArt) SetContents ¶
SetContents Sets the contents of i to c
func (*ASCIIArt) SetFgColor ¶
func (i *ASCIIArt) SetFgColor(fg termbox.Attribute)
SetFgColor sets the foreground color
func (*ASCIIArt) SetTabSkip ¶
SetTabSkip sets the tabskip flag for this control
type AlertModal ¶
type AlertModal struct {
// contains filtered or unexported fields
}
AlertModal is a modal with yes/no (or similar) buttons
func CreateAlertModal ¶
func CreateAlertModal(title string, x, y, width, height int, fg, bg termbox.Attribute) *AlertModal
CreateAlertModal Creates a confirmation modal with the specified attributes
func (*AlertModal) Clear ¶
func (i *AlertModal) Clear()
Clear clears all of the non-positional parameters of the modal
func (*AlertModal) GetBackground ¶
func (i *AlertModal) GetBackground() termbox.Attribute
GetBackground returns the current background color
func (*AlertModal) GetBgColor ¶
func (i *AlertModal) GetBgColor() termbox.Attribute
GetBgColor returns the background color
func (*AlertModal) GetFgColor ¶
func (i *AlertModal) GetFgColor() termbox.Attribute
GetFgColor returns the foreground color
func (*AlertModal) GetForeground ¶
func (i *AlertModal) GetForeground() termbox.Attribute
GetForeground returns the current foreground color
func (*AlertModal) GetHeight ¶
func (i *AlertModal) GetHeight() int
GetHeight returns the current height of the control
func (*AlertModal) GetText ¶
func (i *AlertModal) GetText() string
GetText returns the current text of the modal
func (*AlertModal) GetTitle ¶
func (i *AlertModal) GetTitle() string
GetTitle returns the current title of the modal
func (*AlertModal) GetWidth ¶
func (i *AlertModal) GetWidth() int
GetWidth returns the current width of the control
func (*AlertModal) GetX ¶
func (i *AlertModal) GetX() int
GetX returns the current x coordinate of the control
func (*AlertModal) GetY ¶
func (i *AlertModal) GetY() int
GetY returns the current y coordinate of the control
func (*AlertModal) HandleEvent ¶
func (i *AlertModal) HandleEvent(event termbox.Event) bool
HandleEvent handles the termbox event and returns whether it was consumed
func (*AlertModal) HelpIsShown ¶
func (i *AlertModal) HelpIsShown() bool
HelpIsShown returns true or false if the help is displayed
func (*AlertModal) Hide ¶
func (i *AlertModal) Hide()
Hide sets the visibility flag of the modal to false
func (*AlertModal) IsAccepted ¶
func (i *AlertModal) IsAccepted() bool
IsAccepted returns whether the user accepted the modal
func (*AlertModal) IsActive ¶
func (i *AlertModal) IsActive() bool
func (*AlertModal) IsBordered ¶
func (i *AlertModal) IsBordered() bool
IsBordered returns whether this control is bordered or not
func (*AlertModal) IsDone ¶
func (i *AlertModal) IsDone() bool
IsDone returns whether the user has answered the modal
func (*AlertModal) IsTabSkipped ¶
func (i *AlertModal) IsTabSkipped() bool
IsTabSkipped returns whether this control has it's tabskip flag set
func (*AlertModal) SetActive ¶
func (i *AlertModal) SetActive(a bool)
func (*AlertModal) SetActiveBgColor ¶
func (i *AlertModal) SetActiveBgColor(bg termbox.Attribute)
func (*AlertModal) SetActiveFgColor ¶
func (i *AlertModal) SetActiveFgColor(fg termbox.Attribute)
func (*AlertModal) SetBackground ¶
func (i *AlertModal) SetBackground(bg termbox.Attribute)
SetBackground sets the background color to bg
func (*AlertModal) SetBgColor ¶
func (i *AlertModal) SetBgColor(bg termbox.Attribute)
SetBgColor sets the current background color
func (*AlertModal) SetBordered ¶
func (i *AlertModal) SetBordered(b bool)
SetBordered sets whether we render a border around the frame
func (*AlertModal) SetDone ¶
func (i *AlertModal) SetDone(b bool)
SetDone sets whether the modal has completed it's purpose
func (*AlertModal) SetFgColor ¶
func (i *AlertModal) SetFgColor(fg termbox.Attribute)
SetFgColor sets the foreground color
func (*AlertModal) SetForeground ¶
func (i *AlertModal) SetForeground(fg termbox.Attribute)
SetForeground sets the current foreground color to fg
func (*AlertModal) SetHeight ¶
func (i *AlertModal) SetHeight(height int)
SetHeight set the height of the control to height
func (*AlertModal) SetTabSkip ¶
func (i *AlertModal) SetTabSkip(b bool)
SetTabSkip sets the tabskip flag for this control
func (*AlertModal) SetText ¶
func (i *AlertModal) SetText(s string)
SetText sets the text of the modal to s
func (*AlertModal) SetTitle ¶
func (i *AlertModal) SetTitle(s string)
SetTitle sets the current title of the modal to s
func (*AlertModal) SetWidth ¶
func (i *AlertModal) SetWidth(width int)
SetWidth sets the current control width to width
func (*AlertModal) SetX ¶
func (i *AlertModal) SetX(x int)
SetX sets the current x coordinate of the control to x
func (*AlertModal) SetY ¶
func (i *AlertModal) SetY(y int)
SetY sets the current y coordinate of the control to y
func (*AlertModal) Show ¶
func (i *AlertModal) Show()
Show sets the visibility flag of the modal to true
func (*AlertModal) ShowHelp ¶
func (i *AlertModal) ShowHelp(b bool)
ShowHelp sets whether or not to display the help text
type Button ¶
type Button struct {
// contains filtered or unexported fields
}
func (*Button) GetBgColor ¶
func (*Button) GetFgColor ¶
func (*Button) IsBordered ¶
func (*Button) IsTabSkipped ¶
func (*Button) SetActiveBgColor ¶
func (*Button) SetActiveFgColor ¶
func (*Button) SetBgColor ¶
func (*Button) SetBordered ¶
func (*Button) SetFgColor ¶
func (*Button) SetTabSkip ¶
type Checkbox ¶
type Checkbox struct {
// contains filtered or unexported fields
}
func CreateCheckbox ¶
func (*Checkbox) GetBgColor ¶
GetBgColor returns the background color
func (*Checkbox) GetFgColor ¶
GetFgColor returns the foreground color
func (*Checkbox) HandleEvent ¶
HandleEvent accepts the termbox event and returns whether it was consumed
func (*Checkbox) IsBordered ¶
IsBordered returns true or false if this input field has a border
func (*Checkbox) IsTabSkipped ¶
IsTabSkipped returns whether this modal has it's tabskip flag set
func (*Checkbox) SetActiveBgColor ¶
func (*Checkbox) SetActiveFgColor ¶
func (*Checkbox) SetBgColor ¶
SetBgColor sets the current background color
func (*Checkbox) SetBordered ¶
SetBordered sets whether we render a border around the input field
func (*Checkbox) SetFgColor ¶
SetFgColor sets the foreground color
func (*Checkbox) SetTabSkip ¶
SetTabSkip sets the tabskip flag for this control
type ConfirmModal ¶
type ConfirmModal struct {
// contains filtered or unexported fields
}
ConfirmModal is a modal with yes/no (or similar) buttons
func CreateConfirmModal ¶
func CreateConfirmModal(title string, x, y, width, height int, fg, bg termbox.Attribute) *ConfirmModal
CreateConfirmModal Creates a confirmation modal with the specified attributes
func (*ConfirmModal) Clear ¶
func (i *ConfirmModal) Clear()
Clear clears all of the non-positional parameters of the modal
func (*ConfirmModal) GetBgColor ¶
func (i *ConfirmModal) GetBgColor() termbox.Attribute
GetBgColor returns the background color
func (*ConfirmModal) GetFgColor ¶
func (i *ConfirmModal) GetFgColor() termbox.Attribute
GetFgColor returns the foreground color
func (*ConfirmModal) GetHeight ¶
func (i *ConfirmModal) GetHeight() int
GetHeight returns the current height of the modal
func (*ConfirmModal) GetText ¶
func (i *ConfirmModal) GetText() string
GetText returns the current text of the modal
func (*ConfirmModal) GetTitle ¶
func (i *ConfirmModal) GetTitle() string
GetTitle returns the current title of the modal
func (*ConfirmModal) GetWidth ¶
func (i *ConfirmModal) GetWidth() int
GetWidth returns the current width of the modal
func (*ConfirmModal) GetX ¶
func (i *ConfirmModal) GetX() int
GetX returns the current x coordinate of the modal
func (*ConfirmModal) GetY ¶
func (i *ConfirmModal) GetY() int
GetY returns the current y coordinate of the modal
func (*ConfirmModal) HandleEvent ¶
func (i *ConfirmModal) HandleEvent(event termbox.Event) bool
HandleEvent handles the termbox event and returns whether it was consumed
func (*ConfirmModal) HelpIsShown ¶
func (i *ConfirmModal) HelpIsShown() bool
HelpIsShown returns true or false if the help is displayed
func (*ConfirmModal) Hide ¶
func (i *ConfirmModal) Hide()
Hide sets the visibility flag of the modal to false
func (*ConfirmModal) IsAccepted ¶
func (i *ConfirmModal) IsAccepted() bool
IsAccepted returns whether the user accepted the modal
func (*ConfirmModal) IsBordered ¶
func (i *ConfirmModal) IsBordered() bool
IsBordered returns whether this modal is bordered or not
func (*ConfirmModal) IsDone ¶
func (i *ConfirmModal) IsDone() bool
IsDone returns whether the user has answered the modal
func (*ConfirmModal) IsTabSkipped ¶
func (i *ConfirmModal) IsTabSkipped() bool
IsTabSkipped returns whether this modal has it's tabskip flag set
func (*ConfirmModal) SetBgColor ¶
func (i *ConfirmModal) SetBgColor(bg termbox.Attribute)
SetBgColor sets the current background color
func (*ConfirmModal) SetBordered ¶
func (i *ConfirmModal) SetBordered(b bool)
SetBordered sets whether we render a border around the frame
func (*ConfirmModal) SetDone ¶
func (i *ConfirmModal) SetDone(b bool)
SetDone sets whether the modal has completed it's purpose
func (*ConfirmModal) SetFgColor ¶
func (i *ConfirmModal) SetFgColor(fg termbox.Attribute)
SetFgColor sets the foreground color
func (*ConfirmModal) SetHeight ¶
func (i *ConfirmModal) SetHeight(height int)
SetHeight set the height of the modal to height
func (*ConfirmModal) SetID ¶
func (i *ConfirmModal) SetID(newID string)
SetID sets this control's ID
func (*ConfirmModal) SetTabSkip ¶
func (i *ConfirmModal) SetTabSkip(b bool)
SetTabSkip sets the tabskip flag for this control
func (*ConfirmModal) SetText ¶
func (i *ConfirmModal) SetText(s string)
SetText sets the text of the modal to s
func (*ConfirmModal) SetTitle ¶
func (i *ConfirmModal) SetTitle(s string)
SetTitle sets the current title of the modal to s
func (*ConfirmModal) SetWidth ¶
func (i *ConfirmModal) SetWidth(width int)
SetWidth sets the current modal width to width
func (*ConfirmModal) SetX ¶
func (i *ConfirmModal) SetX(x int)
SetX sets the current x coordinate of the modal to x
func (*ConfirmModal) SetY ¶
func (i *ConfirmModal) SetY(y int)
SetY sets the current y coordinate of the modal to y
func (*ConfirmModal) Show ¶
func (i *ConfirmModal) Show()
Show sets the visibility flag of the modal to true
func (*ConfirmModal) ShowHelp ¶
func (i *ConfirmModal) ShowHelp(b bool)
ShowHelp sets whether or not to display the help text
type DropMenu ¶
type DropMenu struct {
// contains filtered or unexported fields
}
DropMenu is a title that, when active drops a menu down
func CreateDropMenu ¶
func CreateDropMenu(title string, options []string, x, y, width, height int, fg, bg, cursorFg, cursorBg termbox.Attribute) *DropMenu
CreateDropMenu Creates a menu with the specified attributes
func (*DropMenu) GetBgColor ¶
func (c *DropMenu) GetBgColor() termbox.Attribute
GetBgColor returns the background color
func (*DropMenu) GetFgColor ¶
func (c *DropMenu) GetFgColor() termbox.Attribute
GetFgColor returns the foreground color
func (*DropMenu) HandleEvent ¶
HandleEvent handles the termbox event and returns whether it was consumed
func (*DropMenu) HideMenu ¶
func (c *DropMenu) HideMenu()
HideMenu tells the menu to hide the options
func (*DropMenu) IsBordered ¶
IsBordered returns the bordered flag
func (*DropMenu) IsTabSkipped ¶
IsTabSkipped returns whether this modal has it's tabskip flag set
func (*DropMenu) SetActiveBgColor ¶
func (c *DropMenu) SetActiveBgColor(bg termbox.Attribute)
func (*DropMenu) SetActiveFgColor ¶
func (c *DropMenu) SetActiveFgColor(fg termbox.Attribute)
func (*DropMenu) SetBgColor ¶
func (c *DropMenu) SetBgColor(bg termbox.Attribute)
SetBgColor sets the current background color
func (*DropMenu) SetBordered ¶
SetBordered sets the bordered flag
func (*DropMenu) SetFgColor ¶
func (c *DropMenu) SetFgColor(fg termbox.Attribute)
SetFgColor sets the foreground color
func (*DropMenu) SetTabSkip ¶
SetTabSkip sets the tabskip flag for this control
type Frame ¶
type Frame struct {
// contains filtered or unexported fields
}
Frame is a frame for holding other elements It manages it's own x/y, tab index
func CreateFrame ¶
CreateFrame creates a Frame at x, y that is w by h
func (*Frame) AddControl ¶
func (c *Frame) AddControl(t termboxControl)
AddControl adds a control to the frame
func (*Frame) DrawControl ¶
func (c *Frame) DrawControl(t termboxControl)
DrawControl figures out the relative position of the control, sets it, draws it, then resets it.
func (*Frame) FindNextTabStop ¶
FindNextTabStop finds the next control that can be tabbed to A return of true means it found a different one than we started on.
func (*Frame) GetActiveControl ¶
func (c *Frame) GetActiveControl() termboxControl
GetActiveControl returns the control at tabIdx
func (*Frame) GetBgColor ¶
func (c *Frame) GetBgColor() termbox.Attribute
GetBgColor returns the background color
func (*Frame) GetBottomY ¶
GetBottomY returns the y of the lowest control in the frame
func (*Frame) GetControl ¶
GetControl returns the control at index i
func (*Frame) GetControlCount ¶
GetControlCount returns the number of controls contained
func (*Frame) GetControls ¶
func (c *Frame) GetControls() []termboxControl
GetControls returns a slice of all controls
func (*Frame) GetFgColor ¶
func (c *Frame) GetFgColor() termbox.Attribute
GetFgColor returns the foreground color
func (*Frame) GetLastControl ¶
func (c *Frame) GetLastControl() termboxControl
GetLastControl returns the last control contained
func (*Frame) HandleEvent ¶
HandleEvent accepts the termbox event and returns whether it was consumed
func (*Frame) IsBordered ¶
IsBordered returns true or false if this frame has a border
func (*Frame) IsOnLastControl ¶
IsOnLastControl returns true if the active control is the last control that isn't tab skippable.
func (*Frame) IsTabSkipped ¶
IsTabSkipped returns whether this modal has it's tabskip flag set
func (*Frame) RemoveAllControls ¶
func (c *Frame) RemoveAllControls()
RemoveAllControls clears the control slice
func (*Frame) ResetTabIndex ¶
func (c *Frame) ResetTabIndex()
func (*Frame) SetActiveBgColor ¶
func (c *Frame) SetActiveBgColor(bg termbox.Attribute)
func (*Frame) SetActiveFgColor ¶
func (c *Frame) SetActiveFgColor(fg termbox.Attribute)
Setting color attributes on a frame trickles down to its controls
func (*Frame) SetBgColor ¶
func (c *Frame) SetBgColor(bg termbox.Attribute)
SetBgColor sets the current background color
func (*Frame) SetBordered ¶
SetBordered sets whether we render a border around the frame
func (*Frame) SetFgColor ¶
func (c *Frame) SetFgColor(fg termbox.Attribute)
SetFgColor sets the foreground color
func (*Frame) SetTabSkip ¶
SetTabSkip sets the tabskip flag for this control
type InputField ¶
type InputField struct {
// contains filtered or unexported fields
}
InputField is a field for inputting text
func CreateInputField ¶
func CreateInputField(x, y, w, h int, fg, bg termbox.Attribute) *InputField
CreateInputField creates an input field at x, y that is w by h
func ToInputField ¶
func ToInputField(c termboxControl) (*InputField, error)
func (*InputField) DoesWrap ¶
func (c *InputField) DoesWrap() bool
DoesWrap returns true or false if this input field wraps text
func (*InputField) GetBgColor ¶
func (c *InputField) GetBgColor() termbox.Attribute
GetBgColor returns the background color
func (*InputField) GetCursorBg ¶
func (c *InputField) GetCursorBg() termbox.Attribute
func (*InputField) GetCursorFg ¶
func (c *InputField) GetCursorFg() termbox.Attribute
func (*InputField) GetFgColor ¶
func (c *InputField) GetFgColor() termbox.Attribute
GetFgColor returns the foreground color
func (*InputField) GetHeight ¶
func (c *InputField) GetHeight() int
GetHeight returns the current height of the input field
func (*InputField) GetValue ¶
func (c *InputField) GetValue() string
GetValue gets the current text that is in the InputField
func (*InputField) GetWidth ¶
func (c *InputField) GetWidth() int
GetWidth returns the current width of the input field
func (*InputField) GetX ¶
func (c *InputField) GetX() int
GetX returns the x position of the input field
func (*InputField) GetY ¶
func (c *InputField) GetY() int
GetY returns the y position of the input field
func (*InputField) HandleEvent ¶
func (c *InputField) HandleEvent(event termbox.Event) bool
HandleEvent accepts the termbox event and returns whether it was consumed
func (*InputField) InputFieldNumberFilter ¶
func (c *InputField) InputFieldNumberFilter(fld *InputField, o, n string) string
Some handy text filters
func (*InputField) IsActive ¶
func (c *InputField) IsActive() bool
func (*InputField) IsBordered ¶
func (c *InputField) IsBordered() bool
IsBordered returns true or false if this input field has a border
func (*InputField) IsMultiline ¶
func (c *InputField) IsMultiline() bool
IsMultiline returns true or false if this field can have multiple lines
func (*InputField) IsTabSkipped ¶
func (c *InputField) IsTabSkipped() bool
IsTabSkipped returns whether this modal has it's tabskip flag set
func (*InputField) SetActive ¶
func (c *InputField) SetActive(a bool)
func (*InputField) SetActiveBgColor ¶
func (c *InputField) SetActiveBgColor(bg termbox.Attribute)
func (*InputField) SetActiveFgColor ¶
func (c *InputField) SetActiveFgColor(fg termbox.Attribute)
func (*InputField) SetBgColor ¶
func (c *InputField) SetBgColor(bg termbox.Attribute)
SetBgColor sets the current background color
func (*InputField) SetBordered ¶
func (c *InputField) SetBordered(b bool)
SetBordered sets whether we render a border around the input field
func (*InputField) SetCursorBg ¶
func (c *InputField) SetCursorBg(bg termbox.Attribute)
func (*InputField) SetCursorFg ¶
func (c *InputField) SetCursorFg(fg termbox.Attribute)
func (*InputField) SetFgColor ¶
func (c *InputField) SetFgColor(fg termbox.Attribute)
SetFgColor sets the foreground color
func (*InputField) SetHeight ¶
func (c *InputField) SetHeight(h int)
SetHeight sets the current height of the input field
func (*InputField) SetJustified ¶
func (c *InputField) SetJustified(b bool)
func (*InputField) SetMultiline ¶
func (c *InputField) SetMultiline(b bool)
SetMultiline sets whether the field can have multiple lines
func (*InputField) SetTabSkip ¶
func (c *InputField) SetTabSkip(b bool)
SetTabSkip sets the tabskip flag for this control
func (*InputField) SetTextFilter ¶
func (c *InputField) SetTextFilter(filter func(*InputField, string, string) string)
func (*InputField) SetTitle ¶
func (c *InputField) SetTitle(title string)
func (*InputField) SetValue ¶
func (c *InputField) SetValue(s string)
SetValue sets the current text in the InputField to s
func (*InputField) SetWidth ¶
func (c *InputField) SetWidth(w int)
SetWidth sets the current width of the input field
func (*InputField) SetWrap ¶
func (c *InputField) SetWrap(b bool)
SetWrap sets whether we wrap the text at width.
func (*InputField) SetX ¶
func (c *InputField) SetX(x int)
SetX sets the x position of the input field
func (*InputField) SetY ¶
func (c *InputField) SetY(y int)
SetY sets the y position of the input field
type InputModal ¶
type InputModal struct {
// contains filtered or unexported fields
}
InputModal A modal for text input
func CreateInputModal ¶
func CreateInputModal(title string, x, y, width, height int, fg, bg termbox.Attribute) *InputModal
CreateInputModal Create an input modal with the given attributes
func (*InputModal) Clear ¶
func (c *InputModal) Clear()
Clear Resets all non-positional parameters of the modal
func (*InputModal) GetBgColor ¶
func (c *InputModal) GetBgColor() termbox.Attribute
GetBgColor returns the background color
func (*InputModal) GetFgColor ¶
func (c *InputModal) GetFgColor() termbox.Attribute
GetFgColor returns the foreground color
func (*InputModal) GetHeight ¶
func (c *InputModal) GetHeight() int
GetHeight Return the height of the modal
func (*InputModal) GetText ¶
func (c *InputModal) GetText() string
GetText Return the text of the modal
func (*InputModal) GetTitle ¶
func (c *InputModal) GetTitle() string
GetTitle Return the title of the modal
func (*InputModal) GetValue ¶
func (c *InputModal) GetValue() string
GetValue Return the current value of the input
func (*InputModal) GetWidth ¶
func (c *InputModal) GetWidth() int
GetWidth Return the width of the modal
func (*InputModal) HandleEvent ¶
func (c *InputModal) HandleEvent(event termbox.Event) bool
HandleEvent Handle the termbox event, return true if it was consumed
func (*InputModal) HelpIsShown ¶
func (c *InputModal) HelpIsShown() bool
HelpIsShown Returns whether the modal is showing it's help text or not
func (*InputModal) IsAccepted ¶
func (c *InputModal) IsAccepted() bool
IsAccepted Returns whether the modal has been accepted
func (*InputModal) IsActive ¶
func (c *InputModal) IsActive() bool
func (*InputModal) IsBordered ¶
func (c *InputModal) IsBordered() bool
IsBordered returns whether this control is bordered or not
func (*InputModal) IsMultiline ¶
func (c *InputModal) IsMultiline() bool
IsMultiline returns whether this is a multiline modal
func (*InputModal) IsTabSkipped ¶
func (c *InputModal) IsTabSkipped() bool
IsTabSkipped returns whether this control has it's tabskip flag set
func (*InputModal) IsVisible ¶
func (c *InputModal) IsVisible() bool
IsVisible returns the isVisible flag
func (*InputModal) SetActive ¶
func (c *InputModal) SetActive(a bool)
func (*InputModal) SetActiveBgColor ¶
func (c *InputModal) SetActiveBgColor(bg termbox.Attribute)
func (*InputModal) SetActiveFgColor ¶
func (c *InputModal) SetActiveFgColor(fg termbox.Attribute)
func (*InputModal) SetBgColor ¶
func (c *InputModal) SetBgColor(bg termbox.Attribute)
SetBgColor sets the current background color
func (*InputModal) SetBordered ¶
func (c *InputModal) SetBordered(b bool)
SetBordered sets whether we render a border around the frame
func (*InputModal) SetDone ¶
func (c *InputModal) SetDone(b bool)
SetDone Sets the flag that tells whether this modal has completed it's purpose
func (*InputModal) SetFgColor ¶
func (c *InputModal) SetFgColor(fg termbox.Attribute)
SetFgColor sets the foreground color
func (*InputModal) SetHeight ¶
func (c *InputModal) SetHeight(height int)
SetHeight Set the height of the modal to height
func (*InputModal) SetInputWrap ¶
func (c *InputModal) SetInputWrap(b bool)
SetInputWrap sets whether the input field will wrap long text or not
func (*InputModal) SetMultiline ¶
func (c *InputModal) SetMultiline(m bool)
SetMultiline returns whether this is a multiline modal
func (*InputModal) SetTabSkip ¶
func (c *InputModal) SetTabSkip(b bool)
SetTabSkip sets the tabskip flag for this control
func (*InputModal) SetText ¶
func (c *InputModal) SetText(s string)
SetText Set the text of the modal to s
func (*InputModal) SetTitle ¶
func (c *InputModal) SetTitle(s string)
SetTitle Sets the title of the modal to s
func (*InputModal) SetValue ¶
func (c *InputModal) SetValue(s string)
SetValue Sets the value of the input to s
func (*InputModal) SetWidth ¶
func (c *InputModal) SetWidth(width int)
SetWidth Set the width of the modal to width
func (*InputModal) SetX ¶
func (c *InputModal) SetX(x int)
SetX set the x position of the modal to x
func (*InputModal) SetY ¶
func (c *InputModal) SetY(y int)
SetY Set the y position of the modal to y
func (*InputModal) ShowHelp ¶
func (c *InputModal) ShowHelp(b bool)
ShowHelp Set the "Show Help" flag
type Label ¶
type Label struct {
// contains filtered or unexported fields
}
Label is a field for inputting text
func CreateLabel ¶
CreateLabel creates an input field at x, y that is w by h
func (*Label) GetBgColor ¶
func (c *Label) GetBgColor() termbox.Attribute
GetBgColor returns the background color
func (*Label) GetFgColor ¶
func (c *Label) GetFgColor() termbox.Attribute
GetFgColor returns the foreground color
func (*Label) HandleEvent ¶
HandleEvent accepts the termbox event and returns whether it was consumed
func (*Label) IsBordered ¶
IsBordered returns true or false if this input field has a border
func (*Label) IsMultiline ¶
IsMultiline returns true or false if this field can have multiple lines
func (*Label) IsTabSkipped ¶
IsTabSkipped is always true for a label
func (*Label) SetActiveBgColor ¶
func (c *Label) SetActiveBgColor(bg termbox.Attribute)
func (*Label) SetActiveFgColor ¶
func (c *Label) SetActiveFgColor(fg termbox.Attribute)
func (*Label) SetBgColor ¶
func (c *Label) SetBgColor(bg termbox.Attribute)
SetBgColor sets the current background color
func (*Label) SetBordered ¶
SetBordered sets whether we render a border around the input field
func (*Label) SetFgColor ¶
func (c *Label) SetFgColor(fg termbox.Attribute)
SetFgColor sets the foreground color
func (*Label) SetMultiline ¶
SetMultiline sets whether the field can have multiple lines
type Menu ¶
type Menu struct {
// contains filtered or unexported fields
}
Menu is a menu with a list of options
func CreateMenu ¶
func CreateMenu(title string, options []string, x, y, width, height int, fg, bg termbox.Attribute) *Menu
CreateMenu Creates a menu with the specified attributes
func (*Menu) DisableVimMode ¶
func (c *Menu) DisableVimMode()
DisableVimMode Disables h,j,k,l navigation
func (*Menu) EnableVimMode ¶
func (c *Menu) EnableVimMode()
EnableVimMode Enables h,j,k,l navigation
func (*Menu) GetBgColor ¶
func (c *Menu) GetBgColor() termbox.Attribute
func (*Menu) GetDisabledBgColor ¶
func (c *Menu) GetDisabledBgColor() termbox.Attribute
func (*Menu) GetDisabledFgColor ¶
func (c *Menu) GetDisabledFgColor() termbox.Attribute
func (*Menu) GetFgColor ¶
func (c *Menu) GetFgColor() termbox.Attribute
func (*Menu) GetOptionFromIndex ¶
func (c *Menu) GetOptionFromIndex(idx int) *MenuOption
GetOptionFromIndex Returns the
func (*Menu) GetOptionFromText ¶
func (c *Menu) GetOptionFromText(v string) *MenuOption
GetOptionFromText Returns the first option with the text v
func (*Menu) GetOptions ¶
func (c *Menu) GetOptions() []MenuOption
GetOptions returns the current options of the menu
func (*Menu) GetSelectedBgColor ¶
func (c *Menu) GetSelectedBgColor() termbox.Attribute
func (*Menu) GetSelectedDisabledBgColor ¶
func (c *Menu) GetSelectedDisabledBgColor() termbox.Attribute
func (*Menu) GetSelectedDisabledFgColor ¶
func (c *Menu) GetSelectedDisabledFgColor() termbox.Attribute
func (*Menu) GetSelectedFgColor ¶
func (c *Menu) GetSelectedFgColor() termbox.Attribute
func (*Menu) GetSelectedIndex ¶
GetSelectedIndex returns the index of the selected option Returns -1 if nothing is selected
func (*Menu) GetSelectedOption ¶
func (c *Menu) GetSelectedOption() *MenuOption
GetSelectedOption returns the current selected option
func (*Menu) HandleEvent ¶
HandleEvent handles the termbox event and returns whether it was consumed
func (*Menu) HelpIsShown ¶
HelpIsShown returns true or false if the help is displayed
func (*Menu) IsBordered ¶
IsBordered returns true or false if this menu has a border
func (*Menu) IsTabSkipped ¶
func (*Menu) SelectFirstOption ¶
func (c *Menu) SelectFirstOption()
SelectFirstOption Goes to the top
func (*Menu) SelectLastOption ¶
func (c *Menu) SelectLastOption()
SelectLastOption Goes to the bottom
func (*Menu) SelectNextOption ¶
func (c *Menu) SelectNextOption()
SelectNextOption Increments the selected option (if it can)
func (*Menu) SelectPageDownOption ¶
func (c *Menu) SelectPageDownOption()
SelectPageDownOption Goes down 'menu height' options
func (*Menu) SelectPageUpOption ¶
func (c *Menu) SelectPageUpOption()
SelectPageUpOption Goes up 'menu height' options
func (*Menu) SelectPrevOption ¶
func (c *Menu) SelectPrevOption()
SelectPrevOption Decrements the selected option (if it can)
func (*Menu) SetActiveBgColor ¶
func (c *Menu) SetActiveBgColor(bg termbox.Attribute)
func (*Menu) SetActiveFgColor ¶
func (c *Menu) SetActiveFgColor(fg termbox.Attribute)
func (*Menu) SetBgColor ¶
func (c *Menu) SetBgColor(bg termbox.Attribute)
func (*Menu) SetBordered ¶
SetBordered sets whether we render a border around the menu
func (*Menu) SetCanSelectDisabled ¶
func (*Menu) SetDisabledBgColor ¶
func (c *Menu) SetDisabledBgColor(bg termbox.Attribute)
func (*Menu) SetDisabledFgColor ¶
func (c *Menu) SetDisabledFgColor(fg termbox.Attribute)
func (*Menu) SetFgColor ¶
func (c *Menu) SetFgColor(fg termbox.Attribute)
func (*Menu) SetOptionDisabled ¶
SetOptionDisabled Disables the specified option
func (*Menu) SetOptionEnabled ¶
SetOptionEnabled Enables the specified option
func (*Menu) SetOptions ¶
func (c *Menu) SetOptions(opts []MenuOption)
SetOptions set the menu's options to opts
func (*Menu) SetOptionsFromStrings ¶
SetOptionsFromStrings sets the options of this menu from a slice of strings
func (*Menu) SetSelectedBgColor ¶
func (c *Menu) SetSelectedBgColor(bg termbox.Attribute)
func (*Menu) SetSelectedDisabledBgColor ¶
func (c *Menu) SetSelectedDisabledBgColor(bg termbox.Attribute)
func (*Menu) SetSelectedDisabledFgColor ¶
func (c *Menu) SetSelectedDisabledFgColor(fg termbox.Attribute)
func (*Menu) SetSelectedFgColor ¶
func (c *Menu) SetSelectedFgColor(fg termbox.Attribute)
func (*Menu) SetSelectedIndex ¶
SetSelectedIndex sets the selection to setIdx
func (*Menu) SetSelectedOption ¶
func (c *Menu) SetSelectedOption(v *MenuOption)
SetSelectedOption sets the current selected option to v (if it's valid)
func (*Menu) SetTabSkip ¶
type MenuOption ¶
type MenuOption struct {
// contains filtered or unexported fields
}
MenuOption An option in the menu
func CreateOptionFromText ¶
func CreateOptionFromText(s string) *MenuOption
CreateOptionFromText just returns a MenuOption object That only has it's text value set.
func (*MenuOption) AddToSubMenu ¶
func (c *MenuOption) AddToSubMenu(sub *MenuOption)
AddToSubMenu adds a slice of MenuOptions to this option
func (*MenuOption) GetHelpText ¶
func (c *MenuOption) GetHelpText() string
GetHelpText Returns the help text for this option
func (*MenuOption) GetText ¶
func (c *MenuOption) GetText() string
GetText Returns the text for this option
func (*MenuOption) IsDisabled ¶
func (c *MenuOption) IsDisabled() bool
IsDisabled returns whether this option is enabled
func (*MenuOption) IsSelected ¶
func (c *MenuOption) IsSelected() bool
IsSelected Returns whether this option is selected
func (*MenuOption) SetHelpText ¶
func (c *MenuOption) SetHelpText(s string)
SetHelpText Sets this option's help text to s
func (*MenuOption) SetText ¶
func (c *MenuOption) SetText(s string)
SetText Sets the text for this option
func (*MenuOption) Unselect ¶
func (c *MenuOption) Unselect()
Unselect Sets this option to not selected
type ProgressBar ¶
type ProgressBar struct {
// contains filtered or unexported fields
}
ProgressBar Just contains the data needed to display a progress bar
func CreateProgressBar ¶
func CreateProgressBar(tot, x, y int, fg, bg termbox.Attribute) *ProgressBar
CreateProgressBar Create a progress bar object
func (*ProgressBar) Align ¶
func (c *ProgressBar) Align(a TextAlignment)
Align Tells which direction the progress bar empties
func (*ProgressBar) DecrProgress ¶
func (c *ProgressBar) DecrProgress()
DecrProgress decrements the current progress of the bar
func (*ProgressBar) DisableOverflow ¶
func (c *ProgressBar) DisableOverflow()
DisableOverflow Tells the progress bar that it can NOT go over the total
func (*ProgressBar) DisableUnderflow ¶
func (c *ProgressBar) DisableUnderflow()
DisableUnderflow Tells the progress bar that it can NOT go below zero
func (*ProgressBar) EnableOverflow ¶
func (c *ProgressBar) EnableOverflow()
EnableOverflow Tells the progress bar that it can go over the total
func (*ProgressBar) EnableUnderflow ¶
func (c *ProgressBar) EnableUnderflow()
EnableUnderflow Tells the progress bar that it can go below zero
func (*ProgressBar) GetBgColor ¶
func (c *ProgressBar) GetBgColor() termbox.Attribute
GetBgColor returns the background color
func (*ProgressBar) GetEmptyChar ¶
func (c *ProgressBar) GetEmptyChar() rune
GetEmptyChar gets the rune used for 'empty'
func (*ProgressBar) GetFgColor ¶
func (c *ProgressBar) GetFgColor() termbox.Attribute
GetFgColor returns the foreground color
func (*ProgressBar) GetFullChar ¶
func (c *ProgressBar) GetFullChar() rune
GetFullChar returns the rune used for 'full'
func (*ProgressBar) GetHeight ¶
func (c *ProgressBar) GetHeight() int
GetHeight returns the height of the progress bar Defaults to 1 (3 if bordered)
func (*ProgressBar) GetPercent ¶
func (c *ProgressBar) GetPercent() int
GetPercent returns the percent full of the bar
func (*ProgressBar) GetProgress ¶
func (c *ProgressBar) GetProgress() int
GetProgress returns the curret progress value
func (*ProgressBar) GetWidth ¶
func (c *ProgressBar) GetWidth() int
GetWidth returns the width of the progress bar
func (*ProgressBar) GetX ¶
func (c *ProgressBar) GetX() int
GetX Return the x position of the Progress Bar
func (*ProgressBar) GetY ¶
func (c *ProgressBar) GetY() int
GetY Return the y position of the ProgressBar
func (*ProgressBar) HandleEvent ¶
func (c *ProgressBar) HandleEvent(event termbox.Event) bool
HandleEvent accepts the termbox event and returns whether it was consumed
func (*ProgressBar) IncrProgress ¶
func (c *ProgressBar) IncrProgress()
IncrProgress increments the current progress of the bar
func (*ProgressBar) IsActive ¶
func (c *ProgressBar) IsActive() bool
func (*ProgressBar) SetActive ¶
func (c *ProgressBar) SetActive(a bool)
func (*ProgressBar) SetActiveBgColor ¶
func (c *ProgressBar) SetActiveBgColor(bg termbox.Attribute)
func (*ProgressBar) SetActiveFgColor ¶
func (c *ProgressBar) SetActiveFgColor(fg termbox.Attribute)
func (*ProgressBar) SetBgColor ¶
func (c *ProgressBar) SetBgColor(bg termbox.Attribute)
SetBgColor sets the current background color
func (*ProgressBar) SetColorized ¶
func (c *ProgressBar) SetColorized(color bool)
SetColorized sets whether the progress bar should be colored depending on how full it is:
10% - Red 50% - Yellow 80% - Green
func (*ProgressBar) SetEmptyChar ¶
func (c *ProgressBar) SetEmptyChar(f rune)
SetEmptyChar sets the rune used for 'empty'
func (*ProgressBar) SetFgColor ¶
func (c *ProgressBar) SetFgColor(fg termbox.Attribute)
SetFgColor sets the foreground color
func (*ProgressBar) SetFullChar ¶
func (c *ProgressBar) SetFullChar(f rune)
SetFullChar sets the rune used for 'full'
func (*ProgressBar) SetHeight ¶
func (c *ProgressBar) SetHeight(h int)
SetHeight Sets the height of the progress bar
func (*ProgressBar) SetProgress ¶
func (c *ProgressBar) SetProgress(p int)
SetProgress sets the current progress of the bar
func (*ProgressBar) SetWidth ¶
func (c *ProgressBar) SetWidth(w int)
SetWidth Sets the width of the progress bar
func (*ProgressBar) SetX ¶
func (c *ProgressBar) SetX(x int)
SetX set the x position of the ProgressBar to x
func (*ProgressBar) SetY ¶
func (c *ProgressBar) SetY(y int)
SetY Set the y position of the ProgressBar to y
type ScrollFrame ¶
type ScrollFrame struct {
// contains filtered or unexported fields
}
ScrollFrame is a frame for holding other elements It manages it's own x/y, tab index
func CreateScrollFrame ¶
func CreateScrollFrame(x, y, w, h int, fg, bg termbox.Attribute) *ScrollFrame
CreateScrollFrame creates Scrolling Frame at x, y that is w by h
func (*ScrollFrame) AddControl ¶
func (c *ScrollFrame) AddControl(t termboxControl)
AddControl adds a control to the frame
func (*ScrollFrame) DrawControl ¶
func (c *ScrollFrame) DrawControl(t termboxControl)
DrawControl figures out the relative position of the control, sets it, draws it, then resets it.
func (*ScrollFrame) DrawToStrings ¶
func (c *ScrollFrame) DrawToStrings() []string
DrawToStrings generates a slice of strings with what should be drawn to the screen
func (*ScrollFrame) GetBgColor ¶
func (c *ScrollFrame) GetBgColor() termbox.Attribute
GetBgColor returns the background color
func (*ScrollFrame) GetFgColor ¶
func (c *ScrollFrame) GetFgColor() termbox.Attribute
GetFgColor returns the foreground color
func (*ScrollFrame) GetHeight ¶
func (c *ScrollFrame) GetHeight() int
GetHeight returns the current height of the scroll frame
func (*ScrollFrame) GetScrollX ¶
func (c *ScrollFrame) GetScrollX() int
GetScrollX returns the x distance scrolled
func (*ScrollFrame) GetScrollY ¶
func (c *ScrollFrame) GetScrollY() int
GetScrollY returns the y distance scrolled
func (*ScrollFrame) GetWidth ¶
func (c *ScrollFrame) GetWidth() int
GetWidth returns the current width of the scroll frame
func (*ScrollFrame) GetX ¶
func (c *ScrollFrame) GetX() int
GetX returns the x position of the scroll frame
func (*ScrollFrame) GetY ¶
func (c *ScrollFrame) GetY() int
GetY returns the y position of the scroll frame
func (*ScrollFrame) HandleEvent ¶
func (c *ScrollFrame) HandleEvent(event termbox.Event) bool
HandleEvent accepts the termbox event and returns whether it was consumed
func (*ScrollFrame) IsBordered ¶
func (c *ScrollFrame) IsBordered() bool
IsBordered returns true or false if this scroll frame has a border
func (*ScrollFrame) IsVisible ¶
func (c *ScrollFrame) IsVisible(t termboxControl) bool
IsVisible takes a Termbox Control and returns whether that control would be visible in the frame
func (*ScrollFrame) ScrollDown ¶
func (c *ScrollFrame) ScrollDown()
ScrollDown scrolls the frame down
func (*ScrollFrame) ScrollLeft ¶
func (c *ScrollFrame) ScrollLeft()
ScrollLeft scrolls the frame left
func (*ScrollFrame) ScrollRight ¶
func (c *ScrollFrame) ScrollRight()
ScrollRight scrolls the frame right
func (*ScrollFrame) SetBgColor ¶
func (c *ScrollFrame) SetBgColor(bg termbox.Attribute)
SetBgColor sets the current background color
func (*ScrollFrame) SetBordered ¶
func (c *ScrollFrame) SetBordered(b bool)
SetBordered sets whether we render a border around the scroll frame
func (*ScrollFrame) SetFgColor ¶
func (c *ScrollFrame) SetFgColor(fg termbox.Attribute)
SetFgColor sets the foreground color
func (*ScrollFrame) SetHeight ¶
func (c *ScrollFrame) SetHeight(h int)
SetHeight sets the current height of the scroll frame
func (*ScrollFrame) SetWidth ¶
func (c *ScrollFrame) SetWidth(w int)
SetWidth sets the current width of the scroll frame
func (*ScrollFrame) SetX ¶
func (c *ScrollFrame) SetX(x int)
SetX sets the x position of the scroll frame
func (*ScrollFrame) SetY ¶
func (c *ScrollFrame) SetY(y int)
SetY sets the y position of the scroll frame
type TextAlignment ¶
type TextAlignment int
TextAlignment is an int value for how we're aligning text