basicwidget

package
v0.0.0-...-7ac5d4b Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2026 License: Apache-2.0 Imports: 28 Imported by: 1

README

Licenses

InterVariable.ttf

Copyright (c) 2016 The Inter Project Authors (https://github.com/rsms/inter)

This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL

-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION AND CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

Documentation

Index

Constants

View Source
const (
	FontPriorityLow    = 100
	FontPriorityNormal = 200
	FontPriorityHigh   = 300
)

Variables

This section is empty.

Functions

func CreateMonochromeImage

func CreateMonochromeImage(colorMode guigui.ColorMode, img image.Image) image.Image

func DefaultActiveListItemTextColor

func DefaultActiveListItemTextColor(context *guigui.Context) color.Color

TODO: Clean up functions for colors.

func FontSize

func FontSize(context *guigui.Context) float64

func LineHeight

func LineHeight(context *guigui.Context) float64

func ListItemTextPadding

func ListItemTextPadding(context *guigui.Context) guigui.Padding

func MoveItemsInSlice

func MoveItemsInSlice[T any](slice []T, from int, count int, to int) int

func RegisterFonts

func RegisterFonts(appendEntries func([]FaceSourceEntry, *guigui.Context) []FaceSourceEntry, priority FontPriority)

RegisterFonts registers the fonts.

priority is used to determine the order of the fonts. The order of the fonts is determined by the priority. The bigger priority value, the higher priority. If the priority is the same, the order of the fonts is determined by the order of registration.

func RoundedCornerRadius

func RoundedCornerRadius(context *guigui.Context) int

func SetFaceSources

func SetFaceSources(entries []FaceSourceEntry)

SetFaceSources sets the face sources.

func UnitSize

func UnitSize(context *guigui.Context) int

Types

type Background

type Background struct {
	guigui.DefaultWidget
}

func (*Background) Draw

func (b *Background) Draw(context *guigui.Context, widgetBounds *guigui.WidgetBounds, dst *ebiten.Image)

type Button

type Button struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

func (*Button) Build

func (b *Button) Build(context *guigui.Context, adder *guigui.ChildAdder) error

func (*Button) CursorShape

func (b *Button) CursorShape(context *guigui.Context, widgetBounds *guigui.WidgetBounds) (ebiten.CursorShapeType, bool)

func (*Button) Draw

func (b *Button) Draw(context *guigui.Context, widgetBounds *guigui.WidgetBounds, dst *ebiten.Image)

func (*Button) HandlePointingInput

func (b *Button) HandlePointingInput(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult

func (*Button) Layout

func (b *Button) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)

func (*Button) Measure

func (b *Button) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point

func (*Button) SetContent

func (b *Button) SetContent(content guigui.Widget)

func (*Button) SetIcon

func (b *Button) SetIcon(icon *ebiten.Image)

func (*Button) SetIconAlign

func (b *Button) SetIconAlign(align IconAlign)

func (*Button) SetOnDown

func (b *Button) SetOnDown(f func(context *guigui.Context))

func (*Button) SetOnUp

func (b *Button) SetOnUp(f func(context *guigui.Context))

func (*Button) SetSharpCorners

func (b *Button) SetSharpCorners(sharpCorners Corners)

func (*Button) SetText

func (b *Button) SetText(text string)

func (*Button) SetTextBold

func (b *Button) SetTextBold(bold bool)

func (*Button) SetTextColor

func (b *Button) SetTextColor(clr color.Color)

func (*Button) Tick

func (b *Button) Tick(context *guigui.Context, widgetBounds *guigui.WidgetBounds) error

type Corners

type Corners struct {
	TopStart    bool
	TopEnd      bool
	BottomStart bool
	BottomEnd   bool
}

type Drawer

type Drawer struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

func (*Drawer) Build

func (d *Drawer) Build(context *guigui.Context, adder *guigui.ChildAdder) error

func (*Drawer) IsOpen

func (d *Drawer) IsOpen() bool

func (*Drawer) Layout

func (d *Drawer) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)

func (*Drawer) Measure

func (d *Drawer) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point

func (*Drawer) SetAnimated

func (d *Drawer) SetAnimated(animateOnFading bool)

func (*Drawer) SetBackgroundBlurred

func (d *Drawer) SetBackgroundBlurred(blurred bool)

func (*Drawer) SetBackgroundBounds

func (d *Drawer) SetBackgroundBounds(bounds image.Rectangle)

func (*Drawer) SetBackgroundDark

func (d *Drawer) SetBackgroundDark(dark bool)

func (*Drawer) SetCloseByClickingOutside

func (d *Drawer) SetCloseByClickingOutside(closeByClickingOutside bool)

func (*Drawer) SetContent

func (d *Drawer) SetContent(widget guigui.Widget)

func (*Drawer) SetDrawerEdge

func (d *Drawer) SetDrawerEdge(edge DrawerEdge)

func (*Drawer) SetOnClose

func (d *Drawer) SetOnClose(onClose func(context *guigui.Context, reason PopupCloseReason))

func (*Drawer) SetOpen

func (d *Drawer) SetOpen(open bool)

type DrawerEdge

type DrawerEdge int
const (
	DrawerEdgeStart DrawerEdge = iota
	DrawerEdgeTop
	DrawerEdgeEnd
	DrawerEdgeBottom
)

type Expander

type Expander struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

func (*Expander) Build

func (e *Expander) Build(context *guigui.Context, adder *guigui.ChildAdder) error

func (*Expander) Layout

func (e *Expander) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)

func (*Expander) Measure

func (e *Expander) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point

func (*Expander) SetContentWidget

func (e *Expander) SetContentWidget(w guigui.Widget)

func (*Expander) SetExpanded

func (e *Expander) SetExpanded(expanded bool)

func (*Expander) SetHeaderWidget

func (e *Expander) SetHeaderWidget(w guigui.Widget)

func (*Expander) SetOnExpansionChanged

func (e *Expander) SetOnExpansionChanged(callback func(context *guigui.Context, expanded bool))

type FaceSourceEntry

type FaceSourceEntry struct {
	FaceSource    *text.GoTextFaceSource
	UnicodeRanges []UnicodeRange
}

func DefaultFaceSourceEntry

func DefaultFaceSourceEntry() FaceSourceEntry

type FontPriority

type FontPriority int

FontPriority is used to determine the order of the fonts for RegisterFonts.

type Form

type Form struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

func (*Form) Build

func (f *Form) Build(context *guigui.Context, adder *guigui.ChildAdder) error

func (*Form) Draw

func (f *Form) Draw(context *guigui.Context, widgetBounds *guigui.WidgetBounds, dst *ebiten.Image)

func (*Form) Layout

func (f *Form) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)

func (*Form) Measure

func (f *Form) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point

func (*Form) SetItems

func (f *Form) SetItems(items []FormItem)

type FormItem

type FormItem struct {
	PrimaryWidget   guigui.Widget
	SecondaryWidget guigui.Widget
}

type IconAlign

type IconAlign int
const (
	IconAlignStart IconAlign = iota
	IconAlignEnd
)

type Image

type Image struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

func (*Image) Draw

func (i *Image) Draw(context *guigui.Context, widgetBounds *guigui.WidgetBounds, dst *ebiten.Image)

func (*Image) HasImage

func (i *Image) HasImage() bool

func (*Image) Measure

func (i *Image) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point

func (*Image) SetImage

func (i *Image) SetImage(image *ebiten.Image)

type List

type List[T comparable] struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

func (*List[T]) Build

func (l *List[T]) Build(context *guigui.Context, adder *guigui.ChildAdder) error

func (*List[T]) EnsureItemVisibleByIndex

func (l *List[T]) EnsureItemVisibleByIndex(index int)

func (*List[T]) HighlightedItemIndex

func (l *List[T]) HighlightedItemIndex(context *guigui.Context) int

func (*List[T]) ID

func (l *List[T]) ID(index int) any

func (*List[T]) ItemBounds

func (l *List[T]) ItemBounds(index int) image.Rectangle

func (*List[T]) ItemByIndex

func (l *List[T]) ItemByIndex(index int) (ListItem[T], bool)

func (*List[T]) ItemCount

func (l *List[T]) ItemCount() int

func (*List[T]) ItemTextColor

func (l *List[T]) ItemTextColor(context *guigui.Context, index int) color.Color

func (*List[T]) JumpToItemByIndex

func (l *List[T]) JumpToItemByIndex(index int)

func (*List[T]) Layout

func (l *List[T]) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)

func (*List[T]) Measure

func (l *List[T]) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point

func (*List[T]) SelectItemByIndex

func (l *List[T]) SelectItemByIndex(index int)

func (*List[T]) SelectItemByValue

func (l *List[T]) SelectItemByValue(value T)

func (*List[T]) SelectedItem

func (l *List[T]) SelectedItem() (ListItem[T], bool)

func (*List[T]) SelectedItemIndex

func (l *List[T]) SelectedItemIndex() int

func (*List[T]) SetBackground

func (l *List[T]) SetBackground(widget guigui.Widget)

func (*List[T]) SetCheckmarkIndex

func (l *List[T]) SetCheckmarkIndex(index int)

func (*List[T]) SetFooterHeight

func (l *List[T]) SetFooterHeight(height int)

func (*List[T]) SetHeaderHeight

func (l *List[T]) SetHeaderHeight(height int)

func (*List[T]) SetItemHeight

func (l *List[T]) SetItemHeight(height int)

func (*List[T]) SetItemString

func (l *List[T]) SetItemString(str string, index int)

func (*List[T]) SetItems

func (l *List[T]) SetItems(items []ListItem[T])

func (*List[T]) SetItemsByStrings

func (l *List[T]) SetItemsByStrings(strs []string)

func (*List[T]) SetOnItemExpanderToggled

func (l *List[T]) SetOnItemExpanderToggled(f func(context *guigui.Context, index int, expanded bool))

func (*List[T]) SetOnItemSelected

func (l *List[T]) SetOnItemSelected(f func(context *guigui.Context, index int))

func (*List[T]) SetOnItemsMoved

func (l *List[T]) SetOnItemsMoved(f func(context *guigui.Context, from, count, to int))

func (*List[T]) SetStripeVisible

func (l *List[T]) SetStripeVisible(visible bool)

func (*List[T]) SetStyle

func (l *List[T]) SetStyle(style ListStyle)

func (*List[T]) Tick

func (l *List[T]) Tick(context *guigui.Context, widgetBounds *guigui.WidgetBounds) error

type ListItem

type ListItem[T comparable] struct {
	Text         string
	TextColor    color.Color
	Header       bool
	Content      guigui.Widget
	KeyText      string
	Unselectable bool
	Border       bool
	Disabled     bool
	Movable      bool
	Value        T
	IndentLevel  int
	Padding      guigui.Padding
	Collapsed    bool
}

type ListStyle

type ListStyle int
const (
	ListStyleNormal ListStyle = iota
	ListStyleSidebar
	ListStyleMenu
)

type NumberInput

type NumberInput struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

func (*NumberInput) Build

func (n *NumberInput) Build(context *guigui.Context, adder *guigui.ChildAdder) error

func (*NumberInput) CanCopy

func (n *NumberInput) CanCopy() bool

func (*NumberInput) CanCut

func (n *NumberInput) CanCut() bool

func (*NumberInput) CanPaste

func (n *NumberInput) CanPaste() bool

func (*NumberInput) CommitWithCurrentInputValue

func (n *NumberInput) CommitWithCurrentInputValue()

func (*NumberInput) Copy

func (n *NumberInput) Copy() bool

func (*NumberInput) Cut

func (n *NumberInput) Cut() bool

func (*NumberInput) ForceSetValue

func (n *NumberInput) ForceSetValue(value int)

func (*NumberInput) ForceSetValueBigInt

func (n *NumberInput) ForceSetValueBigInt(value *big.Int)

func (*NumberInput) ForceSetValueInt64

func (n *NumberInput) ForceSetValueInt64(value int64)

func (*NumberInput) ForceSetValueUint64

func (n *NumberInput) ForceSetValueUint64(value uint64)

func (*NumberInput) HandleButtonInput

func (n *NumberInput) HandleButtonInput(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult

func (*NumberInput) IsEditable

func (n *NumberInput) IsEditable() bool

func (*NumberInput) Layout

func (n *NumberInput) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)

func (*NumberInput) MaximumValueBigInt

func (n *NumberInput) MaximumValueBigInt() *big.Int

func (*NumberInput) Measure

func (n *NumberInput) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point

func (*NumberInput) MinimumValueBigInt

func (n *NumberInput) MinimumValueBigInt() *big.Int

func (*NumberInput) Paste

func (n *NumberInput) Paste() bool

func (*NumberInput) SetEditable

func (n *NumberInput) SetEditable(editable bool)

func (*NumberInput) SetMaximumValue

func (n *NumberInput) SetMaximumValue(maximum int)

func (*NumberInput) SetMaximumValueBigInt

func (n *NumberInput) SetMaximumValueBigInt(maximum *big.Int)

func (*NumberInput) SetMaximumValueInt64

func (n *NumberInput) SetMaximumValueInt64(maximum int64)

func (*NumberInput) SetMaximumValueUint64

func (n *NumberInput) SetMaximumValueUint64(maximum uint64)

func (*NumberInput) SetMinimumValue

func (n *NumberInput) SetMinimumValue(minimum int)

func (*NumberInput) SetMinimumValueBigInt

func (n *NumberInput) SetMinimumValueBigInt(minimum *big.Int)

func (*NumberInput) SetMinimumValueInt64

func (n *NumberInput) SetMinimumValueInt64(minimum int64)

func (*NumberInput) SetMinimumValueUint64

func (n *NumberInput) SetMinimumValueUint64(minimum uint64)

func (*NumberInput) SetOnKeyJustPressed

func (n *NumberInput) SetOnKeyJustPressed(f func(context *guigui.Context, key ebiten.Key))

func (*NumberInput) SetOnValueChanged

func (n *NumberInput) SetOnValueChanged(f func(context *guigui.Context, value int, committed bool))

func (*NumberInput) SetOnValueChangedBigInt

func (n *NumberInput) SetOnValueChangedBigInt(f func(context *guigui.Context, value *big.Int, committed bool))

func (*NumberInput) SetOnValueChangedInt64

func (n *NumberInput) SetOnValueChangedInt64(f func(context *guigui.Context, value int64, committed bool))

func (*NumberInput) SetOnValueChangedUint64

func (n *NumberInput) SetOnValueChangedUint64(f func(context *guigui.Context, value uint64, committed bool))

func (*NumberInput) SetStep

func (n *NumberInput) SetStep(step int)

func (*NumberInput) SetStepBigInt

func (n *NumberInput) SetStepBigInt(step *big.Int)

func (*NumberInput) SetStepInt64

func (n *NumberInput) SetStepInt64(step int64)

func (*NumberInput) SetStepUint64

func (n *NumberInput) SetStepUint64(step uint64)

func (*NumberInput) SetValue

func (n *NumberInput) SetValue(value int)

func (*NumberInput) SetValueBigInt

func (n *NumberInput) SetValueBigInt(value *big.Int)

func (*NumberInput) SetValueInt64

func (n *NumberInput) SetValueInt64(value int64)

func (*NumberInput) SetValueUint64

func (n *NumberInput) SetValueUint64(value uint64)

func (*NumberInput) Value

func (n *NumberInput) Value() int

func (*NumberInput) ValueBigInt

func (n *NumberInput) ValueBigInt() *big.Int

func (*NumberInput) ValueInt64

func (n *NumberInput) ValueInt64() int64

func (*NumberInput) ValueUint64

func (n *NumberInput) ValueUint64() uint64

type Panel

type Panel struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

func (*Panel) Build

func (p *Panel) Build(context *guigui.Context, adder *guigui.ChildAdder) error

func (*Panel) Layout

func (p *Panel) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)

func (*Panel) Measure

func (p *Panel) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point

func (*Panel) SetAutoBorder

func (p *Panel) SetAutoBorder(auto bool)

func (*Panel) SetBorders

func (p *Panel) SetBorders(borders PanelBorders)

func (*Panel) SetContent

func (p *Panel) SetContent(widget guigui.Widget)

func (*Panel) SetContentConstraints

func (p *Panel) SetContentConstraints(c PanelContentConstraints)

func (*Panel) SetOnScroll

func (p *Panel) SetOnScroll(callback func(context *guigui.Context, offsetX, offsetY float64))

func (*Panel) SetScrollOffset

func (p *Panel) SetScrollOffset(offsetX, offsetY float64)

func (*Panel) SetScrollOffsetByDelta

func (p *Panel) SetScrollOffsetByDelta(offsetXDelta, offsetYDelta float64)

func (*Panel) SetStyle

func (p *Panel) SetStyle(typ PanelStyle)

type PanelBorders

type PanelBorders struct {
	Start  bool
	Top    bool
	End    bool
	Bottom bool
}

type PanelContentConstraints

type PanelContentConstraints int
const (
	PanelContentConstraintsNone PanelContentConstraints = iota
	PanelContentConstraintsFixedWidth
	PanelContentConstraintsFixedHeight
)

type PanelStyle

type PanelStyle int
const (
	PanelStyleDefault PanelStyle = iota
	PanelStyleSide
)
type Popup struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

func (*Popup) Build

func (p *Popup) Build(context *guigui.Context, adder *guigui.ChildAdder) error

func (*Popup) IsOpen

func (p *Popup) IsOpen() bool

func (*Popup) Layout

func (p *Popup) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)

func (*Popup) Measure

func (p *Popup) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point

func (*Popup) SetAnimated

func (p *Popup) SetAnimated(animateOnFading bool)

func (*Popup) SetBackgroundBlurred

func (p *Popup) SetBackgroundBlurred(blurred bool)

func (*Popup) SetBackgroundBounds

func (p *Popup) SetBackgroundBounds(bounds image.Rectangle)

func (*Popup) SetBackgroundDark

func (p *Popup) SetBackgroundDark(dark bool)

func (*Popup) SetCloseByClickingOutside

func (p *Popup) SetCloseByClickingOutside(closeByClickingOutside bool)

func (*Popup) SetContent

func (p *Popup) SetContent(widget guigui.Widget)

func (*Popup) SetOnClose

func (p *Popup) SetOnClose(f func(context *guigui.Context, reason PopupCloseReason))

func (*Popup) SetOpen

func (p *Popup) SetOpen(open bool)

type PopupCloseReason

type PopupCloseReason int
const (
	PopupCloseReasonNone PopupCloseReason = iota
	PopupCloseReasonFuncCall
	PopupCloseReasonClickOutside
	PopupCloseReasonReopen
)

type PopupMenu

type PopupMenu[T comparable] struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

func (*PopupMenu[T]) Build

func (p *PopupMenu[T]) Build(context *guigui.Context, adder *guigui.ChildAdder) error

func (*PopupMenu[T]) IsOpen

func (p *PopupMenu[T]) IsOpen() bool

func (*PopupMenu[T]) ItemByIndex

func (p *PopupMenu[T]) ItemByIndex(index int) (PopupMenuItem[T], bool)

func (*PopupMenu[T]) ItemTextColor

func (p *PopupMenu[T]) ItemTextColor(context *guigui.Context, index int) color.Color

func (*PopupMenu[T]) Layout

func (p *PopupMenu[T]) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)

func (*PopupMenu[T]) SelectItemByIndex

func (p *PopupMenu[T]) SelectItemByIndex(index int)

func (*PopupMenu[T]) SelectItemByValue

func (p *PopupMenu[T]) SelectItemByValue(value T)

func (*PopupMenu[T]) SelectedItem

func (p *PopupMenu[T]) SelectedItem() (PopupMenuItem[T], bool)

func (*PopupMenu[T]) SelectedItemIndex

func (p *PopupMenu[T]) SelectedItemIndex() int

func (*PopupMenu[T]) SetCheckmarkIndex

func (p *PopupMenu[T]) SetCheckmarkIndex(index int)

func (*PopupMenu[T]) SetItems

func (p *PopupMenu[T]) SetItems(items []PopupMenuItem[T])

func (*PopupMenu[T]) SetItemsByStrings

func (p *PopupMenu[T]) SetItemsByStrings(items []string)

func (*PopupMenu[T]) SetOnItemSelected

func (p *PopupMenu[T]) SetOnItemSelected(f func(context *guigui.Context, index int))

func (*PopupMenu[T]) SetOpen

func (p *PopupMenu[T]) SetOpen(open bool)

type PopupMenuItem

type PopupMenuItem[T comparable] struct {
	Text         string
	TextColor    color.Color
	Header       bool
	Content      guigui.Widget
	KeyText      string
	Unselectable bool
	Border       bool
	Disabled     bool
	Value        T
}

type SegmentedControl

type SegmentedControl[T comparable] struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

func (*SegmentedControl[T]) Build

func (s *SegmentedControl[T]) Build(context *guigui.Context, adder *guigui.ChildAdder) error

func (*SegmentedControl[T]) ItemByIndex

func (s *SegmentedControl[T]) ItemByIndex(index int) (SegmentedControlItem[T], bool)

func (*SegmentedControl[T]) Layout

func (s *SegmentedControl[T]) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)

func (*SegmentedControl[T]) Measure

func (s *SegmentedControl[T]) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point

func (*SegmentedControl[T]) SelectItemByIndex

func (s *SegmentedControl[T]) SelectItemByIndex(index int)

func (*SegmentedControl[T]) SelectItemByValue

func (s *SegmentedControl[T]) SelectItemByValue(value T)

func (*SegmentedControl[T]) SelectedItem

func (s *SegmentedControl[T]) SelectedItem() (SegmentedControlItem[T], bool)

func (*SegmentedControl[T]) SelectedItemIndex

func (s *SegmentedControl[T]) SelectedItemIndex() int

func (*SegmentedControl[T]) SetDirection

func (s *SegmentedControl[T]) SetDirection(direction SegmentedControlDirection)

func (*SegmentedControl[T]) SetItems

func (s *SegmentedControl[T]) SetItems(items []SegmentedControlItem[T])

func (*SegmentedControl[T]) SetOnItemSelected

func (s *SegmentedControl[T]) SetOnItemSelected(f func(context *guigui.Context, index int))

type SegmentedControlDirection

type SegmentedControlDirection int
const (
	SegmentedControlDirectionHorizontal SegmentedControlDirection = iota
	SegmentedControlDirectionVertical
)

type SegmentedControlItem

type SegmentedControlItem[T comparable] struct {
	Text      string
	Icon      *ebiten.Image
	IconAlign IconAlign
	Disabled  bool
	Value     T
}

type Select

type Select[T comparable] struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

func (*Select[T]) Build

func (s *Select[T]) Build(context *guigui.Context, adder *guigui.ChildAdder) error

func (*Select[T]) IsPopupOpen

func (s *Select[T]) IsPopupOpen() bool

func (*Select[T]) ItemByIndex

func (s *Select[T]) ItemByIndex(index int) (SelectItem[T], bool)

func (*Select[T]) ItemTextColor

func (s *Select[T]) ItemTextColor(context *guigui.Context, index int) color.Color

func (*Select[T]) Layout

func (s *Select[T]) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)

func (*Select[T]) Measure

func (s *Select[T]) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point

func (*Select[T]) SelectItemByIndex

func (s *Select[T]) SelectItemByIndex(index int)

func (*Select[T]) SelectItemByValue

func (s *Select[T]) SelectItemByValue(value T)

func (*Select[T]) SelectedItem

func (s *Select[T]) SelectedItem() (SelectItem[T], bool)

func (*Select[T]) SelectedItemIndex

func (s *Select[T]) SelectedItemIndex() int

func (*Select[T]) SetItems

func (s *Select[T]) SetItems(items []SelectItem[T])

func (*Select[T]) SetItemsByStrings

func (s *Select[T]) SetItemsByStrings(items []string)

func (*Select[T]) SetOnItemSelected

func (s *Select[T]) SetOnItemSelected(f func(context *guigui.Context, index int))

type SelectItem

type SelectItem[T comparable] struct {
	Text         string
	TextColor    color.Color
	Header       bool
	Content      guigui.Widget
	Unselectable bool
	Border       bool
	Disabled     bool
	Value        T
}

type Slider

type Slider struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

func (*Slider) Build

func (s *Slider) Build(context *guigui.Context, adder *guigui.ChildAdder) error

func (*Slider) CursorShape

func (s *Slider) CursorShape(context *guigui.Context, widgetBounds *guigui.WidgetBounds) (ebiten.CursorShapeType, bool)

func (*Slider) Draw

func (s *Slider) Draw(context *guigui.Context, widgetBounds *guigui.WidgetBounds, dst *ebiten.Image)

func (*Slider) HandlePointingInput

func (s *Slider) HandlePointingInput(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult

func (*Slider) MaximumValueBigInt

func (s *Slider) MaximumValueBigInt() *big.Int

func (*Slider) Measure

func (s *Slider) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point

func (*Slider) MinimumValueBigInt

func (s *Slider) MinimumValueBigInt() *big.Int

func (*Slider) SetMaximumValue

func (s *Slider) SetMaximumValue(maximum int)

func (*Slider) SetMaximumValueBigInt

func (s *Slider) SetMaximumValueBigInt(maximum *big.Int)

func (*Slider) SetMaximumValueInt64

func (s *Slider) SetMaximumValueInt64(maximum int64)

func (*Slider) SetMaximumValueUint64

func (s *Slider) SetMaximumValueUint64(maximum uint64)

func (*Slider) SetMinimumValue

func (s *Slider) SetMinimumValue(minimum int)

func (*Slider) SetMinimumValueBigInt

func (s *Slider) SetMinimumValueBigInt(minimum *big.Int)

func (*Slider) SetMinimumValueInt64

func (s *Slider) SetMinimumValueInt64(minimum int64)

func (*Slider) SetMinimumValueUint64

func (s *Slider) SetMinimumValueUint64(minimum uint64)

func (*Slider) SetOnValueChanged

func (s *Slider) SetOnValueChanged(f func(context *guigui.Context, value int))

func (*Slider) SetOnValueChangedBigInt

func (s *Slider) SetOnValueChangedBigInt(f func(context *guigui.Context, value *big.Int))

func (*Slider) SetOnValueChangedInt64

func (s *Slider) SetOnValueChangedInt64(f func(context *guigui.Context, value int64))

func (*Slider) SetOnValueChangedUint64

func (s *Slider) SetOnValueChangedUint64(f func(context *guigui.Context, value uint64))

func (*Slider) SetValue

func (s *Slider) SetValue(value int)

func (*Slider) SetValueBigInt

func (s *Slider) SetValueBigInt(value *big.Int)

func (*Slider) SetValueInt64

func (s *Slider) SetValueInt64(value int64)

func (*Slider) SetValueUint64

func (s *Slider) SetValueUint64(value uint64)

func (*Slider) Tick

func (s *Slider) Tick(context *guigui.Context, widgetBounds *guigui.WidgetBounds) error

func (*Slider) Value

func (s *Slider) Value() int

func (*Slider) ValueBigInt

func (s *Slider) ValueBigInt() *big.Int

func (*Slider) ValueInt64

func (s *Slider) ValueInt64() int64

func (*Slider) ValueUint64

func (s *Slider) ValueUint64() uint64

type Table

type Table[T comparable] struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

func (*Table[T]) Build

func (t *Table[T]) Build(context *guigui.Context, adder *guigui.ChildAdder) error

func (*Table[T]) EnsureItemVisibleByIndex

func (t *Table[T]) EnsureItemVisibleByIndex(index int)

func (*Table[T]) ID

func (t *Table[T]) ID(index int) any

func (*Table[T]) ItemByIndex

func (t *Table[T]) ItemByIndex(index int) (TableRow[T], bool)

func (*Table[T]) ItemCount

func (t *Table[T]) ItemCount() int

func (*Table[T]) ItemTextColor

func (t *Table[T]) ItemTextColor(context *guigui.Context, index int) color.Color

func (*Table[T]) JumpToItemByIndex

func (t *Table[T]) JumpToItemByIndex(index int)

func (*Table[T]) Layout

func (t *Table[T]) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)

func (*Table[T]) Measure

func (t *Table[T]) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point

func (*Table[T]) SelectItemByIndex

func (t *Table[T]) SelectItemByIndex(index int)

func (*Table[T]) SelectItemByValue

func (t *Table[T]) SelectItemByValue(value T)

func (*Table[T]) SelectedItem

func (t *Table[T]) SelectedItem() (TableRow[T], bool)

func (*Table[T]) SelectedItemIndex

func (t *Table[T]) SelectedItemIndex() int

func (*Table[T]) SetCheckmarkIndex

func (t *Table[T]) SetCheckmarkIndex(index int)

func (*Table[T]) SetColumns

func (t *Table[T]) SetColumns(columns []TableColumn)

func (*Table[T]) SetFooterHeight

func (t *Table[T]) SetFooterHeight(height int)

func (*Table[T]) SetItems

func (t *Table[T]) SetItems(items []TableRow[T])

func (*Table[T]) SetOnItemSelected

func (t *Table[T]) SetOnItemSelected(f func(context *guigui.Context, index int))

func (*Table[T]) SetOnItemsMoved

func (t *Table[T]) SetOnItemsMoved(f func(context *guigui.Context, from, count, to int))

type TableCell

type TableCell struct {
	Text                string
	TextColor           color.Color
	TextHorizontalAlign HorizontalAlign
	TextVerticalAlign   VerticalAlign
	TextBold            bool
	TextTabular         bool
	Content             guigui.Widget
}

type TableColumn

type TableColumn struct {
	HeaderText                string
	HeaderTextHorizontalAlign HorizontalAlign
	Width                     guigui.Size
	MinWidth                  int
}

type TableRow

type TableRow[T comparable] struct {
	Cells        []TableCell
	Unselectable bool
	Movable      bool
	Value        T
}

type Text

type Text struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

func (*Text) Build

func (t *Text) Build(context *guigui.Context, adder *guigui.ChildAdder) error

func (*Text) CanCopy

func (t *Text) CanCopy() bool

func (*Text) CanCut

func (t *Text) CanCut() bool

func (*Text) CanPaste

func (t *Text) CanPaste() bool

func (*Text) CanRedo

func (t *Text) CanRedo() bool

func (*Text) CanUndo

func (t *Text) CanUndo() bool

func (*Text) CommitWithCurrentInputValue

func (t *Text) CommitWithCurrentInputValue()

func (*Text) Copy

func (t *Text) Copy() bool

func (*Text) CursorShape

func (t *Text) CursorShape(context *guigui.Context, widgetBounds *guigui.WidgetBounds) (ebiten.CursorShapeType, bool)

func (*Text) Cut

func (t *Text) Cut() bool

func (*Text) Draw

func (t *Text) Draw(context *guigui.Context, widgetBounds *guigui.WidgetBounds, dst *ebiten.Image)

func (*Text) ForceSetValue

func (t *Text) ForceSetValue(text string)

func (*Text) HandleButtonInput

func (t *Text) HandleButtonInput(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult

func (*Text) HandlePointingInput

func (t *Text) HandlePointingInput(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult

func (*Text) HorizontalAlign

func (t *Text) HorizontalAlign() HorizontalAlign

func (*Text) IsEditable

func (t *Text) IsEditable() bool

func (*Text) IsMultiline

func (t *Text) IsMultiline() bool

func (*Text) Layout

func (t *Text) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)

func (*Text) Measure

func (t *Text) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point

func (*Text) OnFocusChanged

func (t *Text) OnFocusChanged(context *guigui.Context, focused bool)

func (*Text) Paste

func (t *Text) Paste() bool

func (*Text) Redo

func (t *Text) Redo() bool

func (*Text) ReplaceValueAtSelection

func (t *Text) ReplaceValueAtSelection(text string)

func (*Text) SetAutoWrap

func (t *Text) SetAutoWrap(autoWrap bool)

func (*Text) SetBold

func (t *Text) SetBold(bold bool)

func (*Text) SetColor

func (t *Text) SetColor(color color.Color)

func (*Text) SetEditable

func (t *Text) SetEditable(editable bool)

func (*Text) SetHorizontalAlign

func (t *Text) SetHorizontalAlign(align HorizontalAlign)

func (*Text) SetLocales

func (t *Text) SetLocales(locales []language.Tag)

func (*Text) SetMultiline

func (t *Text) SetMultiline(multiline bool)

func (*Text) SetOnKeyJustPressed

func (t *Text) SetOnKeyJustPressed(f func(context *guigui.Context, key ebiten.Key))

func (*Text) SetOnValueChanged

func (t *Text) SetOnValueChanged(f func(context *guigui.Context, text string, committed bool))

func (*Text) SetOpacity

func (t *Text) SetOpacity(opacity float64)

func (*Text) SetScale

func (t *Text) SetScale(scale float64)

func (*Text) SetSelectable

func (t *Text) SetSelectable(selectable bool)

func (*Text) SetTabWidth

func (t *Text) SetTabWidth(tabWidth float64)

func (*Text) SetTabular

func (t *Text) SetTabular(tabular bool)

func (*Text) SetValue

func (t *Text) SetValue(text string)

func (*Text) SetVerticalAlign

func (t *Text) SetVerticalAlign(align VerticalAlign)

func (*Text) Tick

func (t *Text) Tick(context *guigui.Context, widgetBounds *guigui.WidgetBounds) error

func (*Text) Undo

func (t *Text) Undo() bool

func (*Text) Value

func (t *Text) Value() string

func (*Text) VerticalAlign

func (t *Text) VerticalAlign() VerticalAlign

type TextInput

type TextInput struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

func (*TextInput) Build

func (t *TextInput) Build(context *guigui.Context, adder *guigui.ChildAdder) error

func (*TextInput) CanCopy

func (t *TextInput) CanCopy() bool

func (*TextInput) CanCut

func (t *TextInput) CanCut() bool

func (*TextInput) CanPaste

func (t *TextInput) CanPaste() bool

func (*TextInput) CanRedo

func (t *TextInput) CanRedo() bool

func (*TextInput) CanUndo

func (t *TextInput) CanUndo() bool

func (*TextInput) CommitWithCurrentInputValue

func (t *TextInput) CommitWithCurrentInputValue()

func (*TextInput) Copy

func (t *TextInput) Copy() bool

func (*TextInput) Cut

func (t *TextInput) Cut() bool

func (*TextInput) ForceSetValue

func (t *TextInput) ForceSetValue(text string)

func (*TextInput) IsEditable

func (t *TextInput) IsEditable() bool

func (*TextInput) Layout

func (t *TextInput) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)

func (*TextInput) Measure

func (t *TextInput) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point

func (*TextInput) Paste

func (t *TextInput) Paste() bool

func (*TextInput) Redo

func (t *TextInput) Redo() bool

func (*TextInput) ReplaceValueAtSelection

func (t *TextInput) ReplaceValueAtSelection(text string)

func (*TextInput) SelectAll

func (t *TextInput) SelectAll()

func (*TextInput) SetAutoWrap

func (t *TextInput) SetAutoWrap(autoWrap bool)

func (*TextInput) SetEditable

func (t *TextInput) SetEditable(editable bool)

func (*TextInput) SetHorizontalAlign

func (t *TextInput) SetHorizontalAlign(halign HorizontalAlign)

func (*TextInput) SetIcon

func (t *TextInput) SetIcon(icon *ebiten.Image)

func (*TextInput) SetMultiline

func (t *TextInput) SetMultiline(multiline bool)

func (*TextInput) SetOnKeyJustPressed

func (t *TextInput) SetOnKeyJustPressed(f func(context *guigui.Context, key ebiten.Key))

func (*TextInput) SetOnValueChanged

func (t *TextInput) SetOnValueChanged(f func(context *guigui.Context, text string, committed bool))

func (*TextInput) SetStyle

func (t *TextInput) SetStyle(style TextInputStyle)

func (*TextInput) SetTabular

func (t *TextInput) SetTabular(tabular bool)

func (*TextInput) SetValue

func (t *TextInput) SetValue(text string)

func (*TextInput) SetVerticalAlign

func (t *TextInput) SetVerticalAlign(valign VerticalAlign)

func (*TextInput) Tick

func (t *TextInput) Tick(context *guigui.Context, widgetBounds *guigui.WidgetBounds) error

func (*TextInput) Undo

func (t *TextInput) Undo() bool

func (*TextInput) Value

func (t *TextInput) Value() string

type TextInputStyle

type TextInputStyle int
const (
	TextInputStyleNormal TextInputStyle = iota
	TextInputStyleInline
)

type Toggle

type Toggle struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

func (*Toggle) CursorShape

func (t *Toggle) CursorShape(context *guigui.Context, widgetBounds *guigui.WidgetBounds) (ebiten.CursorShapeType, bool)

func (*Toggle) Draw

func (t *Toggle) Draw(context *guigui.Context, widgetBounds *guigui.WidgetBounds, dst *ebiten.Image)

func (*Toggle) HandlePointingInput

func (t *Toggle) HandlePointingInput(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult

func (*Toggle) Measure

func (t *Toggle) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point

func (*Toggle) SetOnValueChanged

func (t *Toggle) SetOnValueChanged(f func(context *guigui.Context, value bool))

func (*Toggle) SetValue

func (t *Toggle) SetValue(value bool)

func (*Toggle) Tick

func (t *Toggle) Tick(context *guigui.Context, widgetBounds *guigui.WidgetBounds) error

func (*Toggle) Value

func (t *Toggle) Value() bool

type UnicodeRange

type UnicodeRange struct {
	Min rune
	Max rune
}

type VerticalAlign

type VerticalAlign int

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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