edgui

package
v0.0.0-...-04212e3 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BeginTableWithEnd

func BeginTableWithEnd(label string, columns int, body func())

func DragFloat2

func DragFloat2(
	label string,
	label1 string, v1 *float64,
	label2 string, v2 *float64) (ret bool)

func DragFloat3

func DragFloat3(
	label string,
	label1 string, v1 *float64,
	label2 string, v2 *float64,
	label3 string, v3 *float64) (ret bool)

func DragFloat64

func DragFloat64(label string, v *float64) bool

func DrawList

func DrawList[T ListNode](id string, list []T, handler ListNodeActionHandler)

func DrawListWithFilter

func DrawListWithFilter[T ListNode](id string, list []T, passFilter func(item T) bool, handler ListNodeActionHandler)

func DrawTree

func DrawTree(root TreeNode, handler TreeNodeActionHandler)

func InputText

func InputText(label string, text *string) bool

func Text

func Text(format string, args ...any)

func TreeNodeIsDescendantOf

func TreeNodeIsDescendantOf(parent TreeNode, target TreeNode) bool

func TreeNodeWithPop

func TreeNodeWithPop(label string, flags imgui.TreeNodeFlags, body func())

func WalkTree

func WalkTree(root TreeNode, context any, callback func(node TreeNode, context any))

func WithDisabled

func WithDisabled(applyDisable bool, body func())

func WithID

func WithID(value reflect.Value, body func())

WithID is used to prevent two inputs from being treated as the same input within imgui. Essentially, you should use this whenever you need to edit a reflect.Value

func WithIDPtr

func WithIDPtr[T any](ptr *T, body func())

func WithItemWidth

func WithItemWidth(width float32, body func())

Types

type AutoComplete

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

func (*AutoComplete) InputText

func (a *AutoComplete) InputText(label string, s *string, onActivated func() []string) bool

func (*AutoComplete) SetItems

func (a *AutoComplete) SetItems(items []string)

type FilteredList

type FilteredList[T ListNode] struct {
	List []T
	// contains filtered or unexported fields
}

func (*FilteredList[T]) Draw

func (f *FilteredList[T]) Draw(label string, handler ListNodeActionHandler)

type ListNode

type ListNode interface {
	Name() string
}

type ListNodeActionHandler

type ListNodeActionHandler interface {
	Clicked(node ListNode, index int)
	DoubleClicked(node ListNode, index int)
}

type ListNodeSelected

type ListNodeSelected interface {
	Selected() bool
}
type Menu struct {
	Name  string
	Items []*MenuItem
}
func (m *Menu) Draw()
type MenuItem struct {
	Text     string
	Action   func(self *MenuItem)
	Selected bool
	Disabled bool
}

type SelectAssetModal

type SelectAssetModal struct {
	Title string
	Type  reflect.Type
	// contains filtered or unexported fields
}

func (*SelectAssetModal) Clicked

func (s *SelectAssetModal) Clicked(node ListNode, index int)

func (*SelectAssetModal) DoubleClicked

func (s *SelectAssetModal) DoubleClicked(node ListNode, index int)

func (*SelectAssetModal) Draw

func (s *SelectAssetModal) Draw() bool

func (*SelectAssetModal) DrawWithExtraHeaderUI

func (s *SelectAssetModal) DrawWithExtraHeaderUI(headerHook func()) bool

func (*SelectAssetModal) Open

func (s *SelectAssetModal) Open()

func (*SelectAssetModal) SelectedPath

func (s *SelectAssetModal) SelectedPath() string

type SelectParentModal

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

func NewSelectParentModel

func NewSelectParentModel(targetPath asset.Path, target asset.Asset) *SelectParentModal

func (*SelectParentModal) Draw

func (s *SelectParentModal) Draw() bool

func (*SelectParentModal) Open

func (s *SelectParentModal) Open()

type TreeDragContext

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

type TreeDropFlag

type TreeDropFlag int
const (
	NotDropped TreeDropFlag = iota
	DroppedOnNode
	DroppedBeforeNode
	DroppedAfterNode
)

type TreeNode

type TreeNode interface {
	Name() string
	Children() []TreeNode
	Leaf() bool
	Expanded() bool
}

type TreeNodeActionHandler

type TreeNodeActionHandler interface {
	Clicked(node TreeNode)
}

type TreeNodeDragDropHandler

type TreeNodeDragDropHandler interface {
	// Context must be stored by the client
	Context() *TreeDragContext
	DragSource(node TreeNode)
	DragTarget(node TreeNode, dropFlag TreeDropFlag)
}

TreeNodeDragDropHandler is an extended interface that can be used by clients that wish to respond to drag/drop events

type TreeNodeSelected

type TreeNodeSelected interface {
	Selected() bool
}

TreeNodeSelected is an extended interface from the basic TreeNode interface Nodes must implement this interface if they wish to be selectable

Jump to

Keyboard shortcuts

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