CalsWidgets

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DialogHandler

func DialogHandler(window fyne.Window, args ...interface{}) (fyne.CanvasObject, error)

DialogHandler creates a dialog with the given settings

func Import

func Import()

Types

type Loading added in v0.0.3

type Loading struct {
	Box fyne.CanvasObject
	// contains filtered or unexported fields
}

func NewLoading added in v0.0.3

func NewLoading(loadingChan chan struct{}, timeToSleep time.Duration, minMax ...float64) *Loading

func (*Loading) BindProgress added in v0.0.3

func (l *Loading) BindProgress() binding.Float

func (*Loading) BindStatus added in v0.0.3

func (l *Loading) BindStatus() binding.String

func (*Loading) Complete added in v0.0.3

func (l *Loading) Complete()

func (*Loading) GetProgress added in v0.0.4

func (l *Loading) GetProgress() float64

func (*Loading) SetProgress added in v0.0.3

func (l *Loading) SetProgress(progress float64, status ...string)

func (*Loading) SetStatus added in v0.0.3

func (l *Loading) SetStatus(status string)

type MultiImage

type MultiImage struct {
	widget.BaseWidget
	widget.DisableableWidget

	Index      int
	Loop       bool
	OnTap      func()
	OnHover    func()
	WhileHover func()
	EndHover   func()
	// contains filtered or unexported fields
}

func NewMultiImage

func NewMultiImage(images []*canvas.Image) *MultiImage

func (*MultiImage) AddImage

func (m *MultiImage) AddImage(image *canvas.Image)

func (*MultiImage) ClearImages

func (m *MultiImage) ClearImages()

func (*MultiImage) CreateRenderer

func (m *MultiImage) CreateRenderer() fyne.WidgetRenderer

func (*MultiImage) Images

func (m *MultiImage) Images() []*canvas.Image

func (*MultiImage) InsertImage

func (m *MultiImage) InsertImage(index int, image *canvas.Image)

func (*MultiImage) MouseIn

func (m *MultiImage) MouseIn(event *desktop.MouseEvent)

func (*MultiImage) MouseMoved

func (m *MultiImage) MouseMoved(event *desktop.MouseEvent)

func (*MultiImage) MouseOut

func (m *MultiImage) MouseOut()

func (*MultiImage) NextIndex

func (m *MultiImage) NextIndex()

func (*MultiImage) PrevIndex

func (m *MultiImage) PrevIndex()

func (*MultiImage) RemoveImage

func (m *MultiImage) RemoveImage(index int)

func (*MultiImage) RemoveImageByImage

func (m *MultiImage) RemoveImageByImage(image *canvas.Image, first ...bool)

RemoveImageByImage Will remove all images that match the file of image pointer unless first is true

func (*MultiImage) SetBackground

func (m *MultiImage) SetBackground(background color.Color)

func (*MultiImage) SetEndHover

func (m *MultiImage) SetEndHover(EndHover func())

func (*MultiImage) SetImages

func (m *MultiImage) SetImages(images []*canvas.Image)

func (*MultiImage) SetIndex

func (m *MultiImage) SetIndex(Index int, Refresh ...bool)

func (*MultiImage) SetLoop

func (m *MultiImage) SetLoop(Loop bool)

func (*MultiImage) SetOnHover

func (m *MultiImage) SetOnHover(OnHover func())

func (*MultiImage) SetOnTap

func (m *MultiImage) SetOnTap(OnTap func())

func (*MultiImage) SetWhileHover

func (m *MultiImage) SetWhileHover(WhileHover func())

func (*MultiImage) Tapped

func (m *MultiImage) Tapped(event *fyne.PointEvent)

type NarrativeBox

type NarrativeBox struct {
	//Interfaces for the dialog
	widget.BaseWidget
	widget.DisableableWidget

	//JSON-safe variables for the dialog and use in the editor
	SafeNarrativeBox

	//Functions for the dialog
	OnStateChange     func(int)
	OnTapped          func()
	OnSecondaryTapped func()
	OnDoubleTapped    func()
	OnHover           func()
	OnEndHover        func()
	WhileHover        func()
	// contains filtered or unexported fields
}

NarrativeBox is a widget that displays a message to the user while also having interactive elements

func NewNarrativeBox

func NewNarrativeBox(hasName bool, text ...string) *NarrativeBox

func (*NarrativeBox) AddContent

func (n *NarrativeBox) AddContent(content string)

AddContent adds a string to the AllText field of the dialog; however, it does not update the displayed text, UpdateText() must be called to do that

func (*NarrativeBox) AddState

func (n *NarrativeBox) AddState()

func (*NarrativeBox) ChangeState

func (n *NarrativeBox) ChangeState(incr int)

func (*NarrativeBox) CreateRenderer

func (n *NarrativeBox) CreateRenderer() fyne.WidgetRenderer

func (*NarrativeBox) DoubleTapped

func (n *NarrativeBox) DoubleTapped(*fyne.PointEvent)

func (*NarrativeBox) Export

func (n *NarrativeBox) Export() error

Export exports the widget to a json file in the export folder relative to the parent application, to allow for use in the editor

func (*NarrativeBox) MouseIn

func (n *NarrativeBox) MouseIn(*desktop.MouseEvent)

func (*NarrativeBox) MouseMoved

func (n *NarrativeBox) MouseMoved(*desktop.MouseEvent)

func (*NarrativeBox) MouseOut

func (n *NarrativeBox) MouseOut()

func (*NarrativeBox) SetAnimateText

func (n *NarrativeBox) SetAnimateText(animateText bool)

func (*NarrativeBox) SetConcatText

func (n *NarrativeBox) SetConcatText(concatText bool)

func (*NarrativeBox) SetContent

func (n *NarrativeBox) SetContent(content []string)

SetContent sets the AllText field of the dialog; however, it does not update the label, UpdateText() must be called to do that

func (*NarrativeBox) SetFill

func (n *NarrativeBox) SetFill(fill color.Color)

func (*NarrativeBox) SetHasName

func (n *NarrativeBox) SetHasName(hasName bool)

func (*NarrativeBox) SetName

func (n *NarrativeBox) SetName(name string)

func (*NarrativeBox) SetNameAffectsLayout

func (n *NarrativeBox) SetNameAffectsLayout(nameAffectsLayout bool)

func (*NarrativeBox) SetNameFill

func (n *NarrativeBox) SetNameFill(nameFill color.Color)

func (*NarrativeBox) SetNamePosition

func (n *NarrativeBox) SetNamePosition(namePosition fyne.Position)

func (*NarrativeBox) SetNameStroke

func (n *NarrativeBox) SetNameStroke(nameStroke float32)

func (*NarrativeBox) SetNameStrokeColor

func (n *NarrativeBox) SetNameStrokeColor(nameStrokeColor color.Color)

func (*NarrativeBox) SetState

func (n *NarrativeBox) SetState(state int)

func (*NarrativeBox) SetStateOnTap

func (n *NarrativeBox) SetStateOnTap(stateOnTap bool)

func (*NarrativeBox) SetStroke

func (n *NarrativeBox) SetStroke(stroke float32)

func (*NarrativeBox) SetStrokeColor

func (n *NarrativeBox) SetStrokeColor(strokeColor color.Color)

func (*NarrativeBox) SetText

func (n *NarrativeBox) SetText(text string)

func (*NarrativeBox) SetTextAnimDelay

func (n *NarrativeBox) SetTextAnimDelay(textAnimDelay float32)

func (*NarrativeBox) SetTextOnStateChange

func (n *NarrativeBox) SetTextOnStateChange(textOnStateChange bool)

func (*NarrativeBox) Tapped

func (n *NarrativeBox) Tapped(*fyne.PointEvent)

func (*NarrativeBox) TappedSecondary

func (n *NarrativeBox) TappedSecondary(*fyne.PointEvent)

func (*NarrativeBox) UpdateText

func (n *NarrativeBox) UpdateText(args ...int)

UpdateText updates the text displayed by the dialog

type SafeNarrativeBox

type SafeNarrativeBox struct {
	AllText           []string             `json:"AllText"`
	State             int                  `json:"State"`
	MaxState          int                  `json:"MaxState"`
	Name              string               `json:"Name"`
	HasName           bool                 `json:"HasName"`
	StrokeColor       color.Color          `json:"StrokeColor"`
	NameStrokeColor   color.Color          `json:"NameStrokeColor"`
	Fill              color.Color          `json:"Fill"`
	NameFill          color.Color          `json:"NameFill"`
	Stroke            float32              `json:"Stroke"`
	NameStroke        float32              `json:"NameStroke"`
	NamePosition      fyne.Position        `json:"NamePosition"`
	NameAffectsLayout bool                 `json:"NameAffectsLayout"`
	StateOnTap        bool                 `json:"StateOnTap"`
	TextOnStateChange bool                 `json:"TextOnStateChange"`
	ConcatText        bool                 `json:"ConcatText"`
	AnimateText       bool                 `json:"AnimateText"`
	CanSkip           bool                 `json:"CanSkip"`
	TextDelay         float32              `json:"TextDelay"`
	OnStateChange     string               `json:"OnStateChange"`
	OnTapped          string               `json:"OnTapped"`
	OnSecondaryTapped string               `json:"OnSecondaryTapped"`
	OnDoubleTapped    string               `json:"OnDoubleTapped"`
	OnHover           string               `json:"OnHover"`
	OnEndHover        string               `json:"OnEndHover"`
	WhileHover        string               `json:"WhileHover"`
	Sizing            NFWidget.Sizing      `json:"Sizing"`
	Padding           NFWidget.Padding     `json:"Padding"`
	ExternalPadding   NFWidget.Padding     `json:"ExternalPadding"`
	ContentStyle      NFWidget.TextStyling `json:"ContentStyle"`
	NameStyle         NFWidget.TextStyling `json:"NameStyle"`
	NamePadding       NFWidget.Padding     `json:"NamePadding"`
	NameSizing        NFWidget.Sizing      `json:"NameSizing"`
}

func NewJsonSafeDialog

func NewJsonSafeDialog() SafeNarrativeBox

Jump to

Keyboard shortcuts

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