filterlist

package module
v0.0.0-...-707cda5 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2020 License: MIT Imports: 3 Imported by: 1

README

GoDoc

Documentation

Overview

Package filterlist provides a Filterlist and Filtergridlist duit.UI containing a duit.List/duit.Gridlist and a duit.Field search box that filters the entries in the list.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filtergridlist

type Filtergridlist struct {
	duit.Box

	Search   *duit.Field     // Search box, do not set .Keys or .Changed.
	Rows     []*duit.Gridrow // All possible values for the gridlist, as passed in initially. Gridlist.Rows will differ after searching.
	Gridlist *duit.Gridlist  // Display currently matching values. Gridlist.Changed will be called when the selection changes.
	// contains filtered or unexported fields
}

Filtergridlist is the full-height containerUI holding the search field and a scrollable gridlist.

func NewFiltergridlist

func NewFiltergridlist(dui *duit.DUI, gl *duit.Gridlist) (ui *Filtergridlist)

NewFiltergridlist creates a Filtergridlist. Initial values from the gridlist are remembered as all possible values. These are filterable through the search field, by substring match. Ctrl-f triggers completion with prefix-match.

func (*Filtergridlist) Filter

func (ui *Filtergridlist) Filter()

Filter refreshes the listed values by filtering against Search.Text.

func (*Filtergridlist) Match

func (ui *Filtergridlist) Match(row *duit.Gridrow) bool

Match returns whether s matches the current Search.Text.

type Filterlist

type Filterlist struct {
	duit.Box

	Search *duit.Field       // Search box, do not set .Keys or .Changed.
	Values []*duit.ListValue // All possible values for the list, as passed in initially. List.Values will differ after searching.
	List   *duit.List        // List displaying currently matching values. List.Changed will be called when the selection changes.
	// contains filtered or unexported fields
}

Filterlist is the full-height containerUI holding the search field and a scrollable list.

func NewFilterlist

func NewFilterlist(dui *duit.DUI, list *duit.List) (ui *Filterlist)

NewFilterlist creates a Filterlist. Initial values from the list are remembered as all possible values. These are filterable through the search field, by substring match. Ctrl-f triggers completion with prefix-match.

func (*Filterlist) Filter

func (ui *Filterlist) Filter()

Filter refreshes the listed values by filtering against Search.Text.

func (*Filterlist) Match

func (ui *Filterlist) Match(s string) bool

Match returns whether s matches the current Search.Text.

Directories

Path Synopsis
cmd
duitfiltergridlist
Duitfiltergridlist demonstrates a Filtergridlist.
Duitfiltergridlist demonstrates a Filtergridlist.
duitfilterlist
Duitfilterlist demonstrates a Filterlist.
Duitfilterlist demonstrates a Filterlist.

Jump to

Keyboard shortcuts

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