copymodetable

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package copymodetable provides a wrapper around a table that supports copy mode. The implementation currently supports clipping a whole row and also the whole table by providing these as interfaces to the New function. It's easy to imagine supporting narrowing the copy selection to a single column, but I don't need that yet...

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ICopyModeTableNeeds added in v2.1.0

type ICopyModeTableNeeds interface {
	gowid.IWidget
	list.IWalker
	table.IGoToMiddle
	withscrollbar.IScrollOneLine
	withscrollbar.IScrollOnePage
	CurrentRow() int
	SetCurrentRow(table.Position)
	Model() table.IModel
	SetModel(table.IModel, gowid.IApp)
	Cache() *lru.Cache
	OnFocusChanged(gowid.IWidgetChangedCallback)
}

type IRowCopier

type IRowCopier interface {
	CopyRow(id table.RowId) []gowid.ICopyResult
}

type ITableCopier

type ITableCopier interface {
	CopyTable() []gowid.ICopyResult
}

type Widget

type Widget struct {
	ICopyModeTableNeeds
	RowClip IRowCopier   // Knows how to make a clip result set given a row
	AllClip ITableCopier // Knows how to make a clip result set from the whole table
	// contains filtered or unexported fields
}

func New

func New(wrapped ICopyModeTableNeeds, rowClip IRowCopier, allClip ITableCopier, name string, clip gowid.IClipboardSelected) *Widget

func (*Widget) Clips

func (w *Widget) Clips(app gowid.IApp) []gowid.ICopyResult

func (*Widget) CopyModeLevels

func (w *Widget) CopyModeLevels() int

func (*Widget) ID

func (w *Widget) ID() interface{}

The app stores which widget claims copy mode, and so each widget must check whether it's the one when it render itself.

func (*Widget) Render

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

func (*Widget) SubWidget

func (w *Widget) SubWidget() gowid.IWidget

func (*Widget) UserInput

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

Jump to

Keyboard shortcuts

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