components

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Confirm

type Confirm struct {
	P0, P1, P2, P3 *w.Paragraph

	Text string

	Location image.Point

	Callback func()
}

Confirm widget type

func NewConfirm

func NewConfirm() *Confirm

NewConfirm creates new Confirm widget

func (*Confirm) Render

func (c *Confirm) Render()

Render renders Confirm widget

type Input

type Input struct {
	ui.Block

	TextStyle     ui.Style
	ActionMapping map[string]func()
	// contains filtered or unexported fields
}

Input widget type

func NewInput

func NewInput() *Input

NewInput creates new Input widget

func (*Input) AddText

func (i *Input) AddText(s string)

AddText updates the content of the text field based on cursor position.

func (*Input) Capture

func (i *Input) Capture()

Capture begins catching events and updates the content of the text field.

func (*Input) Draw

func (i *Input) Draw(buf *ui.Buffer)

Draw implements the ui.Drawable interface.

func (*Input) GetText

func (i *Input) GetText() string

GetText returns the content of the text field.

type Table

type Table struct {
	*Block

	Header []string
	Rows   [][]string

	ColWidths []int
	ColGap    int
	PadLeft   int

	ShowCursor  bool
	CursorColor Color

	ShowLocation bool

	UniqueCol    int    // the column used to uniquely identify each table row
	SelectedItem string // used to keep the cursor on the correct item if the data changes
	SelectedRow  int
	TopRow       int // used to indicate where in the table we are scrolled at

	ColResizer func()
}

func NewTable

func NewTable() *Table

NewTable returns a new Table instance

func (*Table) Draw

func (self *Table) Draw(buf *Buffer)

func (*Table) HandleClick

func (self *Table) HandleClick(x, y int)

func (*Table) ScrollBottom

func (self *Table) ScrollBottom()

func (*Table) ScrollDown

func (self *Table) ScrollDown()

func (*Table) ScrollHalfPageDown

func (self *Table) ScrollHalfPageDown()

func (*Table) ScrollHalfPageUp

func (self *Table) ScrollHalfPageUp()

func (*Table) ScrollPageDown

func (self *Table) ScrollPageDown()

func (*Table) ScrollPageUp

func (self *Table) ScrollPageUp()

func (*Table) ScrollTop

func (self *Table) ScrollTop()

func (*Table) ScrollUp

func (self *Table) ScrollUp()

type TimeEntryForm

type TimeEntryForm struct {
	Description    *Input
	ActiveInput    int
	Data           types.TimeEntry
	SubmitCallback func()
	// contains filtered or unexported fields
}

func NewTimeEntryForm

func NewTimeEntryForm() *TimeEntryForm

func (*TimeEntryForm) FocusNext

func (f *TimeEntryForm) FocusNext()

func (*TimeEntryForm) GetActiveInput

func (f *TimeEntryForm) GetActiveInput() *Input

func (*TimeEntryForm) GetData

func (f *TimeEntryForm) GetData() types.TimeEntry

func (*TimeEntryForm) Render

func (f *TimeEntryForm) Render()

func (*TimeEntryForm) Submit

func (f *TimeEntryForm) Submit()

Jump to

Keyboard shortcuts

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