pile

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2020 License: MIT Imports: 6 Imported by: 23

Documentation

Overview

Package pile provides a widget for organizing other widgets in a vertical stack.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Render

func Render(w IWidget, size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.ICanvas

func RenderBoxMaker

func RenderBoxMaker(w IWidget, size gowid.IRenderSize, focus gowid.Selector, focusIdx int, app gowid.IApp, fn IPileBoxMaker) ([]gowid.IRenderBox, []gowid.IRenderSize)

func RenderSubwidgets

func RenderSubwidgets(w IWidget, size gowid.IRenderSize, focus gowid.Selector, focusIdx int, app gowid.IApp) []gowid.ICanvas

func RenderedChildrenSizes

func RenderedChildrenSizes(w IWidget, size gowid.IRenderSize, focus gowid.Selector, focusIdx int, app gowid.IApp) ([]gowid.IRenderBox, []gowid.IRenderSize)

func UserInput

func UserInput(w IWidget, ev interface{}, size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) bool

Types

type IFocusSelectable

type IFocusSelectable interface {
	gowid.IFocus
	gowid.IFindNextSelectable
}

type IPileBoxMaker

type IPileBoxMaker interface {
	MakeBox(gowid.IWidget, gowid.IRenderSize, gowid.Selector, gowid.IApp) gowid.IRenderBox
}

TODO - make this an interface

type Options

type Options struct {
	StartRow         int
	Wrap             bool
	DoNotSetSelected bool // Whether or not to set the focus.Selected field for the selected child
	DownKeys         []vim.KeyPress
	UpKeys           []vim.KeyPress
}

type Widget

type Widget struct {
	*gowid.Callbacks
	gowid.AddressProvidesID
	gowid.FocusCallbacks
	gowid.SubWidgetsCallbacks
	// contains filtered or unexported fields
}

func New

func New(widgets []gowid.IContainerWidget, opts ...Options) *Widget

func NewFixed

func NewFixed(ws ...interface{}) *Widget

func NewFlow

func NewFlow(ws ...interface{}) *Widget

func Simple(ws ...gowid.IWidget) *Widget {

func NewWithDim

func NewWithDim(method gowid.IWidgetDimension, ws ...interface{}) *Widget

func (*Widget) Dimensions

func (w *Widget) Dimensions() []gowid.IWidgetDimension

func (*Widget) FindNextSelectable

func (w *Widget) FindNextSelectable(dir gowid.Direction, wrap bool) (int, bool)

func (*Widget) Focus

func (w *Widget) Focus() int

Tries to set at required index, will choose first selectable from there

func (*Widget) GetPreferedPosition

func (w *Widget) GetPreferedPosition() gwutil.IntOption

func (*Widget) KeyIsDown added in v1.2.0

func (w *Widget) KeyIsDown(evk *tcell.EventKey) bool

func (*Widget) KeyIsUp added in v1.2.0

func (w *Widget) KeyIsUp(evk *tcell.EventKey) bool

func (*Widget) Render

func (w *Widget) Render(size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.ICanvas

TODO - widen each line to same width

func (*Widget) RenderBoxMaker

func (w *Widget) RenderBoxMaker(size gowid.IRenderSize, focus gowid.Selector, focusIdx int, app gowid.IApp, fn IPileBoxMaker) ([]gowid.IRenderBox, []gowid.IRenderSize)

TODO - widen each line to same width gcdoc - the fn argument is used to return either canvases or sizes, depending on whether the caller is rendering, or rendering subsizes

func (*Widget) RenderSize

func (w *Widget) RenderSize(size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.IRenderBox

func (*Widget) RenderSubWidgets

func (w *Widget) RenderSubWidgets(size gowid.IRenderSize, focus gowid.Selector, focusIdx int, app gowid.IApp) []gowid.ICanvas

func (*Widget) RenderedSubWidgetsSizes

func (w *Widget) RenderedSubWidgetsSizes(size gowid.IRenderSize, focus gowid.Selector, focusIdx int, app gowid.IApp) []gowid.IRenderBox

func (*Widget) SelectChild

func (w *Widget) SelectChild(f gowid.Selector) bool

func (*Widget) Selectable

func (w *Widget) Selectable() bool

func (*Widget) SetDimensions

func (w *Widget) SetDimensions(dimensions []gowid.IWidgetDimension, app gowid.IApp)

func (*Widget) SetFocus

func (w *Widget) SetFocus(app gowid.IApp, i int)

Tries to set at required index, will choose first selectable from there

func (*Widget) SetPreferedPosition

func (w *Widget) SetPreferedPosition(rows int, app gowid.IApp)

func (*Widget) SetSubWidgets

func (w *Widget) SetSubWidgets(widgets []gowid.IWidget, app gowid.IApp)

func (*Widget) String

func (w *Widget) String() string

func (*Widget) SubWidgetSize

func (w *Widget) SubWidgetSize(size gowid.IRenderSize, newY int, sub gowid.IWidget, dim gowid.IWidgetDimension) gowid.IRenderSize

SubWidgetSize is the size that should be used to render a child widget, based on the size used to render the parent.

func (*Widget) SubWidgets

func (w *Widget) SubWidgets() []gowid.IWidget

func (*Widget) UserInput

func (w *Widget) UserInput(ev interface{}, size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) bool

func (*Widget) Wrap

func (w *Widget) Wrap() bool

Jump to

Keyboard shortcuts

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