components

package
v0.0.0-...-3119e3f Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2016 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Flashcard

type Flashcard struct {
	Par *termui.Par
	// contains filtered or unexported fields
}

Flashcard is the definition of Flashcard component

func CreateFlashcard

func CreateFlashcard(flashcard *config.Flashcard, optionsHeight int) *Flashcard

CreateFlashcard is the constructor for the Flashcard component

func (*Flashcard) Buffer

func (f *Flashcard) Buffer() termui.Buffer

Buffer implements interface termui.Bufferer

func (*Flashcard) Change

func (f *Flashcard) Change(flashcard *config.Flashcard)

Change displays the currently selected word

func (*Flashcard) Flip

func (f *Flashcard) Flip()

Flip displays name or definition accordingly

func (*Flashcard) GetHeight

func (f *Flashcard) GetHeight() int

GetHeight implements interface termui.GridBufferer

func (*Flashcard) SetWidth

func (f *Flashcard) SetWidth(w int)

SetWidth implements interface termui.GridBufferer

func (*Flashcard) SetX

func (f *Flashcard) SetX(x int)

SetX implements interface termui.GridBufferer

func (*Flashcard) SetY

func (f *Flashcard) SetY(y int)

SetY implements interface termui.GridBufferer

type Options

type Options struct {
	Par *termui.Par
}

Options is the definition of Options component

func CreateOptions

func CreateOptions(height int) *Options

CreateOptions is the constructor for the Options component

func (*Options) Buffer

func (o *Options) Buffer() termui.Buffer

Buffer implements interface termui.Bufferer

func (*Options) GetHeight

func (o *Options) GetHeight() int

GetHeight implements interface termui.GridBufferer

func (*Options) SetWidth

func (o *Options) SetWidth(w int)

SetWidth implements interface termui.GridBufferer

func (*Options) SetX

func (o *Options) SetX(x int)

SetX implements interface termui.GridBufferer

func (*Options) SetY

func (o *Options) SetY(y int)

SetY implements interface termui.GridBufferer

type WordList

type WordList struct {
	List         *termui.List
	Offset       int // starting point for scrolling
	SelectedWord int // position of the highlighted word
}

WordList is the definition of WordList component

func CreateWordList

func CreateWordList(flashcards *[]config.Flashcard, optionsHeight int) *WordList

CreateWordList is the constructor for the WordList component

func (*WordList) Buffer

func (w *WordList) Buffer() termui.Buffer

Buffer implements interface termui.Bufferer

func (*WordList) GetHeight

func (w *WordList) GetHeight() int

GetHeight implements interface termui.GridBufferer

func (*WordList) ScrollBottom

func (w *WordList) ScrollBottom()

ScrollBottom will move the cursor to the bottom of the list

func (*WordList) ScrollDown

func (w *WordList) ScrollDown() (change bool)

ScrollDown enables us to scroll through the word list when it overflows

func (*WordList) ScrollTop

func (w *WordList) ScrollTop()

ScrollTop will move the cursor to the top of the list

func (*WordList) ScrollUp

func (w *WordList) ScrollUp() (change bool)

ScrollUp enables us to scroll through the word list when it overflows

func (*WordList) SetWidth

func (w *WordList) SetWidth(width int)

SetWidth implements interface termui.GridBufferer

func (*WordList) SetX

func (w *WordList) SetX(x int)

SetX implements interface termui.GridBufferer

func (*WordList) SetY

func (w *WordList) SetY(y int)

SetY implements interface termui.GridBufferer

Jump to

Keyboard shortcuts

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