enumfield

package
v0.0.0-...-4cb4cf9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EnumField

type EnumField struct {
	*tview.Box
	// contains filtered or unexported fields
}

func NewEnumField

func NewEnumField(options []string) *EnumField

NewEnumField returns a new navigation bar.

func (*EnumField) Blur

func (n *EnumField) Blur()

Blur is called when this primitive loses focus.

func (*EnumField) Draw

func (n *EnumField) Draw(screen tcell.Screen)

Draw renders this primitive onto the screen.

func (*EnumField) Focus

func (n *EnumField) Focus(delegate func(p tview.Primitive))

Focus is called when this primitive receives focus.

func (*EnumField) GetFieldWidth

func (n *EnumField) GetFieldWidth() int

GetFieldWidth obtains a screen width of the input area. A value of 0 means extend as much as possible.

func (*EnumField) GetLabel

func (n *EnumField) GetLabel() string

GetLabel returns the text to be displayed before the input area.

func (*EnumField) GetLabelWidth

func (n *EnumField) GetLabelWidth() int

GetLabelWidth returns width of the label field.

func (*EnumField) GetText

func (n *EnumField) GetText() string

GetText returns currently selected text

func (*EnumField) InputHandler

func (n *EnumField) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))

InputHandler returns the handler for this primitive.

func (*EnumField) SetBackgroundColorActivated

func (n *EnumField) SetBackgroundColorActivated(color tcell.Color) *EnumField

SetBackgroundColorActivated sets the background color of the button text when the button is selected.

func (*EnumField) SetFieldBackgroundColor

func (n *EnumField) SetFieldBackgroundColor(color tcell.Color) *EnumField

SetNavBackgroundColor sets the background color.

func (*EnumField) SetFinishedFunc

func (n *EnumField) SetFinishedFunc(handler func(key tcell.Key)) tview.FormItem

SetFinishedFunc sets a callback invoked when the user leaves this form item.

func (*EnumField) SetFormAttributes

func (n *EnumField) SetFormAttributes(labelWidth int, labelColor, bgColor, fieldTextColor, fieldBgColor tcell.Color) tview.FormItem

SetFormAttributes sets attributes shared by all form items. Only bgColor is considered for bg colors.

func (*EnumField) SetLabel

func (n *EnumField) SetLabel(x string) *EnumField

SetLabel sets label and returns the updated object.

func (*EnumField) SetLabelColor

func (n *EnumField) SetLabelColor(color tcell.Color) *EnumField

SetLabelColor sets the color of button text.

func (*EnumField) SetLabelColorActivated

func (n *EnumField) SetLabelColorActivated(color tcell.Color) *EnumField

SetLabelColorActivated sets the color of button text when the button is selected.

func (*EnumField) SetLabelWidth

func (n *EnumField) SetLabelWidth(width int) *EnumField

SetLabelWidth sets the screen width of the label. A value of 0 will cause the primitive to use the width of the label string.

func (*EnumField) SetOnBlurFunc

func (n *EnumField) SetOnBlurFunc(handler func()) *EnumField

SetOnBlurFunc sets a callback invoked when this primitive loses focus.

func (*EnumField) SetOnFocusFunc

func (n *EnumField) SetOnFocusFunc(handler func()) *EnumField

SetOnFocusFunc sets a callback invoked when this primitive receives focus.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL