uiCommon

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2016 License: Apache-2.0 Imports: 14 Imported by: 63

Documentation

Index

Constants

View Source
const (
	MAX_SORT_COLUMNS = 5
	AscendingText    = "( " + UpArrow + " ascending )"
	DescendingText   = "( " + DownArrow + " descending )"
)
View Source
const (
	// Unicode characters: http://graphemica.com/unicode/characters/page/34
	DownArrow       = string('\U00002193')
	UpArrow         = string('\U00002191')
	DownArrowTiny   = string('\U0000A71C')
	UpArrowTiny     = string('\U0000A71B')
	TriangleUp      = string('\U000025B4')
	TriangleDown    = string('\U000025BE')
	RightArrow      = string('\U00002192')
	LeftArrow       = string('\U00002190')
	InfoIcon        = string('\U00002139')
	Ellipsis        = string('\U00002026')
	TwoDot          = string('\U00002025')
	OneDot          = string('\U00002024')
	CircleBackslash = string('\U000020E0')
)
View Source
const LOCK_COLUMNS = 1

Variables

This section is empty.

Functions

This section is empty.

Types

type AlertWidget added in v0.7.3

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

func NewAlertWidget added in v0.7.3

func NewAlertWidget(masterUI masterUIInterface.MasterUIInterface, name string, height int) *AlertWidget

func (*AlertWidget) Layout added in v0.7.3

func (w *AlertWidget) Layout(g *gocui.Gui) error

func (*AlertWidget) Name added in v0.7.3

func (w *AlertWidget) Name() string

func (*AlertWidget) SetHeight added in v0.7.3

func (w *AlertWidget) SetHeight(height int)

func (*AlertWidget) SetMessage added in v0.7.3

func (w *AlertWidget) SetMessage(msg string)

type ColumnType

type ColumnType int
const (
	ALPHANUMERIC ColumnType = iota
	NUMERIC
)

type DisplayViewInterface

type DisplayViewInterface interface {
	RefreshDisplay(g *gocui.Gui) error
	SetDisplayPaused(paused bool)
	GetDisplayPaused() bool
	GetTopOffset() int
}

type EditColumnViewAbs

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

func NewEditColumnViewAbs

func NewEditColumnViewAbs(masterUI masterUIInterface.MasterUIInterface, name string, listWidget *ListWidget) *EditColumnViewAbs

func (*EditColumnViewAbs) Layout

func (w *EditColumnViewAbs) Layout(g *gocui.Gui) error

func (*EditColumnViewAbs) Name

func (w *EditColumnViewAbs) Name() string

func (*EditColumnViewAbs) RefreshDisplay

func (w *EditColumnViewAbs) RefreshDisplay(g *gocui.Gui) error

type EditFilterView

type EditFilterView struct {
	*EditColumnViewAbs
	// contains filtered or unexported fields
}

func NewEditFilterView

func NewEditFilterView(masterUI masterUIInterface.MasterUIInterface, name string, listWidget *ListWidget) *EditFilterView

type EditSortView

type EditSortView struct {
	*EditColumnViewAbs
	// contains filtered or unexported fields
}

func NewEditSortView

func NewEditSortView(masterUI masterUIInterface.MasterUIInterface, name string, listWidget *ListWidget) *EditSortView

type FilterColumn

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

type IData

type IData interface {
	Id() string
}

type Input

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

func NewInput

func NewInput(
	parentUI masterUIInterface.Manager,
	name string,
	offsetX, offsetY,
	width,
	maxLength int,
	inputValue string,
	applyCallbackFunc applyCallbackFunc,
	cancelCallbackFunc cancelCallbackFunc,
) *Input

func (*Input) Edit

func (w *Input) Edit(v *gocui.View, key gocui.Key, ch rune, mod gocui.Modifier)

func (*Input) Layout

func (i *Input) Layout(g *gocui.Gui) error

func (*Input) Name

func (i *Input) Name() string

type InputDialogWidget

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

InputDialogWidget used for displaying a label and input field

func NewInputDialogWidget

func NewInputDialogWidget(
	masterUI masterUIInterface.MasterUIInterface,
	name string,
	width, height int,
	labelText string, maxLength int,
	titleText string, helpText string,
	valueText string,
	applyValueCallback applyCallbackFunc) *InputDialogWidget

func (*InputDialogWidget) CloseWidget

func (w *InputDialogWidget) CloseWidget(g *gocui.Gui, v *gocui.View) error

func (*InputDialogWidget) Init

func (w *InputDialogWidget) Init(g *gocui.Gui) error

func (*InputDialogWidget) Layout

func (w *InputDialogWidget) Layout(g *gocui.Gui) error

func (*InputDialogWidget) Name

func (w *InputDialogWidget) Name() string

type Label

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

func NewLabel

func NewLabel(parentUI masterUIInterface.Manager, name string, offsetX, offsetY int, labelText string) *Label

func (*Label) Layout

func (l *Label) Layout(g *gocui.Gui) error

func (*Label) Name

func (l *Label) Name() string

type LayoutManager

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

func NewLayoutManager

func NewLayoutManager() *LayoutManager

func (*LayoutManager) Add

func (w *LayoutManager) Add(addMgr masterUIInterface.Manager)

func (*LayoutManager) AddToBack added in v0.7.3

func (w *LayoutManager) AddToBack(addMgr masterUIInterface.Manager)

func (*LayoutManager) Contains

func (w *LayoutManager) Contains(managerToFind masterUIInterface.Manager) bool

func (*LayoutManager) ContainsViewName added in v0.7.3

func (w *LayoutManager) ContainsViewName(viewName string) bool

func (*LayoutManager) GetManagerByViewName

func (w *LayoutManager) GetManagerByViewName(managerViewNameToRemove string) masterUIInterface.Manager

func (*LayoutManager) Layout

func (w *LayoutManager) Layout(g *gocui.Gui) error

func (*LayoutManager) Remove

func (*LayoutManager) RemoveByName

func (w *LayoutManager) RemoveByName(managerViewNameToRemove string) masterUIInterface.Manager

func (*LayoutManager) SetCurrentView added in v0.7.3

func (w *LayoutManager) SetCurrentView(viewName string) bool

func (*LayoutManager) Top

type ListColumn

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

func NewListColumn

func NewListColumn(
	id, label string,
	size int,
	columnType ColumnType,
	leftJustifyLabel bool,
	sortFunc util.LessFunc,
	defaultReverseSort bool,
	displayFunc getRowDisplayFunc,
	rawValueFunc getRowRawValueFunc) *ListColumn

type ListWidget

type ListWidget struct {
	Title string

	PreRowDisplayFunc getRowDisplayFunc
	// contains filtered or unexported fields
}

func NewListWidget

func NewListWidget(masterUI masterUIInterface.MasterUIInterface, name string,
	bottomMargin int, displayView DisplayViewInterface,
	columns []*ListColumn) *ListWidget

func (*ListWidget) FilterAndSortData

func (asUI *ListWidget) FilterAndSortData()

func (*ListWidget) FilterRow

func (asUI *ListWidget) FilterRow(data IData) bool

func (*ListWidget) GetColumns

func (asUI *ListWidget) GetColumns() []*ListColumn

func (*ListWidget) GetFilterColumnMap

func (asUI *ListWidget) GetFilterColumnMap() map[string]*FilterColumn

func (*ListWidget) GetSortFunctions

func (asUI *ListWidget) GetSortFunctions() []util.LessFunc

func (*ListWidget) HighlightKey

func (asUI *ListWidget) HighlightKey() string

func (*ListWidget) Layout

func (w *ListWidget) Layout(g *gocui.Gui) error

func (*ListWidget) Name

func (w *ListWidget) Name() string

func (*ListWidget) RefreshDisplay

func (asUI *ListWidget) RefreshDisplay(g *gocui.Gui) error

func (*ListWidget) SetListData

func (asUI *ListWidget) SetListData(listData []IData)

func (*ListWidget) SetSortColumns

func (asUI *ListWidget) SetSortColumns(sortColumns []*SortColumn)

func (*ListWidget) SetTopMarginX added in v0.7.3

func (w *ListWidget) SetTopMarginX(topMargin int)

TODO: Delete this method

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

func NewMenuItem

func NewMenuItem(id, label string) *MenuItem

type SelectMenuWidget

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

func NewSelectMenuWidget

func NewSelectMenuWidget(
	masterUI masterUIInterface.MasterUIInterface,
	name string,
	title string,
	menuItems []*MenuItem,
	menuItemSelectedCallback menuItemSelectedCallbackFunc) *SelectMenuWidget

func (*SelectMenuWidget) GetMenuSelection

func (w *SelectMenuWidget) GetMenuSelection() *MenuItem

func (*SelectMenuWidget) Layout

func (w *SelectMenuWidget) Layout(g *gocui.Gui) error

func (*SelectMenuWidget) Name

func (w *SelectMenuWidget) Name() string

func (*SelectMenuWidget) RefreshDisplay

func (w *SelectMenuWidget) RefreshDisplay(g *gocui.Gui) error

func (*SelectMenuWidget) SetMenuId

func (w *SelectMenuWidget) SetMenuId(menuId string)

type SortColumn

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

func NewSortColumn

func NewSortColumn(id string, reverseSort bool) *SortColumn

Jump to

Keyboard shortcuts

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