myTable

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2022 License: Apache-2.0 Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	MaxFields = 100
)

Variables

View Source
var ColumnWidth = make(map[int]float32) //SetColumnWidth(id int, width float32)

Functions

func NewHeader

func NewHeader(header Header) *tableRow

func NewResizableLabel

func NewResizableLabel(s string, look *StyleObj, options ...ResizableLabelOption) *resizableLabel

func NewTableBodyRow

func NewTableBodyRow(id int, body []string,
	handler OnSelectionHandler,
	clickHandler DoubleClickHandler,
	arr []float32, look *StyleObj) *tableRow

func NewTableHeaderRow

func NewTableHeaderRow(header []string, padding float32, handler headerOnTapHandler, dh notifyListDragHandler, arr []float32, look *StyleObj) *tableRow

Types

type DoubleClickHandler

type DoubleClickHandler func(id int)
type Header struct {
	Title       []string
	Padding     float32
	Handler     headerOnTapHandler
	DragHandler notifyListDragHandler
	Arr         []float32
	Style       *StyleObj
}

type Interface

type Interface interface {
	Header() []string
	Rows(id int) []string
	Len() int
	Sort(id int, ascend bool)
	Filter(row string, id int)
	Append(data any)
}

type LabelDraggingHandler

type LabelDraggingHandler func(d any, evt *fyne.DragEvent)

type LabelTapHandler

type LabelTapHandler func(d any, evt *fyne.PointEvent)

type MyTable

type MyTable struct {
	widget.BaseWidget
	// contains filtered or unexported fields
}

func NewTable

func NewTable(data Interface, options ...Option) (*MyTable, error)

NewTable return a new MyTable instance with the specified data

func (*MyTable) CreateRenderer

func (t *MyTable) CreateRenderer() fyne.WidgetRenderer

func (*MyTable) CurrentSelections

func (t *MyTable) CurrentSelections() (selections []bool)

CurrentSelections returns a slice of bool, one for each record; true if selected

func (*MyTable) FirstSelected

func (t *MyTable) FirstSelected() int

FirstSelected returns record index in data.Rows() of first selected row; -1 if none is selected

func (*MyTable) ScrollTo

func (t *MyTable) ScrollTo(id int)

ScrollTo make the row id as first row displayed

func (*MyTable) Scrolled

func (t *MyTable) Scrolled(evt *fyne.ScrollEvent)

Scrolled implment fyne.Scrollable interface (e.g. mouse wheel scrolling)

func (*MyTable) SetData

func (t *MyTable) SetData(d Interface)

func (*MyTable) SetSelection

func (t *MyTable) SetSelection(rowid int, selected bool)

SetSelection select the specified row if selected is true; unselect it otherwise; the rowid is the index of Interface.Item()

func (*MyTable) TypedKey

func (t *MyTable) TypedKey(evt *fyne.KeyEvent)

TypedKey could be linked to Parent window keyevent by using window.Canvas().SetOnTypedKey()

type OnSelectionHandler

type OnSelectionHandler func(id int, selected bool)

type Option

type Option func(table *MyTable)

func WithBodyLook

func WithBodyLook(style *StyleObj) Option

func WithDoubleClickHandler

func WithDoubleClickHandler(h DoubleClickHandler) Option

WithDoubleClickHandler specifies h as a handler function gets called when a row is double clicked

func WithHeaderStyle

func WithHeaderStyle(style *StyleObj) Option

func WithMultiSelections

func WithMultiSelections() Option

func WithSelectionHandler

func WithSelectionHandler(h OnSelectionHandler) Option

WithSelectionHandler specifies h as a handler function gets called when a row is selected

type ResizableLabelOption

type ResizableLabelOption func(label *resizableLabel)

func WithDoubleTapHandler

func WithDoubleTapHandler(h LabelTapHandler) ResizableLabelOption

func WithMetaData

func WithMetaData(d any) ResizableLabelOption

type RowRender

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

func (*RowRender) BackgroundColor

func (r *RowRender) BackgroundColor() color.Color

func (*RowRender) Destroy

func (r *RowRender) Destroy()

func (*RowRender) Layout

func (r *RowRender) Layout(layoutSize fyne.Size)

func (*RowRender) MinSize

func (r *RowRender) MinSize() fyne.Size

func (*RowRender) Objects

func (r *RowRender) Objects() []fyne.CanvasObject

func (*RowRender) Refresh

func (r *RowRender) Refresh()

type StyleObj

type StyleObj struct {
	TextSize  float32
	TextColor color.Color
	TextStyle fyne.TextStyle
	Alignment fyne.TextAlign
}

type TableRender

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

func (*TableRender) BackgroundColor

func (r *TableRender) BackgroundColor() color.Color

func (*TableRender) Destroy

func (r *TableRender) Destroy()

func (*TableRender) Layout

func (r *TableRender) Layout(layoutsize fyne.Size)

func (*TableRender) MinSize

func (r *TableRender) MinSize() fyne.Size

func (*TableRender) Objects

func (r *TableRender) Objects() []fyne.CanvasObject

func (*TableRender) Refresh

func (r *TableRender) Refresh()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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