widget

package
v0.0.0-...-bf1bca9 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: BSD-3-Clause Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ASCIIEntry

func ASCIIEntry() *wdg.Entry

func AlphaEntry

func AlphaEntry() *wdg.Entry

func AlphaNumericEntry

func AlphaNumericEntry() *wdg.Entry

func AlphaUnicodeEntry

func AlphaUnicodeEntry() *wdg.Entry

func AlphaUnicodeNumericEntry

func AlphaUnicodeNumericEntry() *wdg.Entry

func Base64Entry

func Base64Entry() *wdg.Entry

func Base64URLEntry

func Base64URLEntry() *wdg.Entry

func BicEntry

func BicEntry() *wdg.Entry

func BtcAddressEntry

func BtcAddressEntry() *wdg.Entry

func BtcAddressLowerBech32Entry

func BtcAddressLowerBech32Entry() *wdg.Entry

func BtcAddressUpperBech32Entry

func BtcAddressUpperBech32Entry() *wdg.Entry

func Cnregion

func Cnregion() fyne.CanvasObject

func DataURIEntry

func DataURIEntry() *wdg.Entry

func E164Entry

func E164Entry() *wdg.Entry

func EmailEntry

func EmailEntry() *wdg.Entry

func EthAddressEntry

func EthAddressEntry() *wdg.Entry

func EthAddressLowerEntry

func EthAddressLowerEntry() *wdg.Entry

func EthAddressUpperEntry

func EthAddressUpperEntry() *wdg.Entry

func Filetree

func Filetree(tree *widget.Tree, root string) *widget.Tree

Filetree 根据路径root构建树

func FqdnRFC1123Entry

func FqdnRFC1123Entry() *wdg.Entry

func HTMLEncodedEntry

func HTMLEncodedEntry() *wdg.Entry

func HTMLEntry

func HTMLEntry() *wdg.Entry

func HexColorEntry

func HexColorEntry() *wdg.Entry

func HexToRGBA

func HexToRGBA(x string) color.NRGBA

HexToRGBA converts a color expressed as hexadecimal string to RGBA color.

func HexadecimalEntry

func HexadecimalEntry() *wdg.Entry

func HostnameRFC1123Entry

func HostnameRFC1123Entry() *wdg.Entry

func HostnameRFC952Entry

func HostnameRFC952Entry() *wdg.Entry

func HslEntry

func HslEntry() *wdg.Entry

func HslaEntry

func HslaEntry() *wdg.Entry

func ISBN10Entry

func ISBN10Entry() *wdg.Entry

func ISBN13Entry

func ISBN13Entry() *wdg.Entry

func LatitudeEntry

func LatitudeEntry() *wdg.Entry

func List

func List(items ...interface{}) *widget.List

List display data list that can be converted to string 用列表控件显示能转换成字符串的数据列表

func List2

func List2(items ...fmt.Stringer) *widget.List

List display data list that can be converted to string 用列表控件显示实现fmt.Stringer接口的数据列表

func LongitudeEntry

func LongitudeEntry() *wdg.Entry

func MultibyteEntry

func MultibyteEntry() *wdg.Entry

func NewOpenFile

func NewOpenFile(data binding.String, lbl string, filters []string,
	w fyne.Window) *fyne.Container

NewOpenFile bdFilePath := binding.NewString() filters:=[]string{".jpg",".jpeg",".png"} filters:=[]string{".zip",".rar",".tar"} openFile := NewOpenFile(bdFilePath,filters w)

func NewOpenFolder

func NewOpenFolder(data binding.String, lbl string, w fyne.Window) *fyne.Container

NewOpenFolder 打开目录 NewOpenFolder bdFolderPath := binding.NewString() openFolder := NewOpenFolder(outData, w)

func NewOpenFolder2

func NewOpenFolder2(data binding.String, fn func(), w fyne.Window) *fyne.Container

NewOpenFolder2 打开目录并执行传入的操作 fn

func NumberEntry

func NumberEntry() *wdg.Entry

func NumericEntry

func NumericEntry() *wdg.Entry

func PrintableASCIIEntry

func PrintableASCIIEntry() *wdg.Entry

func RgbEntry

func RgbEntry() *wdg.Entry

func RgbaEntry

func RgbaEntry() *wdg.Entry

func SSNEntry

func SSNEntry() *wdg.Entry

func SplitParamsEntry

func SplitParamsEntry() *wdg.Entry

func ToNRGBA

func ToNRGBA(c color.Color) (r, g, b, a int)

ToNRGBA converts a color to RGBA values which are not premultiplied, unlike color.RGBA().

func URLEncodedEntry

func URLEncodedEntry() *wdg.Entry

func UUID3Entry

func UUID3Entry() *wdg.Entry

func UUID3RFC4122Entry

func UUID3RFC4122Entry() *wdg.Entry

func UUID4Entry

func UUID4Entry() *wdg.Entry

func UUID4RFC4122Entry

func UUID4RFC4122Entry() *wdg.Entry

func UUID5Entry

func UUID5Entry() *wdg.Entry

func UUID5RFC4122Entry

func UUID5RFC4122Entry() *wdg.Entry

func UUIDEntry

func UUIDEntry() *wdg.Entry

func UUIDRFC4122Entry

func UUIDRFC4122Entry() *wdg.Entry

func Ziptree

func Ziptree(root string) *widget.Tree

Ziptree 构建zip压缩包文件树 root zip文件路径

Types

type Axis

type Axis struct {
	widget.BaseWidget

	W, H     float32
	Data     []float32
	X        *canvas.Line
	Y        *canvas.Line
	Line1    *canvas.Line
	P1       *canvas.Circle
	T1       *canvas.Text
	Points   []fyne.Position
	MousePos fyne.Position
	Line1P1  fyne.Position
	Line1P2  fyne.Position
	Center   fyne.Position
	ChartCtn *fyne.Container
	// contains filtered or unexported fields
}

Axis is a widget for displaying a separator with themeable color.

Since: 1.4

func NewAxis

func NewAxis() *Axis

NewAxis creates a new separator.

Since: 1.4

func (*Axis) CreateRenderer

func (s *Axis) CreateRenderer() fyne.WidgetRenderer

CreateRenderer returns a new renderer for the separator.

Implements: fyne.Widget

func (*Axis) Do

func (s *Axis) Do(fn func(*Axis)) *Axis

axis := wdg.NewAxis().Lines([]float32{120, 20, 30, 40, 60, 180, 240})

func (s *Axis) Lines(data []float32) *Axis {
	s.Data = data
	s.ChartCtn.Objects = make([]fyne.CanvasObject, len(data))
	for i := range data {
		line := canvas.NewLine(colornames.Chocolate)
		line.StrokeWidth = 4
		s.ChartCtn.Objects[i] = line
	}
	return s
}

func (*Axis) MinSize

func (s *Axis) MinSize() fyne.Size

MinSize returns the minimal size of the separator.

Implements: fyne.Widget

func (*Axis) MouseIn

func (s *Axis) MouseIn(*desktop.MouseEvent)

func (*Axis) MouseMoved

func (s *Axis) MouseMoved(e *desktop.MouseEvent)

MouseMoved is called when a desktop pointer hovers over the widget

func (*Axis) MouseOut

func (s *Axis) MouseOut()

MouseOut is called when a desktop pointer exits the widget

func (*Axis) Tapped

func (s *Axis) Tapped(e *fyne.PointEvent)

type Bar

type Bar struct {
	widget.BaseWidget
	Txt1       *canvas.Text
	Txt2       *canvas.Text
	Bg         *canvas.Rectangle
	OnTapped   func(*Bar) `json:"-"`
	OnHoverIn  func()     `json:"-"`
	OnHoverOut func()     `json:"-"`
	Data       interface{}
}

Bar is a widget for displaying a separator with themeable color.

Since: 1.4

func NewBar

func NewBar() *Bar

NewBar creates a new separator.

Since: 1.4

func (*Bar) Click

func (me *Bar) Click(fn func(*Bar)) *Bar

func (*Bar) CreateRenderer

func (me *Bar) CreateRenderer() fyne.WidgetRenderer

CreateRenderer returns a new renderer for the separator.

Implements: fyne.Widget

func (*Bar) Do

func (me *Bar) Do(fn func(t *Bar)) *Bar

func (*Bar) FillColor

func (me *Bar) FillColor(c color.Color) *Bar

func (*Bar) MinSize

func (me *Bar) MinSize() fyne.Size

MinSize returns the minimal size of the separator.

Implements: fyne.Widget

func (*Bar) MouseIn

func (b *Bar) MouseIn(*desktop.MouseEvent)

MouseIn is called when a desktop pointer enters the widget

func (*Bar) MouseMoved

func (b *Bar) MouseMoved(*desktop.MouseEvent)

MouseMoved is called when a desktop pointer hovers over the widget

func (*Bar) MouseOut

func (b *Bar) MouseOut()

MouseOut is called when a desktop pointer exits the widget

func (*Bar) SData

func (me *Bar) SData(d interface{}) *Bar

func (*Bar) SText1

func (me *Bar) SText1(t string) *Bar

func (*Bar) StrokeColor

func (me *Bar) StrokeColor(c color.Color) *Bar

func (*Bar) StrokeWidth

func (me *Bar) StrokeWidth(w float32) *Bar

func (*Bar) Style

func (me *Bar) Style(style fyne.TextStyle) *Bar

Style fyne.TextStyle{Bold: true} fyne.TextStyle{Italic: true} fyne.TextStyle{Monospace: true} fyne.TextStyle{TabWidth: 10}

func (*Bar) Tapped

func (b *Bar) Tapped(*fyne.PointEvent)

func (*Bar) TextAlign

func (me *Bar) TextAlign(align fyne.TextAlign) *Bar

TextAlign fyne.TextAlignLeading , fyne.TextAlignCenter , fyne.TextAlignTrailing

func (*Bar) TextColor1

func (me *Bar) TextColor1(c color.Color) *Bar

func (*Bar) TextColor2

func (me *Bar) TextColor2(c color.Color) *Bar

func (*Bar) TextSize

func (me *Bar) TextSize(size float32) *Bar

type BaseRenderer

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

BaseRenderer is a renderer base providing the most common implementations of a part of the widget.Renderer interface.

func NewBaseRenderer

func NewBaseRenderer(objects []fyne.CanvasObject) BaseRenderer

NewBaseRenderer creates a new BaseRenderer.

func (*BaseRenderer) Destroy

func (r *BaseRenderer) Destroy()

Destroy does nothing in the base implementation.

Implements: fyne.WidgetRenderer

func (*BaseRenderer) Objects

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

Objects returns the objects that should be rendered.

Implements: fyne.WidgetRenderer

func (*BaseRenderer) SetObjects

func (r *BaseRenderer) SetObjects(objects []fyne.CanvasObject)

SetObjects updates the objects of the renderer.

type BtnX

type BtnX struct {
	// widget.BaseWidget
	widget.DisableableWidget

	// 背景
	Bg *canvas.Rectangle
	// 文本
	Textc *canvas.Text
	// contains filtered or unexported fields
}

BtnX is a widget for displaying a separator with themeable color.

Since: 1.4

func NewBtnX

func NewBtnX(text string) *BtnX

NewBtnX creates a new separator.

Since: 1.4

func (*BtnX) Bc

func (b *BtnX) Bc(c color.Color)

设置该控件的背景颜色

func (*BtnX) CreateRenderer

func (s *BtnX) CreateRenderer() fyne.WidgetRenderer

CreateRenderer returns a new renderer for the separator.

Implements: fyne.Widget

func (*BtnX) Cursor

func (b *BtnX) Cursor() desktop.Cursor

Cursor returns the cursor type of this widget

func (*BtnX) Do

func (s *BtnX) Do(f func(*BtnX)) *BtnX

func (*BtnX) DoubleTapped

func (b *BtnX) DoubleTapped(*fyne.PointEvent)

func (*BtnX) GetT

func (b *BtnX) GetT() string

func (*BtnX) MinSize

func (s *BtnX) MinSize() fyne.Size

MinSize returns the minimal size of the separator.

Implements: fyne.Widget

func (*BtnX) MouseIn

func (b *BtnX) MouseIn(*desktop.MouseEvent)

MouseIn is called when a desktop pointer enters the widget

func (*BtnX) MouseMoved

func (b *BtnX) MouseMoved(*desktop.MouseEvent)

MouseMoved is called when a desktop pointer hovers over the widget

func (*BtnX) MouseOut

func (b *BtnX) MouseOut()

MouseOut is called when a desktop pointer exits the widget

func (*BtnX) Msin

func (b *BtnX) Msin(fn func()) *BtnX

func (*BtnX) T

func (b *BtnX) T(t string)

设置该控件的文本

func (*BtnX) Tap

func (b *BtnX) Tap(fn func()) *BtnX

func (*BtnX) Tap2

func (b *BtnX) Tap2(fn func()) *BtnX

func (*BtnX) Tap3

func (b *BtnX) Tap3(fn func(e *fyne.PointEvent)) *BtnX

func (*BtnX) Tapped

func (b *BtnX) Tapped(*fyne.PointEvent)

Tapped is called when a pointer tapped event is captured and triggers any tap handler

func (*BtnX) TappedSecondary

func (b *BtnX) TappedSecondary(e *fyne.PointEvent)

func (*BtnX) Tc

func (b *BtnX) Tc(c color.Color)

设置该控件的文本颜色

type Calendar

type Calendar struct {
	widget.DisableableWidget

	// Alignment sets the text alignment of the select and its list of options.
	//
	// Since: 2.1
	Alignment fyne.TextAlign

	Selected    string
	Options     []string
	PlaceHolder string

	OnChanged func(string) `json:"-"`

	DefaultCalendar *gocalendar.Calendar
	// contains filtered or unexported fields
}

Calendar widget has a list of options, with the current one shown, and triggers an event func when clicked

func NewCalendar

func NewCalendar() *Calendar

NewCalendar creates a new select widget with the set list of options and changes handler

func (*Calendar) ClearSelected

func (s *Calendar) ClearSelected()

ClearSelected clears the current option of the select widget. After clearing the current option, the Calendar widget's PlaceHolder will be displayed.

func (*Calendar) CreateRenderer

func (s *Calendar) CreateRenderer() fyne.WidgetRenderer

CreateRenderer is a private method to Fyne which links this widget to its renderer

func (*Calendar) FocusGained

func (s *Calendar) FocusGained()

FocusGained is called after this Calendar has gained focus.

Implements: fyne.Focusable

func (*Calendar) FocusLost

func (s *Calendar) FocusLost()

FocusLost is called after this Calendar has lost focus.

Implements: fyne.Focusable

func (*Calendar) Hide

func (s *Calendar) Hide()

Hide hides the select.

Implements: fyne.Widget

func (*Calendar) MinSize

func (s *Calendar) MinSize() fyne.Size

MinSize returns the size that this widget should not shrink below

func (*Calendar) MouseIn

func (s *Calendar) MouseIn(*desktop.MouseEvent)

MouseIn is called when a desktop pointer enters the widget

func (*Calendar) MouseMoved

func (s *Calendar) MouseMoved(*desktop.MouseEvent)

MouseMoved is called when a desktop pointer hovers over the widget

func (*Calendar) MouseOut

func (s *Calendar) MouseOut()

MouseOut is called when a desktop pointer exits the widget

func (*Calendar) Move

func (s *Calendar) Move(pos fyne.Position)

Move changes the relative position of the select.

Implements: fyne.Widget

func (*Calendar) RefreshItem

func (s *Calendar) RefreshItem() *Calendar

func (*Calendar) Resize

func (s *Calendar) Resize(size fyne.Size)

Resize sets a new size for a widget. Note this should not be used if the widget is being managed by a Layout within a Container.

func (*Calendar) SelectedIndex

func (s *Calendar) SelectedIndex() int

SelectedIndex returns the index value of the currently selected item in Options list. It will return -1 if there is no selection.

func (*Calendar) SetItems

func (me *Calendar) SetItems() *Calendar

func (*Calendar) SetSelected

func (s *Calendar) SetSelected(text string)

SetSelected sets the current option of the select widget

func (*Calendar) SetSelectedIndex

func (s *Calendar) SetSelectedIndex(index int)

SetSelectedIndex will set the Selected option from the value in Options list at index position.

func (*Calendar) Tapped

func (s *Calendar) Tapped(*fyne.PointEvent)

Tapped is called when a pointer tapped event is captured and triggers any tap handler

func (*Calendar) TypedKey

func (s *Calendar) TypedKey(event *fyne.KeyEvent)

TypedKey is called if a key event happens while this Calendar is focused.

Implements: fyne.Focusable

func (*Calendar) TypedRune

func (s *Calendar) TypedRune(_ rune)

TypedRune is called if a text event happens while this Calendar is focused.

Implements: fyne.Focusable

type CircleButton

type CircleButton struct {
	widget.BaseWidget
	Txt1       *canvas.Text
	Background *canvas.Circle
	OnTapped   func(*CircleButton) `json:"-"`
	OnHoverIn  func()              `json:"-"`
	OnHoverOut func()              `json:"-"`
	Data       interface{}
}

CircleButton is a widget for displaying a separator with themeable color.

Since: 1.4

func NewCircleButton

func NewCircleButton() *CircleButton

NewCircleButton creates a new separator.

Since: 1.4

func (*CircleButton) BgFillColor

func (me *CircleButton) BgFillColor(c color.Color) *CircleButton

func (*CircleButton) BgStrokeColor

func (me *CircleButton) BgStrokeColor(c color.Color) *CircleButton

func (*CircleButton) Click

func (me *CircleButton) Click(fn func(*CircleButton)) *CircleButton

func (*CircleButton) CreateRenderer

func (me *CircleButton) CreateRenderer() fyne.WidgetRenderer

CreateRenderer returns a new renderer for the separator.

Implements: fyne.Widget

func (*CircleButton) Cursor

func (b *CircleButton) Cursor() desktop.Cursor

Cursor returns the cursor type of this widget

func (*CircleButton) Do

func (me *CircleButton) Do(fn func(t *CircleButton)) *CircleButton

func (*CircleButton) MinSize

func (me *CircleButton) MinSize() fyne.Size

MinSize returns the minimal size of the separator.

Implements: fyne.Widget

func (*CircleButton) MouseIn

func (b *CircleButton) MouseIn(*desktop.MouseEvent)

MouseIn is called when a desktop pointer enters the widget

func (*CircleButton) MouseMoved

func (b *CircleButton) MouseMoved(*desktop.MouseEvent)

MouseMoved is called when a desktop pointer hovers over the widget

func (*CircleButton) MouseOut

func (b *CircleButton) MouseOut()

MouseOut is called when a desktop pointer exits the widget

func (*CircleButton) SData

func (me *CircleButton) SData(d interface{}) *CircleButton

func (*CircleButton) SText1

func (me *CircleButton) SText1(t string) *CircleButton

func (*CircleButton) Style

func (me *CircleButton) Style(style fyne.TextStyle) *CircleButton

Style fyne.TextStyle{Bold: true} fyne.TextStyle{Italic: true} fyne.TextStyle{Monospace: true} fyne.TextStyle{TabWidth: 10}

func (*CircleButton) Tapped

func (b *CircleButton) Tapped(*fyne.PointEvent)

func (*CircleButton) TextAlign

func (me *CircleButton) TextAlign(align fyne.TextAlign) *CircleButton

TextAlign fyne.TextAlignLeading , fyne.TextAlignCenter , fyne.TextAlignTrailing

func (*CircleButton) TextColor1

func (me *CircleButton) TextColor1(c color.Color) *CircleButton

func (*CircleButton) TextSize

func (me *CircleButton) TextSize(size float32) *CircleButton

type ClickImage

type ClickImage struct {
	widget.BaseWidget
	Img         *canvas.Image
	PlaceHolder *canvas.Text
	OnTapped    func(*ClickImage)                        `json:"-"`
	OnTapped2   func(me *ClickImage, e *fyne.PointEvent) `json:"-"`
}

ClickImage is a widget for displaying a separator with themeable color.

Since: 1.4

func NewClickImage

func NewClickImage() *ClickImage

NewClickImage creates a new separator.

Since: 1.4

func (*ClickImage) CreateRenderer

func (s *ClickImage) CreateRenderer() fyne.WidgetRenderer

CreateRenderer returns a new renderer for the separator.

Implements: fyne.Widget

func (*ClickImage) Cursor

func (b *ClickImage) Cursor() desktop.Cursor

Cursor returns the cursor type of this widget

func (*ClickImage) Do

func (s *ClickImage) Do(fn func(t *ClickImage)) *ClickImage

func (*ClickImage) MinSize

func (s *ClickImage) MinSize() fyne.Size

MinSize returns the minimal size of the separator.

Implements: fyne.Widget

func (*ClickImage) SetImage

func (s *ClickImage) SetImage(img image.Image) *ClickImage

func (*ClickImage) Tapped

func (b *ClickImage) Tapped(*fyne.PointEvent)

打开文件选择对话框,选择需要显示的图片 使用系统原生对话框 https://hub.fastgit.xyz/ncruces/zenity

func (*ClickImage) Tapped1

func (b *ClickImage) Tapped1(*fyne.PointEvent)

打开文件选择对话框,选择需要显示的图片 使用系统原生对话框 "github.com/sqweek/dialog"

func (*ClickImage) TappedSecondary

func (b *ClickImage) TappedSecondary(e *fyne.PointEvent)

type Clock

type Clock struct {
	widget.BaseWidget
	TxtTime    *canvas.Text
	Txt1       *canvas.Text
	Txt2       *canvas.Text
	Txt3       *canvas.Text
	Txt4       *canvas.Text
	Txt5       *canvas.Text
	Txt6       *canvas.Text
	Txt7       *canvas.Text
	Txt8       *canvas.Text
	Txt9       *canvas.Text
	Txt10      *canvas.Text
	Txt11      *canvas.Text
	Txt12      *canvas.Text
	Background *canvas.Circle
	Hour       *canvas.Line
	Minute     *canvas.Line
	Second     *canvas.Line
	OnTapped   func(*Clock) `json:"-"`
	OnHoverIn  func()       `json:"-"`
	OnHoverOut func()       `json:"-"`
	Data       interface{}
}

Clock is a widget for displaying a separator with themeable color.

Since: 1.4

func NewClock

func NewClock() *Clock

NewClock creates a new separator. color reference https://www.58pic.com/peisebiao/ Since: 1.4

func (*Clock) BgFillColor

func (me *Clock) BgFillColor(c color.Color) *Clock

func (*Clock) BgStrokeColor

func (me *Clock) BgStrokeColor(c color.Color) *Clock

func (*Clock) Click

func (me *Clock) Click(fn func(*Clock)) *Clock

func (*Clock) CreateRenderer

func (me *Clock) CreateRenderer() fyne.WidgetRenderer

CreateRenderer returns a new renderer for the separator.

Implements: fyne.Widget

func (*Clock) Do

func (me *Clock) Do(fn func(t *Clock)) *Clock

func (*Clock) Go

func (t *Clock) Go()

func (*Clock) MinSize

func (me *Clock) MinSize() fyne.Size

MinSize returns the minimal size of the separator.

Implements: fyne.Widget

func (*Clock) MouseIn

func (b *Clock) MouseIn(*desktop.MouseEvent)

MouseIn is called when a desktop pointer enters the widget

func (*Clock) MouseMoved

func (b *Clock) MouseMoved(*desktop.MouseEvent)

MouseMoved is called when a desktop pointer hovers over the widget

func (*Clock) MouseOut

func (b *Clock) MouseOut()

MouseOut is called when a desktop pointer exits the widget

func (*Clock) SData

func (me *Clock) SData(d interface{}) *Clock

func (*Clock) SText1

func (me *Clock) SText1(t string) *Clock

func (*Clock) Style

func (me *Clock) Style(style fyne.TextStyle) *Clock

Style fyne.TextStyle{Bold: true} fyne.TextStyle{Italic: true} fyne.TextStyle{Monospace: true} fyne.TextStyle{TabWidth: 10}

func (*Clock) Tapped

func (b *Clock) Tapped(*fyne.PointEvent)

func (*Clock) TextAlign

func (me *Clock) TextAlign(align fyne.TextAlign) *Clock

TextAlign fyne.TextAlignLeading , fyne.TextAlignCenter , fyne.TextAlignTrailing

func (*Clock) TextColor1

func (me *Clock) TextColor1(c color.Color) *Clock

func (*Clock) TextSize

func (me *Clock) TextSize(size float32) *Clock

type FileDialogItem

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

func NewFileItem

func NewFileItem(location fyne.URI, dir bool) *FileDialogItem

func (*FileDialogItem) CreateRenderer

func (i *FileDialogItem) CreateRenderer() fyne.WidgetRenderer

func (*FileDialogItem) MouseIn

func (i *FileDialogItem) MouseIn(*desktop.MouseEvent)

func (*FileDialogItem) MouseMoved

func (i *FileDialogItem) MouseMoved(*desktop.MouseEvent)

func (*FileDialogItem) MouseOut

func (i *FileDialogItem) MouseOut()

func (*FileDialogItem) SetLoc

func (i *FileDialogItem) SetLoc(location fyne.URI) *FileDialogItem

func (*FileDialogItem) Tapped

func (i *FileDialogItem) Tapped(_ *fyne.PointEvent)

type Orientation

type Orientation int

Orientation controls the horizontal/vertical layout of a widget

const (
	Horizontal Orientation = 0
	Vertical   Orientation = 1
)

Orientation constants to control widget layout

type Select

type Select struct {
	widget.DisableableWidget

	// Alignment sets the text alignment of the select and its list of options.
	//
	// Since: 2.1
	Alignment   fyne.TextAlign
	Selected    string
	Options     []string
	PlaceHolder string

	OnChanged func(string) `json:"-"`
	// contains filtered or unexported fields
}

Select widget has a list of options, with the current one shown, and triggers an event func when clicked

func NewSelect

func NewSelect(options []string,
	changed func(string)) *Select

NewSelect creates a new select widget with the set list of options and changes handler

func (*Select) ClearSelected

func (s *Select) ClearSelected()

ClearSelected clears the current option of the select widget. After clearing the current option, the Select widget's PlaceHolder will be displayed.

func (*Select) Col

func (s *Select) Col(num int) *Select

func (*Select) CreateRenderer

func (s *Select) CreateRenderer() fyne.WidgetRenderer

CreateRenderer is a private method to Fyne which links this widget to its renderer

func (*Select) CurPage

func (s *Select) CurPage(curPage int) *Select

func (*Select) Do

func (s *Select) Do(fn func(*Select)) *Select

func (*Select) FocusGained

func (s *Select) FocusGained()

FocusGained is called after this Select has gained focus.

Implements: fyne.Focusable

func (*Select) FocusLost

func (s *Select) FocusLost()

FocusLost is called after this Select has lost focus.

Implements: fyne.Focusable

func (*Select) Hide

func (s *Select) Hide()

Hide hides the select.

Implements: fyne.Widget

func (*Select) MinSize

func (s *Select) MinSize() fyne.Size

MinSize returns the size that this widget should not shrink below

func (*Select) MouseIn

func (s *Select) MouseIn(*desktop.MouseEvent)

MouseIn is called when a desktop pointer enters the widget

func (*Select) MouseMoved

func (s *Select) MouseMoved(*desktop.MouseEvent)

MouseMoved is called when a desktop pointer hovers over the widget

func (*Select) MouseOut

func (s *Select) MouseOut()

MouseOut is called when a desktop pointer exits the widget

func (*Select) Move

func (s *Select) Move(pos fyne.Position)

Move changes the relative position of the select.

Implements: fyne.Widget

func (*Select) RefreshItem

func (s *Select) RefreshItem()

func (*Select) Resize

func (s *Select) Resize(size fyne.Size)

Resize sets a new size for a widget. Note this should not be used if the widget is being managed by a Layout within a Container.

func (*Select) Row

func (s *Select) Row(num int) *Select

func (*Select) SelectedIndex

func (s *Select) SelectedIndex() int

SelectedIndex returns the index value of the currently selected item in Options list. It will return -1 if there is no selection.

func (*Select) SetSelected

func (s *Select) SetSelected(text string)

SetSelected sets the current option of the select widget

func (*Select) SetSelectedIndex

func (s *Select) SetSelectedIndex(index int)

SetSelectedIndex will set the Selected option from the value in Options list at index position.

func (*Select) Tapped

func (s *Select) Tapped(*fyne.PointEvent)

Tapped is called when a pointer tapped event is captured and triggers any tap handler

func (*Select) TypedKey

func (s *Select) TypedKey(event *fyne.KeyEvent)

TypedKey is called if a key event happens while this Select is focused.

Implements: fyne.Focusable

func (*Select) TypedRune

func (s *Select) TypedRune(_ rune)

TypedRune is called if a text event happens while this Select is focused.

Implements: fyne.Focusable

type SelectG

type SelectG struct {
	widget.DisableableWidget

	// Alignment sets the text alignment of the select and its list of options.
	//
	// Since: 2.1
	Alignment   fyne.TextAlign
	Selected    cnregion.Region
	Options     []cnregion.Region
	PlaceHolder string

	OnChanged func(*SelectG) `json:"-"`
	// contains filtered or unexported fields
}

Select widget has a list of options, with the current one shown, and triggers an event func when clicked

func NewSelectG

func NewSelectG(options []cnregion.Region) *SelectG

NewSelect creates a new select widget with the set list of options and changes handler

func (*SelectG) Change

func (s *SelectG) Change(fn func(*SelectG)) *SelectG

func (*SelectG) ClearSelected

func (s *SelectG) ClearSelected()

ClearSelected clears the current option of the select widget. After clearing the current option, the Select widget's PlaceHolder will be displayed.

func (*SelectG) Col

func (s *SelectG) Col(num int) *SelectG

func (*SelectG) CreateRenderer

func (s *SelectG) CreateRenderer() fyne.WidgetRenderer

CreateRenderer is a private method to Fyne which links this widget to its renderer

func (*SelectG) CurPage

func (s *SelectG) CurPage(curPage int) *SelectG

func (*SelectG) Do

func (s *SelectG) Do(fn func(*SelectG)) *SelectG

func (*SelectG) FocusGained

func (s *SelectG) FocusGained()

FocusGained is called after this Select has gained focus.

Implements: fyne.Focusable

func (*SelectG) FocusLost

func (s *SelectG) FocusLost()

FocusLost is called after this Select has lost focus.

Implements: fyne.Focusable

func (*SelectG) Hide

func (s *SelectG) Hide()

Hide hides the select.

Implements: fyne.Widget

func (*SelectG) MinSize

func (s *SelectG) MinSize() fyne.Size

MinSize returns the size that this widget should not shrink below

func (*SelectG) MouseIn

func (s *SelectG) MouseIn(*desktop.MouseEvent)

MouseIn is called when a desktop pointer enters the widget

func (*SelectG) MouseMoved

func (s *SelectG) MouseMoved(*desktop.MouseEvent)

MouseMoved is called when a desktop pointer hovers over the widget

func (*SelectG) MouseOut

func (s *SelectG) MouseOut()

MouseOut is called when a desktop pointer exits the widget

func (*SelectG) Move

func (s *SelectG) Move(pos fyne.Position)

Move changes the relative position of the select.

Implements: fyne.Widget

func (*SelectG) RefreshItem

func (s *SelectG) RefreshItem()

func (*SelectG) Resize

func (s *SelectG) Resize(size fyne.Size)

Resize sets a new size for a widget. Note this should not be used if the widget is being managed by a Layout within a Container.

func (*SelectG) Row

func (s *SelectG) Row(num int) *SelectG

func (*SelectG) SelectedIndex

func (s *SelectG) SelectedIndex() int

SelectedIndex returns the index value of the currently selected item in Options list. It will return -1 if there is no selection.

func (*SelectG) SetOptions

func (s *SelectG) SetOptions(opts []cnregion.Region) *SelectG

func (*SelectG) SetSelected

func (s *SelectG) SetSelected(text cnregion.Region)

SetSelected sets the current option of the select widget

func (*SelectG) SetSelectedIndex

func (s *SelectG) SetSelectedIndex(index int)

SetSelectedIndex will set the Selected option from the value in Options list at index position.

func (*SelectG) Tapped

func (s *SelectG) Tapped(*fyne.PointEvent)

Tapped is called when a pointer tapped event is captured and triggers any tap handler

func (*SelectG) TypedKey

func (s *SelectG) TypedKey(event *fyne.KeyEvent)

TypedKey is called if a key event happens while this Select is focused.

Implements: fyne.Focusable

func (*SelectG) TypedRune

func (s *SelectG) TypedRune(_ rune)

TypedRune is called if a text event happens while this Select is focused.

Implements: fyne.Focusable

type SelectGeneric

type SelectGeneric struct {
	widget.DisableableWidget

	// Alignment sets the text alignment of the select and its list of options.
	//
	// Since: 2.1
	Alignment   fyne.TextAlign
	Selected    item
	Options     []item
	PlaceHolder string

	OnChanged func(*SelectGeneric) `json:"-"`
	// contains filtered or unexported fields
}

Select widget has a list of options, with the current one shown, and triggers an event func when clicked

func NewSelectGeneric

func NewSelectGeneric(options []item) *SelectGeneric

NewSelect creates a new select widget with the set list of options and changes handler

func (*SelectGeneric) Change

func (s *SelectGeneric) Change(fn func(*SelectGeneric)) *SelectGeneric

func (*SelectGeneric) ClearSelected

func (s *SelectGeneric) ClearSelected()

ClearSelected clears the current option of the select widget. After clearing the current option, the Select widget's PlaceHolder will be displayed.

func (*SelectGeneric) Col

func (s *SelectGeneric) Col(num int) *SelectGeneric

func (*SelectGeneric) CreateRenderer

func (s *SelectGeneric) CreateRenderer() fyne.WidgetRenderer

CreateRenderer is a private method to Fyne which links this widget to its renderer

func (*SelectGeneric) CurPage

func (s *SelectGeneric) CurPage(curPage int) *SelectGeneric

func (*SelectGeneric) Do

func (s *SelectGeneric) Do(fn func(*SelectGeneric)) *SelectGeneric

func (*SelectGeneric) FocusGained

func (s *SelectGeneric) FocusGained()

FocusGained is called after this Select has gained focus.

Implements: fyne.Focusable

func (*SelectGeneric) FocusLost

func (s *SelectGeneric) FocusLost()

FocusLost is called after this Select has lost focus.

Implements: fyne.Focusable

func (*SelectGeneric) Hide

func (s *SelectGeneric) Hide()

Hide hides the select.

Implements: fyne.Widget

func (*SelectGeneric) MinSize

func (s *SelectGeneric) MinSize() fyne.Size

MinSize returns the size that this widget should not shrink below

func (*SelectGeneric) MouseIn

func (s *SelectGeneric) MouseIn(*desktop.MouseEvent)

MouseIn is called when a desktop pointer enters the widget

func (*SelectGeneric) MouseMoved

func (s *SelectGeneric) MouseMoved(*desktop.MouseEvent)

MouseMoved is called when a desktop pointer hovers over the widget

func (*SelectGeneric) MouseOut

func (s *SelectGeneric) MouseOut()

MouseOut is called when a desktop pointer exits the widget

func (*SelectGeneric) Move

func (s *SelectGeneric) Move(pos fyne.Position)

Move changes the relative position of the select.

Implements: fyne.Widget

func (*SelectGeneric) RefreshItem

func (s *SelectGeneric) RefreshItem()

func (*SelectGeneric) Resize

func (s *SelectGeneric) Resize(size fyne.Size)

Resize sets a new size for a widget. Note this should not be used if the widget is being managed by a Layout within a Container.

func (*SelectGeneric) Row

func (s *SelectGeneric) Row(num int) *SelectGeneric

func (*SelectGeneric) SelectedIndex

func (s *SelectGeneric) SelectedIndex() int

SelectedIndex returns the index value of the currently selected item in Options list. It will return -1 if there is no selection.

func (*SelectGeneric) SetOptions

func (s *SelectGeneric) SetOptions(opts []item) *SelectGeneric

func (*SelectGeneric) SetSelected

func (s *SelectGeneric) SetSelected(text item)

SetSelected sets the current option of the select widget

func (*SelectGeneric) SetSelectedIndex

func (s *SelectGeneric) SetSelectedIndex(index int)

SetSelectedIndex will set the Selected option from the value in Options list at index position.

func (*SelectGeneric) Tapped

func (s *SelectGeneric) Tapped(*fyne.PointEvent)

Tapped is called when a pointer tapped event is captured and triggers any tap handler

func (*SelectGeneric) TypedKey

func (s *SelectGeneric) TypedKey(event *fyne.KeyEvent)

TypedKey is called if a key event happens while this Select is focused.

Implements: fyne.Focusable

func (*SelectGeneric) TypedRune

func (s *SelectGeneric) TypedRune(_ rune)

TypedRune is called if a text event happens while this Select is focused.

Implements: fyne.Focusable

type Slider

type Slider struct {
	widget.BaseWidget
	Caption string
	Value   float64
	Min     float64
	Max     float64
	Step    float64

	Txt    *canvas.Text
	MinTxt *canvas.Text

	TxtColor color.Color
	MinColor color.Color

	Orientation Orientation
	OnChanged   func(float64)
	// contains filtered or unexported fields
}

Slider is a widget that can slide between two fixed values.

func NewSlider

func NewSlider(min, max float64) *Slider

NewSlider returns a basic slider.

func NewSliderWithData

func NewSliderWithData(min, max float64, data binding.Float) *Slider

NewSliderWithData returns a slider connected with the specified data source.

Since: 2.0

func (*Slider) Bind

func (s *Slider) Bind(data binding.Float)

Bind connects the specified data source to this Slider. The current value will be displayed and any changes in the data will cause the widget to update. User interactions with this Slider will set the value into the data source.

Since: 2.0

func (*Slider) CircleScale

func (s *Slider) CircleScale(scale float32) *Slider

func (*Slider) ColorActive

func (s *Slider) ColorActive(c color.Color) *Slider

func (*Slider) ColorCircle

func (s *Slider) ColorCircle(c color.Color) *Slider

func (*Slider) ColorMin

func (s *Slider) ColorMin(c color.Color) *Slider

func (*Slider) ColorTrack

func (s *Slider) ColorTrack(c color.Color) *Slider

func (*Slider) ColorValue

func (s *Slider) ColorValue(c color.Color) *Slider

func (*Slider) CreateRenderer

func (s *Slider) CreateRenderer() fyne.WidgetRenderer

CreateRenderer links this widget to its renderer.

func (*Slider) Do

func (s *Slider) Do(fn func(*Slider)) *Slider

func (*Slider) DragEnd

func (s *Slider) DragEnd()

DragEnd function.

func (*Slider) Dragged

func (s *Slider) Dragged(e *fyne.DragEvent)

Dragged function.

func (*Slider) MinSize

func (s *Slider) MinSize() fyne.Size

MinSize returns the size that this widget should not shrink below

func (*Slider) SetValue

func (s *Slider) SetValue(value float64)

SetValue updates the value of the slider and clamps the value to be within the range.

func (*Slider) Unbind

func (s *Slider) Unbind()

Unbind disconnects any configured data source from this Slider. The current value will remain at the last value of the data source.

Since: 2.0

type TextField

type TextField struct {
	widget.BaseWidget
	Txt1       *canvas.Text
	Background *canvas.Rectangle
	OnTapped   func(*TextField) `json:"-"`
	OnHoverIn  func()           `json:"-"`
	OnHoverOut func()           `json:"-"`
	Data       interface{}
}

TextField is a widget for displaying a separator with themeable color.

Since: 1.4

func NewTextField

func NewTextField() *TextField

NewTextField creates a new separator.

Since: 1.4

func (*TextField) BgFillColor

func (me *TextField) BgFillColor(c color.Color) *TextField

func (*TextField) BgStrokeColor

func (me *TextField) BgStrokeColor(c color.Color) *TextField

func (*TextField) Click

func (me *TextField) Click(fn func(*TextField)) *TextField

func (*TextField) CreateRenderer

func (me *TextField) CreateRenderer() fyne.WidgetRenderer

CreateRenderer returns a new renderer for the separator.

Implements: fyne.Widget

func (*TextField) Do

func (me *TextField) Do(fn func(t *TextField)) *TextField

func (*TextField) MinSize

func (me *TextField) MinSize() fyne.Size

MinSize returns the minimal size of the separator.

Implements: fyne.Widget

func (*TextField) MouseIn

func (b *TextField) MouseIn(*desktop.MouseEvent)

MouseIn is called when a desktop pointer enters the widget

func (*TextField) MouseMoved

func (b *TextField) MouseMoved(*desktop.MouseEvent)

MouseMoved is called when a desktop pointer hovers over the widget

func (*TextField) MouseOut

func (b *TextField) MouseOut()

MouseOut is called when a desktop pointer exits the widget

func (*TextField) SData

func (me *TextField) SData(d interface{}) *TextField

func (*TextField) SText1

func (me *TextField) SText1(t string) *TextField

func (*TextField) Style

func (me *TextField) Style(style fyne.TextStyle) *TextField

Style fyne.TextStyle{Bold: true} fyne.TextStyle{Italic: true} fyne.TextStyle{Monospace: true} fyne.TextStyle{TabWidth: 10}

func (*TextField) T

func (me *TextField) T(t string) *TextField

设置显示文本内容

func (*TextField) Tap

func (me *TextField) Tap(fn func(tf *TextField)) *TextField

设置单击事件

func (*TextField) Tapped

func (b *TextField) Tapped(*fyne.PointEvent)

func (*TextField) TextAlign

func (me *TextField) TextAlign(align fyne.TextAlign) *TextField

TextAlign fyne.TextAlignLeading , fyne.TextAlignCenter , fyne.TextAlignTrailing

func (*TextField) TextColor1

func (me *TextField) TextColor1(c color.Color) *TextField

func (*TextField) TextSize

func (me *TextField) TextSize(size float32) *TextField

type Y2hText

type Y2hText struct {
	widget.BaseWidget
	Txt1       *canvas.Text
	Txt2       *canvas.Text
	Background *canvas.Rectangle
	OnTapped   func(*Y2hText) `json:"-"`
	OnHoverIn  func()         `json:"-"`
	OnHoverOut func()         `json:"-"`
	Data       interface{}
}

Y2hText is a widget for displaying a separator with themeable color.

Since: 1.4

func NewY2hText

func NewY2hText() *Y2hText

NewY2hText creates a new separator.

Since: 1.4

func (*Y2hText) BgFillColor

func (me *Y2hText) BgFillColor(c color.Color) *Y2hText

func (*Y2hText) BgStrokeColor

func (me *Y2hText) BgStrokeColor(c color.Color) *Y2hText

func (*Y2hText) Click

func (me *Y2hText) Click(fn func(*Y2hText)) *Y2hText

func (*Y2hText) CreateRenderer

func (me *Y2hText) CreateRenderer() fyne.WidgetRenderer

CreateRenderer returns a new renderer for the separator.

Implements: fyne.Widget

func (*Y2hText) Do

func (me *Y2hText) Do(fn func(t *Y2hText)) *Y2hText

func (*Y2hText) MinSize

func (me *Y2hText) MinSize() fyne.Size

MinSize returns the minimal size of the separator.

Implements: fyne.Widget

func (*Y2hText) MouseIn

func (b *Y2hText) MouseIn(*desktop.MouseEvent)

MouseIn is called when a desktop pointer enters the widget

func (*Y2hText) MouseMoved

func (b *Y2hText) MouseMoved(*desktop.MouseEvent)

MouseMoved is called when a desktop pointer hovers over the widget

func (*Y2hText) MouseOut

func (b *Y2hText) MouseOut()

MouseOut is called when a desktop pointer exits the widget

func (*Y2hText) SData

func (me *Y2hText) SData(d interface{}) *Y2hText

func (*Y2hText) SText1

func (me *Y2hText) SText1(t string) *Y2hText

func (*Y2hText) Style

func (me *Y2hText) Style(style fyne.TextStyle) *Y2hText

Style fyne.TextStyle{Bold: true} fyne.TextStyle{Italic: true} fyne.TextStyle{Monospace: true} fyne.TextStyle{TabWidth: 10}

func (*Y2hText) Tapped

func (b *Y2hText) Tapped(*fyne.PointEvent)

func (*Y2hText) TextAlign

func (me *Y2hText) TextAlign(align fyne.TextAlign) *Y2hText

TextAlign fyne.TextAlignLeading , fyne.TextAlignCenter , fyne.TextAlignTrailing

func (*Y2hText) TextColor1

func (me *Y2hText) TextColor1(c color.Color) *Y2hText

func (*Y2hText) TextColor2

func (me *Y2hText) TextColor2(c color.Color) *Y2hText

func (*Y2hText) TextSize

func (me *Y2hText) TextSize(size float32) *Y2hText

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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