mgnumericentry

package module
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: MIT 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.

README

MGNumericEntry

License

Um componente customizado para Fyne (Go) que fornece um campo de entrada numérica com validação, limites (min/max), incremento/decremento e botões de spin com auto-repeat (pressionar e segurar).

Ideal para formulários, configurações e interfaces desktop que precisam de controle numérico preciso.


✨ Recursos

  • 🔢 Entrada somente numérica
  • ➕➖ Incremento e decremento com passo configurável
  • ⏫⏬ Botões de spin (▲ / ▼) com auto-repeat
  • 🔒 Respeita valores mínimos e máximos
  • 🔄 Callback OnChanged ao alterar valor
  • 🖱️ Suporte a mouse, teclado e foco

📦 Instalação

go get github.com/profmugomes/mgnumericentry

🚀 Uso básico

Numeric Entry simples
entry := mgnumericentry.NewMGNumericEntry(0, 100, 10)

entry.OnChanged = func(v int) {
	fmt.Println("Valor alterado:", v)
}

Numeric Entry com botões de incremento/decremento
box, entry := mgnumericentry.NewMGNumericEntryWithButtons(0, 100, 5)

entry.OnChanged = func(v int) {
	fmt.Println("Novo valor:", v)
}

w.SetContent(box)

⚙️ Propriedades principais

MGNumericEntry
Campo Tipo Descrição
Min int Valor mínimo permitido
Max int Valor máximo permitido
Value int Valor atual
OnChanged func(int) Callback ao alterar o valor

🧠 Métodos úteis

entry.GetValue()
entry.SetValue(42)

🧩 Compatibilidade

  • Go 1.27.2+
  • Fyne 2.8.0

👤 Autor

Murilo Gomes

🔗 https://www.profmugomes.com.br

📺 https://youtube.com/@profmugomes


License

Copyright (c) 2025-2026 Murilo Gomes <profmugomes.com.br>

Licensed under the MIT license.

All contributions to the MGNumericEntry are subject to this license.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MGNumericEntry

type MGNumericEntry struct {
	widget.Entry

	OnChanged func(int)
	// contains filtered or unexported fields
}

func NewMGNumericEntry

func NewMGNumericEntry(min, max, initial int) *MGNumericEntry

func NewMGNumericEntryWithButtons

func NewMGNumericEntryWithButtons(min, max, initial int) (fyne.CanvasObject, *MGNumericEntry)

func (*MGNumericEntry) GetValue

func (e *MGNumericEntry) GetValue() int

func (*MGNumericEntry) SetValue

func (e *MGNumericEntry) SetValue(v int)

func (*MGNumericEntry) TypedKey

func (e *MGNumericEntry) TypedKey(k *fyne.KeyEvent)

func (*MGNumericEntry) TypedRune

func (e *MGNumericEntry) TypedRune(r rune)

Permite apenas digitação de dígitos e sinal '-' (se min < 0)

type MGSmallButton

type MGSmallButton struct {
	widget.BaseWidget
	Label    string
	OnTapped func()
	// contains filtered or unexported fields
}

func (*MGSmallButton) CreateRenderer

func (b *MGSmallButton) CreateRenderer() fyne.WidgetRenderer

func (*MGSmallButton) MinSize

func (b *MGSmallButton) MinSize() fyne.Size

func (*MGSmallButton) MouseDown

func (b *MGSmallButton) MouseDown(ev *desktop.MouseEvent)

func (*MGSmallButton) MouseIn

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

func (*MGSmallButton) MouseOut

func (b *MGSmallButton) MouseOut()

func (*MGSmallButton) MouseUp

func (b *MGSmallButton) MouseUp(ev *desktop.MouseEvent)

func (*MGSmallButton) Tapped

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

Jump to

Keyboard shortcuts

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