termtable

package module
v0.0.0-...-fbf738c Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2019 License: MIT Imports: 4 Imported by: 0

README

go-termtable

Godoc Reference

go-termtableはtermbox-goを使ったライブラリです。
TUI上でテーブル形式のUIを提供します。 キャプチャ

Installation

$ go get github.com/tookunn1213/go-termtable

Licence

MIT

Reference

https://godoc.org/github.com/tookunn1213/go-termtable

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Max

func Max(a, b int) int

func Min

func Min(a, b int) int

Types

type Alignment

type Alignment int
const (
	AlignLeft Alignment = iota
	AlignCenter
	AlignRight
)

type Cell

type Cell struct {
	// contains filtered or unexported fields
}

func NewCell

func NewCell(text []rune) Cell

func NewCells

func NewCells(textList []string) []Cell

func (*Cell) GetText

func (c *Cell) GetText() []rune

func (*Cell) GetTextAlign

func (c *Cell) GetTextAlign() Alignment

func (*Cell) SetTextAlign

func (c *Cell) SetTextAlign(align Alignment)

type Color

type Color struct {
	// contains filtered or unexported fields
}

func NewColor

func NewColor(fg, bg termbox.Attribute) Color

func (Color) GetBg

func (c Color) GetBg() termbox.Attribute

func (Color) GetFg

func (c Color) GetFg() termbox.Attribute

func (Color) SetBg

func (c Color) SetBg(bg termbox.Attribute)

func (Color) SetFg

func (c Color) SetFg(fg termbox.Attribute)

type Cursor

type Cursor struct {
	// contains filtered or unexported fields
}

func (*Cursor) Down

func (cursor *Cursor) Down()

func (*Cursor) Left

func (cursor *Cursor) Left()

func (*Cursor) Right

func (cursor *Cursor) Right()

func (*Cursor) SetCursor

func (cursor *Cursor) SetCursor(rowPos, colPos int)

func (*Cursor) Up

func (cursor *Cursor) Up()

type Record

type Record struct {
	// contains filtered or unexported fields
}

func NewRecord

func NewRecord(cells []Cell, offset int) Record

func (*Record) Add

func (r *Record) Add(c Cell)

func (*Record) Compare

func (r1 *Record) Compare(r2 Record, n int) int

func (*Record) GetCell

func (r *Record) GetCell(c int) (cell Cell)

func (*Record) GetCells

func (r *Record) GetCells() []Cell

func (*Record) SetCell

func (r *Record) SetCell(c int, cell Cell)

func (*Record) SetCells

func (r *Record) SetCells(cells []Cell)

func (*Record) Size

func (r *Record) Size() int

type SeparatorConfig

type SeparatorConfig struct {
	// contains filtered or unexported fields
}

func (*SeparatorConfig) GetType

func (sc *SeparatorConfig) GetType() SeparatorLineType

func (*SeparatorConfig) Separator

func (sc *SeparatorConfig) Separator() SeparatorLine

func (*SeparatorConfig) SetType

func (sc *SeparatorConfig) SetType(sepType SeparatorLineType)

type SeparatorLine

type SeparatorLine interface {
	GetVerticalLine() rune
	GetHorizontalLine() rune
	GetCrossLine() rune
	GetTopLeftLine() rune
	GetTopRightLine() rune
	GetTopCenterLine() rune
	GetBottomLeftLine() rune
	GetBottomRightLine() rune
	GetBottomCenterLine() rune
	GetRightCenterLine() rune
	GetLeftCenterLine() rune
}

type SeparatorLineFull

type SeparatorLineFull struct {
}

func (*SeparatorLineFull) GetBottomCenterLine

func (s *SeparatorLineFull) GetBottomCenterLine() rune

func (*SeparatorLineFull) GetBottomLeftLine

func (s *SeparatorLineFull) GetBottomLeftLine() rune

func (*SeparatorLineFull) GetBottomRightLine

func (s *SeparatorLineFull) GetBottomRightLine() rune

func (*SeparatorLineFull) GetCrossLine

func (s *SeparatorLineFull) GetCrossLine() rune

func (*SeparatorLineFull) GetHorizontalLine

func (s *SeparatorLineFull) GetHorizontalLine() rune

func (*SeparatorLineFull) GetLeftCenterLine

func (s *SeparatorLineFull) GetLeftCenterLine() rune

func (*SeparatorLineFull) GetRightCenterLine

func (s *SeparatorLineFull) GetRightCenterLine() rune

func (*SeparatorLineFull) GetTopCenterLine

func (s *SeparatorLineFull) GetTopCenterLine() rune

func (*SeparatorLineFull) GetTopLeftLine

func (s *SeparatorLineFull) GetTopLeftLine() rune

func (*SeparatorLineFull) GetTopRightLine

func (s *SeparatorLineFull) GetTopRightLine() rune

func (*SeparatorLineFull) GetVerticalLine

func (s *SeparatorLineFull) GetVerticalLine() rune

type SeparatorLineHalf

type SeparatorLineHalf struct {
}

func (*SeparatorLineHalf) GetBottomCenterLine

func (s *SeparatorLineHalf) GetBottomCenterLine() rune

func (*SeparatorLineHalf) GetBottomLeftLine

func (s *SeparatorLineHalf) GetBottomLeftLine() rune

func (*SeparatorLineHalf) GetBottomRightLine

func (s *SeparatorLineHalf) GetBottomRightLine() rune

func (*SeparatorLineHalf) GetCrossLine

func (s *SeparatorLineHalf) GetCrossLine() rune

func (*SeparatorLineHalf) GetHorizontalLine

func (s *SeparatorLineHalf) GetHorizontalLine() rune

func (*SeparatorLineHalf) GetLeftCenterLine

func (s *SeparatorLineHalf) GetLeftCenterLine() rune

func (*SeparatorLineHalf) GetRightCenterLine

func (s *SeparatorLineHalf) GetRightCenterLine() rune

func (*SeparatorLineHalf) GetTopCenterLine

func (s *SeparatorLineHalf) GetTopCenterLine() rune

func (*SeparatorLineHalf) GetTopLeftLine

func (s *SeparatorLineHalf) GetTopLeftLine() rune

func (*SeparatorLineHalf) GetTopRightLine

func (s *SeparatorLineHalf) GetTopRightLine() rune

func (*SeparatorLineHalf) GetVerticalLine

func (s *SeparatorLineHalf) GetVerticalLine() rune

type SeparatorLineType

type SeparatorLineType int

type SortCondition

type SortCondition struct {
	// contains filtered or unexported fields
}

func NewSortCondition

func NewSortCondition(colNumber int, order SortOrder) *SortCondition

type SortOrder

type SortOrder int
const (
	SORT_ASC SortOrder = iota + 1
	SORT_DESC
)

type TermTable

type TermTable struct {
	UnFocusColor Color
	FocusColor   Color
	BorderColor  Color
	// contains filtered or unexported fields
}

func NewTermTable

func NewTermTable(x, y, colWidth, colHeight int) *TermTable

func (*TermTable) AddRecord

func (tt *TermTable) AddRecord(record Record)

func (*TermTable) AddRecords

func (tt *TermTable) AddRecords(records []Record)

func (*TermTable) CountRecord

func (tt *TermTable) CountRecord() int

func (*TermTable) GetCursor

func (tt *TermTable) GetCursor() *Cursor

func (*TermTable) GetRecord

func (tt *TermTable) GetRecord(r int) (record Record)

func (*TermTable) HasBorderLine

func (tt *TermTable) HasBorderLine() bool

func (*TermTable) Render

func (tt *TermTable) Render()

func (*TermTable) SetBorderLine

func (tt *TermTable) SetBorderLine(enabled bool)

func (*TermTable) SetRecord

func (tt *TermTable) SetRecord(r int, record Record)

func (*TermTable) Sort

func (tt *TermTable) Sort(sortConditions []SortCondition)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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