giuplus

package module
v0.0.0-...-25791f2 Latest Latest
Warning

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

Go to latest
Published: May 26, 2022 License: BSD-3-Clause Imports: 3 Imported by: 0

README

giuplus

additional widgets for the Giu immediate mode GUI for Go based on imgui

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TextWidth

func TextWidth(s string) float32

TextWidth returns the width of the given text.

func WrapInputtextMultiline

func WrapInputtextMultiline(e *TextEditor, data imgui.InputTextCallbackData) int32

WrapInputTextMultiline is a callback to wrap an input text multiline.

Types

type TextEditor

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

func NewTextEditor

func NewTextEditor(width, height float32, onActivate func(e *TextEditor)) *TextEditor

NewTextEditor creates a new text editor with given height and width. The onActivate callback is called when the editor is activated.

func NewTextEditorMultiline

func NewTextEditorMultiline(width, height float32) *TextEditor

NewTextEditorMultiline creates a new multiline text editor with given width and height. Word-wrapping is ON by default.

func (*TextEditor) AutoSelect

func (e *TextEditor) AutoSelect() bool

AutoSelect returns true if text is automatically selected on focus, false otherwise.

func (*TextEditor) Build

func (e *TextEditor) Build()

Build builds the widget's layout. This is to satisfy Giu's custom widget interface.

func (*TextEditor) SetAutoSelect

func (e *TextEditor) SetAutoSelect(on bool)

SetAutoSelect sets the automatic selection on focus feature.

func (*TextEditor) SetOnActivate

func (e *TextEditor) SetOnActivate(callback func(e *TextEditor))

SetOnActivate sets the onActivate callback which is called when the editor is activated.

func (*TextEditor) SetSize

func (e *TextEditor) SetSize(width, height float32)

SetSize sets the editor width and height. Widths and heights of -1 indicate maximum stretch.

func (*TextEditor) SetText

func (e *TextEditor) SetText(s string)

SetText sets the editor text to the given UTF-8 string.

func (*TextEditor) SetWordwrap

func (e *TextEditor) SetWordwrap(on bool)

SetWordwrap sets the automatic word wrapping on or off.

func (*TextEditor) Size

func (e *TextEditor) Size() (float32, float32)

Size returns the width and height of the editor. Widths and heights of -1 indicate maximum stretch.

func (*TextEditor) Text

func (e *TextEditor) Text() string

Text returns the text of the editor.

func (*TextEditor) Widget

func (e *TextEditor) Widget() g.Widget

Widget returns the undlerying GUI widget, which is either a InputText or InputTextMultiline.

func (*TextEditor) Wordrap

func (e *TextEditor) Wordrap() bool

Wordwrap returns true if the automatic word wrapping is on, false otherwise.

Jump to

Keyboard shortcuts

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