Documentation ¶
Index ¶
- func ConstructEditor[T any](name string, obj *T, extraSpec map[string]any, ...) (edit.Editor, error)
- type Composite
- func (e *Composite) AddQuitCallback(f func())
- func (e *Composite) EnterField()
- func (e *Composite) GetName() string
- func (e *Composite) GetPane(renderer ui.ConstrainedRenderer, visible func() bool, ...) (ui.Pane, error)
- func (e *Composite) GetSummary() edit.SummaryEntry
- func (e *Composite) GetType() string
- func (e *Composite) IsActiveAndFocussed() (bool, bool)
- func (e *Composite) Quit()
- func (e *Composite) SwitchToNextField()
- func (e *Composite) SwitchToPrevField()
- func (e *Composite) Write()
- type EventEditor
- func (e *EventEditor) Activate(event *model.Event)
- func (e *EventEditor) AddRune(newRune rune)
- func (e *EventEditor) BackspaceRune()
- func (e *EventEditor) BackspaceToBeginning()
- func (e *EventEditor) Clear()
- func (e *EventEditor) DeleteRune()
- func (e *EventEditor) DeleteToEnd()
- func (e *EventEditor) GetMode() input.TextEditMode
- func (e *EventEditor) MoveCursorLeft()
- func (e *EventEditor) MoveCursorNextWordBeginning()
- func (e *EventEditor) MoveCursorNextWordEnd()
- func (e *EventEditor) MoveCursorPastEnd()
- func (e *EventEditor) MoveCursorPrevWordBeginning()
- func (e *EventEditor) MoveCursorRight()
- func (e *EventEditor) MoveCursorRightA()
- func (e *EventEditor) MoveCursorToBeginning()
- func (e *EventEditor) MoveCursorToEnd()
- func (e *EventEditor) SetMode(m input.TextEditMode)
- type StringEditor
- func (e *StringEditor) AddQuitCallback(f func())
- func (e *StringEditor) AddRune(newRune rune)
- func (e *StringEditor) BackspaceRune()
- func (e *StringEditor) BackspaceToBeginning()
- func (e *StringEditor) Clear()
- func (e *StringEditor) DeleteRune()
- func (e *StringEditor) DeleteToEnd()
- func (e StringEditor) GetContent() string
- func (e StringEditor) GetCursorPos() int
- func (e *StringEditor) GetFieldCount() int
- func (e StringEditor) GetMode() input.TextEditMode
- func (e StringEditor) GetName() string
- func (e *StringEditor) GetPane(renderer ui.ConstrainedRenderer, visible func() bool, ...) (ui.Pane, error)
- func (e *StringEditor) GetSummary() edit.SummaryEntry
- func (e *StringEditor) GetType() string
- func (e StringEditor) IsActiveAndFocussed() (bool, bool)
- func (e *StringEditor) MoveCursorLeft()
- func (e *StringEditor) MoveCursorNextWordBeginning()
- func (e *StringEditor) MoveCursorNextWordEnd()
- func (e *StringEditor) MoveCursorPastEnd()
- func (e *StringEditor) MoveCursorPrevWordBeginning()
- func (e *StringEditor) MoveCursorRight()
- func (e *StringEditor) MoveCursorToBeginning()
- func (e *StringEditor) MoveCursorToEnd()
- func (e *StringEditor) Quit()
- func (e *StringEditor) SetMode(m input.TextEditMode)
- func (e *StringEditor) Write()
- type StringEditorControl
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Composite ¶
type Composite struct {
// contains filtered or unexported fields
}
Composite implements Editor
func (*Composite) AddQuitCallback ¶
func (e *Composite) AddQuitCallback(f func())
AddQuitCallback adds a callback that is called when the editor is quit.
func (*Composite) EnterField ¶
func (e *Composite) EnterField()
EnterField changes the editor to enter the currently selected field, e.g. such that input processing is deferred to the field.
func (*Composite) GetPane ¶
func (e *Composite) GetPane( renderer ui.ConstrainedRenderer, visible func() bool, inputConfig input.InputConfig, stylesheet styling.Stylesheet, cursorController ui.CursorLocationRequestHandler, ) (ui.Pane, error)
GetPane constructs a pane for this composite editor (including all subeditors).
func (*Composite) GetSummary ¶ added in v0.9.7
func (e *Composite) GetSummary() edit.SummaryEntry
func (*Composite) IsActiveAndFocussed ¶ added in v0.9.7
func (*Composite) Quit ¶
func (e *Composite) Quit()
Quit quits all subeditors and calls the quit callback.
func (*Composite) SwitchToNextField ¶
func (e *Composite) SwitchToNextField()
SwitchToNextField switches to the next field (wrapping araound, if necessary)
func (*Composite) SwitchToPrevField ¶
func (e *Composite) SwitchToPrevField()
SwitchToPrevField switches to the previous field (wrapping araound, if necessary)
type EventEditor ¶
type EventEditor struct { Active bool Original *model.Event TmpEventInfo model.Event CursorPos int Mode input.TextEditMode }
func (*EventEditor) Activate ¶
func (e *EventEditor) Activate(event *model.Event)
func (*EventEditor) AddRune ¶
func (e *EventEditor) AddRune(newRune rune)
func (*EventEditor) BackspaceRune ¶
func (e *EventEditor) BackspaceRune()
func (*EventEditor) BackspaceToBeginning ¶
func (e *EventEditor) BackspaceToBeginning()
func (*EventEditor) Clear ¶
func (e *EventEditor) Clear()
func (*EventEditor) DeleteRune ¶
func (e *EventEditor) DeleteRune()
func (*EventEditor) DeleteToEnd ¶
func (e *EventEditor) DeleteToEnd()
func (*EventEditor) GetMode ¶
func (e *EventEditor) GetMode() input.TextEditMode
func (*EventEditor) MoveCursorLeft ¶
func (e *EventEditor) MoveCursorLeft()
func (*EventEditor) MoveCursorNextWordBeginning ¶
func (e *EventEditor) MoveCursorNextWordBeginning()
func (*EventEditor) MoveCursorNextWordEnd ¶
func (e *EventEditor) MoveCursorNextWordEnd()
func (*EventEditor) MoveCursorPastEnd ¶
func (e *EventEditor) MoveCursorPastEnd()
func (*EventEditor) MoveCursorPrevWordBeginning ¶
func (e *EventEditor) MoveCursorPrevWordBeginning()
func (*EventEditor) MoveCursorRight ¶
func (e *EventEditor) MoveCursorRight()
func (*EventEditor) MoveCursorRightA ¶
func (e *EventEditor) MoveCursorRightA()
func (*EventEditor) MoveCursorToBeginning ¶
func (e *EventEditor) MoveCursorToBeginning()
func (*EventEditor) MoveCursorToEnd ¶
func (e *EventEditor) MoveCursorToEnd()
func (*EventEditor) SetMode ¶
func (e *EventEditor) SetMode(m input.TextEditMode)
type StringEditor ¶
type StringEditor struct { Name string Content string CursorPos int Mode input.TextEditMode ActiveAndFocussed func() (bool, bool) QuitCallback func() CommitFn func(string) }
StringEditor ...
func (*StringEditor) AddQuitCallback ¶
func (e *StringEditor) AddQuitCallback(f func())
AddQuitCallback adds a callback that is called when the editor is quit.
func (*StringEditor) AddRune ¶
func (e *StringEditor) AddRune(newRune rune)
AddRune adds a rune at the cursor position.
func (*StringEditor) BackspaceRune ¶
func (e *StringEditor) BackspaceRune()
BackspaceRune deletes the rune before the cursor position.
func (*StringEditor) BackspaceToBeginning ¶
func (e *StringEditor) BackspaceToBeginning()
BackspaceToBeginning deletes all runes before the cursor position.
func (*StringEditor) DeleteRune ¶
func (e *StringEditor) DeleteRune()
DeleteRune deletes the rune at the cursor position.
func (*StringEditor) DeleteToEnd ¶
func (e *StringEditor) DeleteToEnd()
DeleteToEnd deletes all runes after the cursor position.
func (StringEditor) GetContent ¶
func (e StringEditor) GetContent() string
GetContent returns the current (edited) contents.
func (StringEditor) GetCursorPos ¶
func (e StringEditor) GetCursorPos() int
GetCursorPos returns the current cursor position in the string, 0 being
func (*StringEditor) GetFieldCount ¶
func (e *StringEditor) GetFieldCount() int
func (StringEditor) GetMode ¶
func (e StringEditor) GetMode() input.TextEditMode
GetMode returns the current mode of the editor.
func (StringEditor) GetName ¶
func (e StringEditor) GetName() string
GetName returns the name of the editor.
func (*StringEditor) GetPane ¶
func (e *StringEditor) GetPane( renderer ui.ConstrainedRenderer, visible func() bool, inputConfig input.InputConfig, stylesheet styling.Stylesheet, cursorController ui.CursorLocationRequestHandler, ) (ui.Pane, error)
GetPane returns a UI pane representing the editor.
func (*StringEditor) GetSummary ¶ added in v0.9.7
func (e *StringEditor) GetSummary() edit.SummaryEntry
func (*StringEditor) GetType ¶ added in v0.9.7
func (e *StringEditor) GetType() string
GetType asserts that this is a string editor.
func (StringEditor) IsActiveAndFocussed ¶ added in v0.9.7
func (e StringEditor) IsActiveAndFocussed() (bool, bool)
IsActiveAndFocussed ...
func (*StringEditor) MoveCursorLeft ¶
func (e *StringEditor) MoveCursorLeft()
MoveCursorLeft moves the cursor one rune to the left.
func (*StringEditor) MoveCursorNextWordBeginning ¶
func (e *StringEditor) MoveCursorNextWordBeginning()
MoveCursorNextWordBeginning moves the cursor one rune to the right, or to the end of the string if already at the end.
func (*StringEditor) MoveCursorNextWordEnd ¶
func (e *StringEditor) MoveCursorNextWordEnd()
MoveCursorNextWordEnd moves the cursor to the end of the next word.
func (*StringEditor) MoveCursorPastEnd ¶
func (e *StringEditor) MoveCursorPastEnd()
MoveCursorPastEnd moves the cursor past the end of the string.
func (*StringEditor) MoveCursorPrevWordBeginning ¶
func (e *StringEditor) MoveCursorPrevWordBeginning()
MoveCursorPrevWordBeginning moves the cursor one rune to the left, or to the beginning of the string if already at the beginning.
func (*StringEditor) MoveCursorRight ¶
func (e *StringEditor) MoveCursorRight()
MoveCursorRight moves the cursor one rune to the right.
func (*StringEditor) MoveCursorToBeginning ¶
func (e *StringEditor) MoveCursorToBeginning()
MoveCursorToBeginning moves the cursor to the beginning of the string.
func (*StringEditor) MoveCursorToEnd ¶
func (e *StringEditor) MoveCursorToEnd()
MoveCursorToEnd moves the cursor to the end of the string.
func (*StringEditor) SetMode ¶
func (e *StringEditor) SetMode(m input.TextEditMode)
SetMode sets the current mode of the editor.
func (*StringEditor) Write ¶
func (e *StringEditor) Write()
Write commits the current contents of the editor.
type StringEditorControl ¶
type StringEditorControl interface { SetMode(m input.TextEditMode) DeleteRune() BackspaceRune() BackspaceToBeginning() DeleteToEnd() Clear() MoveCursorToBeginning() MoveCursorToEnd() MoveCursorPastEnd() MoveCursorLeft() MoveCursorRight() MoveCursorRightA() MoveCursorNextWordBeginning() MoveCursorPrevWordBeginning() MoveCursorNextWordEnd() AddRune(newRune rune) }
StringEditorControl allows manipulation of a string editor.