mode

package
v0.0.0-...-9a69374 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2015 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	INPUT_PREFIX = "> "
)

Variables

This section is empty.

Functions

func FillText

func FillText(n, y int, fg, bg termbox.Attribute, c rune)

func GetMoveValue

func GetMoveValue(r rune) int

func PrintLine

func PrintLine(y int, str string) int

func PrintText

func PrintText(x, y int, fg, bg termbox.Attribute, text string) int

func ShiftIndex

func ShiftIndex(ary *[]int, val int)

Types

type Action

type Action int
const (
	RENAME Action = iota
	INSERT
)

type ExchangeDraw

type ExchangeDraw struct {
	Nothing
	View
	Tab fmt.Stringer
}

func (*ExchangeDraw) DoChar

func (e *ExchangeDraw) DoChar(r rune)

func (*ExchangeDraw) DoEnter

func (e *ExchangeDraw) DoEnter()

func (*ExchangeDraw) Draw

func (e *ExchangeDraw) Draw()

func (*ExchangeDraw) GetListLength

func (e *ExchangeDraw) GetListLength() int

func (*ExchangeDraw) Mode

func (e *ExchangeDraw) Mode() Mode

type InputBox

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

func NewInputBox

func NewInputBox(prefix string) *InputBox

func (*InputBox) DeleteAll

func (ib *InputBox) DeleteAll()

func (*InputBox) DeleteRuneBackward

func (ib *InputBox) DeleteRuneBackward()

func (*InputBox) DeleteRuneForward

func (ib *InputBox) DeleteRuneForward()

func (*InputBox) GetCursorPos

func (ib *InputBox) GetCursorPos() int

func (*InputBox) GetInputString

func (ib *InputBox) GetInputString() string

func (*InputBox) InsertRune

func (ib *InputBox) InsertRune(r rune)

func (*InputBox) InsertStr

func (ib *InputBox) InsertStr(s string)

func (*InputBox) MoveCursorOneRuneBackward

func (ib *InputBox) MoveCursorOneRuneBackward()

func (*InputBox) MoveCursorOneRuneForward

func (ib *InputBox) MoveCursorOneRuneForward()

func (*InputBox) MoveCursorTo

func (ib *InputBox) MoveCursorTo(bOffset int)

func (*InputBox) RuneBeforeCursor

func (ib *InputBox) RuneBeforeCursor() (rune, int)

func (*InputBox) RuneUnderCursor

func (ib *InputBox) RuneUnderCursor() (rune, int)

type InputDraw

type InputDraw struct {
	Nothing
	View
	Act Action
}

func (*InputDraw) DoChar

func (i *InputDraw) DoChar(r rune)

func (*InputDraw) DoEnter

func (i *InputDraw) DoEnter()

func (*InputDraw) DoKeyArrowLeft

func (i *InputDraw) DoKeyArrowLeft()

func (*InputDraw) DoKeyArrowRight

func (i *InputDraw) DoKeyArrowRight()

func (*InputDraw) DoKeyBackspace

func (i *InputDraw) DoKeyBackspace()

func (*InputDraw) DoKeyCtrlB

func (i *InputDraw) DoKeyCtrlB()

func (*InputDraw) DoKeyCtrlF

func (i *InputDraw) DoKeyCtrlF()

func (*InputDraw) DoKeyDelete

func (i *InputDraw) DoKeyDelete()

func (*InputDraw) DoKeySpace

func (i *InputDraw) DoKeySpace()

func (*InputDraw) Draw

func (i *InputDraw) Draw()

func (*InputDraw) GetListLength

func (i *InputDraw) GetListLength() int

func (*InputDraw) Mode

func (i *InputDraw) Mode() Mode

type LabelSetDraw

type LabelSetDraw struct {
	Nothing
	View
	Tab fmt.Stringer
}

func (*LabelSetDraw) DoChar

func (l *LabelSetDraw) DoChar(r rune)

func (*LabelSetDraw) Draw

func (l *LabelSetDraw) Draw()

func (*LabelSetDraw) GetListLength

func (l *LabelSetDraw) GetListLength() int

func (*LabelSetDraw) Mode

func (l *LabelSetDraw) Mode() Mode

type Lister

type Lister interface {
	GetListLength() int
	GetList(int) []string
	Add(string) int
	Remove(int) interface{}
	GetPresentName(int) string
	Rename(int, string)
	Exchange(int, int)
	ChangeLabel(int, string)
}

type Mode

type Mode int
const (
	NORMAL Mode = iota
	INPUT
	LABELSET
	EXCHANGE
)

type NormalDraw

type NormalDraw struct {
	Nothing
	View
	Tab fmt.Stringer
}

func (*NormalDraw) ChangeLabel

func (n *NormalDraw) ChangeLabel(i int, label string)

func (*NormalDraw) DoChar

func (n *NormalDraw) DoChar(r rune)

func (*NormalDraw) DoKeyCtrlD

func (n *NormalDraw) DoKeyCtrlD()

func (*NormalDraw) DoKeySpace

func (n *NormalDraw) DoKeySpace()

func (*NormalDraw) Draw

func (n *NormalDraw) Draw()

func (*NormalDraw) GetListLength

func (n *NormalDraw) GetListLength() int

func (*NormalDraw) Mode

func (n *NormalDraw) Mode() Mode

type Nothing

type Nothing struct{}

func (Nothing) DoChar

func (n Nothing) DoChar(r rune)

func (Nothing) DoEnter

func (n Nothing) DoEnter()

func (Nothing) DoKeyArrowLeft

func (n Nothing) DoKeyArrowLeft()

func (Nothing) DoKeyArrowRight

func (n Nothing) DoKeyArrowRight()

func (Nothing) DoKeyBackspace

func (n Nothing) DoKeyBackspace()

func (Nothing) DoKeyCtrlA

func (n Nothing) DoKeyCtrlA()

func (Nothing) DoKeyCtrlB

func (n Nothing) DoKeyCtrlB()

func (Nothing) DoKeyCtrlD

func (n Nothing) DoKeyCtrlD()

func (Nothing) DoKeyCtrlF

func (n Nothing) DoKeyCtrlF()

func (Nothing) DoKeyCtrlL

func (n Nothing) DoKeyCtrlL()

func (Nothing) DoKeyCtrlR

func (n Nothing) DoKeyCtrlR()

func (Nothing) DoKeyCtrlV

func (n Nothing) DoKeyCtrlV()

func (Nothing) DoKeyCtrlW

func (n Nothing) DoKeyCtrlW()

func (Nothing) DoKeyCtrlX

func (n Nothing) DoKeyCtrlX()

func (Nothing) DoKeyDelete

func (n Nothing) DoKeyDelete()

func (Nothing) DoKeyEsc

func (n Nothing) DoKeyEsc()

func (Nothing) DoKeySpace

func (n Nothing) DoKeySpace()

func (Nothing) DoKeyTab

func (n Nothing) DoKeyTab()

type Operator

type Operator interface {
	DoKeyEsc()
	DoKeyArrowLeft()
	DoKeyCtrlB()
	DoKeyArrowRight()
	DoKeyCtrlF()
	DoKeyBackspace()
	DoKeyDelete()
	DoKeyTab()
	DoKeyCtrlX()
	DoKeyCtrlW()
	DoKeyCtrlL()
	DoKeyCtrlV()
	DoKeyCtrlD()
	DoKeyCtrlA()
	DoKeyCtrlR()
	DoKeySpace()
	DoEnter()
	DoChar(rune)
}

type View

type View struct {
	Width    int
	Height   int
	Lister   Lister
	Input    *InputBox
	Cursor   int
	Check    int
	Selected []int
}

func NewView

func NewView(w, h int) *View

func NewViewWithCheck

func NewViewWithCheck(w, h, i int) *View

func (*View) GetCursorIndex

func (v *View) GetCursorIndex() int

func (*View) GetSelectedIndex

func (v *View) GetSelectedIndex() []int

func (*View) PrintList

func (v *View) PrintList(y int)

func (*View) Reset

func (v *View) Reset()

func (*View) SetCursor

func (v *View) SetCursor(i int)

func (*View) SetLister

func (v *View) SetLister(ls Lister)

Jump to

Keyboard shortcuts

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