Documentation
¶
Index ¶
- type Command
- type CommandPalette
- func (cp *CommandPalette) Draw(g *base.Graphics)
- func (cp *CommandPalette) Focus(on bool)
- func (cp *CommandPalette) GetLabels() []string
- func (cp *CommandPalette) Handle(ev base.Event)
- func (cp *CommandPalette) Init(commands []Command)
- func (cp *CommandPalette) IsFlexibleHeight() bool
- func (cp *CommandPalette) IsFlexibleWidth() bool
- func (cp *CommandPalette) IsFocusable() bool
- func (cp *CommandPalette) Layout(width, height int)
- func (cp *CommandPalette) MinimumSize(width, height int) (int, int)
- func (cp *CommandPalette) Move(x, y int)
- func (cp *CommandPalette) SubFocusFirst()
- func (cp *CommandPalette) SubFocusLast()
- func (cp *CommandPalette) SubFocusNext() bool
- func (cp *CommandPalette) SubFocusPrev() bool
- func (cp *CommandPalette) Traverse(fm *tui.FocusManager)
- func (cp *CommandPalette) Update()
- type ConfirmationDialog
- func (cd *ConfirmationDialog) Draw(g *base.Graphics)
- func (cd *ConfirmationDialog) Focus(on bool)
- func (cd *ConfirmationDialog) GetSelectedButton() int
- func (cd *ConfirmationDialog) Handle(ev base.Event)
- func (cd *ConfirmationDialog) Init(title, message string)
- func (cd *ConfirmationDialog) IsFlexibleHeight() bool
- func (cd *ConfirmationDialog) IsFlexibleWidth() bool
- func (cd *ConfirmationDialog) IsFocusable() bool
- func (cd *ConfirmationDialog) Layout(width, height int)
- func (cd *ConfirmationDialog) MinimumSize(width, height int) (int, int)
- func (cd *ConfirmationDialog) Move(x, y int)
- func (cd *ConfirmationDialog) SetMessage(message string)
- func (cd *ConfirmationDialog) SetSelectedButton(button int)
- func (cd *ConfirmationDialog) SetTitle(title string)
- func (cd *ConfirmationDialog) SubFocusFirst()
- func (cd *ConfirmationDialog) SubFocusLast()
- func (cd *ConfirmationDialog) SubFocusNext() bool
- func (cd *ConfirmationDialog) SubFocusPrev() bool
- func (cd *ConfirmationDialog) Traverse(fm *tui.FocusManager)
- func (cd *ConfirmationDialog) Update()
- type DelegateCommand
- type FileChooser
- func (fc *FileChooser) Draw(g *base.Graphics)
- func (fc *FileChooser) Focus(on bool)
- func (fc *FileChooser) GetCurrentPath() string
- func (fc *FileChooser) GetSelectedEntry() *FileEntry
- func (fc *FileChooser) Handle(ev base.Event)
- func (fc *FileChooser) Init()
- func (fc *FileChooser) IsFlexibleHeight() bool
- func (fc *FileChooser) IsFlexibleWidth() bool
- func (fc *FileChooser) IsFocusable() bool
- func (fc *FileChooser) Layout(width, height int)
- func (fc *FileChooser) MinimumSize(width, height int) (int, int)
- func (fc *FileChooser) Move(x, y int)
- func (fc *FileChooser) Refresh()
- func (fc *FileChooser) SetPath(path string)
- func (fc *FileChooser) SubFocusFirst()
- func (fc *FileChooser) SubFocusLast()
- func (fc *FileChooser) SubFocusNext() bool
- func (fc *FileChooser) SubFocusPrev() bool
- func (fc *FileChooser) Traverse(fm *tui.FocusManager)
- func (fc *FileChooser) Update()
- type FileEntry
- type FolderChooser
- func (fc *FolderChooser) Draw(g *base.Graphics)
- func (fc *FolderChooser) Focus(on bool)
- func (fc *FolderChooser) GetCurrentPath() string
- func (fc *FolderChooser) GetSelectedFolder() *FolderEntry
- func (fc *FolderChooser) Handle(ev base.Event)
- func (fc *FolderChooser) Init()
- func (fc *FolderChooser) IsFlexibleHeight() bool
- func (fc *FolderChooser) IsFlexibleWidth() bool
- func (fc *FolderChooser) IsFocusable() bool
- func (fc *FolderChooser) Layout(width, height int)
- func (fc *FolderChooser) MinimumSize(width, height int) (int, int)
- func (fc *FolderChooser) Move(x, y int)
- func (fc *FolderChooser) Refresh()
- func (fc *FolderChooser) SelectCurrentFolder()
- func (fc *FolderChooser) SetPath(path string)
- func (fc *FolderChooser) SubFocusFirst()
- func (fc *FolderChooser) SubFocusLast()
- func (fc *FolderChooser) SubFocusNext() bool
- func (fc *FolderChooser) SubFocusPrev() bool
- func (fc *FolderChooser) Traverse(fm *tui.FocusManager)
- func (fc *FolderChooser) Update()
- type FolderEntry
- type InputDialog
- func (id *InputDialog) ClearInput()
- func (id *InputDialog) Draw(g *base.Graphics)
- func (id *InputDialog) Focus(on bool)
- func (id *InputDialog) GetInputValue() string
- func (id *InputDialog) Handle(ev base.Event)
- func (id *InputDialog) Init(title, prompt string)
- func (id *InputDialog) IsFlexibleHeight() bool
- func (id *InputDialog) IsFlexibleWidth() bool
- func (id *InputDialog) IsFocusable() bool
- func (id *InputDialog) Layout(width, height int)
- func (id *InputDialog) MinimumSize(width, height int) (int, int)
- func (id *InputDialog) Move(x, y int)
- func (id *InputDialog) SetInputValue(value string)
- func (id *InputDialog) SetPrompt(prompt string)
- func (id *InputDialog) SetTitle(title string)
- func (id *InputDialog) SubFocusFirst()
- func (id *InputDialog) SubFocusLast()
- func (id *InputDialog) SubFocusNext() bool
- func (id *InputDialog) SubFocusPrev() bool
- func (id *InputDialog) Traverse(fm *tui.FocusManager)
- func (id *InputDialog) Update()
- type MessageDialog
- func (md *MessageDialog) Draw(g *base.Graphics)
- func (md *MessageDialog) ExecuteOK(runtime base.Runtime)
- func (md *MessageDialog) Focus(on bool)
- func (md *MessageDialog) Handle(ev base.Event)
- func (md *MessageDialog) Init(title, message string)
- func (md *MessageDialog) IsFlexibleHeight() bool
- func (md *MessageDialog) IsFlexibleWidth() bool
- func (md *MessageDialog) IsFocusable() bool
- func (md *MessageDialog) Layout(width, height int)
- func (md *MessageDialog) MinimumSize(width, height int) (int, int)
- func (md *MessageDialog) Move(x, y int)
- func (md *MessageDialog) SetButtonText(text string)
- func (md *MessageDialog) SetMessage(message string)
- func (md *MessageDialog) SetTitle(title string)
- func (md *MessageDialog) SubFocusFirst()
- func (md *MessageDialog) SubFocusLast()
- func (md *MessageDialog) SubFocusNext() bool
- func (md *MessageDialog) SubFocusPrev() bool
- func (md *MessageDialog) Traverse(fm *tui.FocusManager)
- func (md *MessageDialog) Update()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command interface {
Execute(runtime base.Runtime, cp *CommandPalette)
GetLabel() string
}
Command is have user friendly label, and executable interface.
type CommandPalette ¶
type CommandPalette struct {
Width, Height int
// contains filtered or unexported fields
}
CommandPalette is vscode like command palette control.
func NewCommandPalette ¶
func NewCommandPalette(commands []Command) *CommandPalette
NewCommandPalette returns CommandPalette.
func (*CommandPalette) Draw ¶
func (cp *CommandPalette) Draw(g *base.Graphics)
func (*CommandPalette) Focus ¶
func (cp *CommandPalette) Focus(on bool)
func (*CommandPalette) GetLabels ¶
func (cp *CommandPalette) GetLabels() []string
func (*CommandPalette) Handle ¶
func (cp *CommandPalette) Handle(ev base.Event)
func (*CommandPalette) Init ¶
func (cp *CommandPalette) Init(commands []Command)
Init is initialize CommandPalette.
func (*CommandPalette) IsFlexibleHeight ¶
func (cp *CommandPalette) IsFlexibleHeight() bool
func (*CommandPalette) IsFlexibleWidth ¶
func (cp *CommandPalette) IsFlexibleWidth() bool
func (*CommandPalette) IsFocusable ¶
func (cp *CommandPalette) IsFocusable() bool
func (*CommandPalette) Layout ¶
func (cp *CommandPalette) Layout(width, height int)
func (*CommandPalette) MinimumSize ¶
func (cp *CommandPalette) MinimumSize(width, height int) (int, int)
func (*CommandPalette) Move ¶
func (cp *CommandPalette) Move(x, y int)
func (*CommandPalette) SubFocusFirst ¶
func (cp *CommandPalette) SubFocusFirst()
func (*CommandPalette) SubFocusLast ¶
func (cp *CommandPalette) SubFocusLast()
func (*CommandPalette) SubFocusNext ¶
func (cp *CommandPalette) SubFocusNext() bool
func (*CommandPalette) SubFocusPrev ¶
func (cp *CommandPalette) SubFocusPrev() bool
func (*CommandPalette) Traverse ¶
func (cp *CommandPalette) Traverse(fm *tui.FocusManager)
func (*CommandPalette) Update ¶
func (cp *CommandPalette) Update()
type ConfirmationDialog ¶
type ConfirmationDialog struct {
Width, Height int
// contains filtered or unexported fields
}
ConfirmationDialog is choice a yes or no dialog.
func NewConfirmationDialog ¶
func NewConfirmationDialog(title, message string, onYes, onNo func(base.Runtime)) *ConfirmationDialog
NewConfirmationDialog returns ConfirmationDialog.
func (*ConfirmationDialog) Draw ¶
func (cd *ConfirmationDialog) Draw(g *base.Graphics)
func (*ConfirmationDialog) Focus ¶
func (cd *ConfirmationDialog) Focus(on bool)
func (*ConfirmationDialog) GetSelectedButton ¶
func (cd *ConfirmationDialog) GetSelectedButton() int
GetSelectedButton returns the currently selected button (0: Yes, 1: No)
func (*ConfirmationDialog) Handle ¶
func (cd *ConfirmationDialog) Handle(ev base.Event)
func (*ConfirmationDialog) Init ¶
func (cd *ConfirmationDialog) Init(title, message string)
Init is initialize ConfirmationDialog.
func (*ConfirmationDialog) IsFlexibleHeight ¶
func (cd *ConfirmationDialog) IsFlexibleHeight() bool
func (*ConfirmationDialog) IsFlexibleWidth ¶
func (cd *ConfirmationDialog) IsFlexibleWidth() bool
func (*ConfirmationDialog) IsFocusable ¶
func (cd *ConfirmationDialog) IsFocusable() bool
func (*ConfirmationDialog) Layout ¶
func (cd *ConfirmationDialog) Layout(width, height int)
func (*ConfirmationDialog) MinimumSize ¶
func (cd *ConfirmationDialog) MinimumSize(width, height int) (int, int)
func (*ConfirmationDialog) Move ¶
func (cd *ConfirmationDialog) Move(x, y int)
func (*ConfirmationDialog) SetMessage ¶
func (cd *ConfirmationDialog) SetMessage(message string)
SetMessage updates the dialog message
func (*ConfirmationDialog) SetSelectedButton ¶
func (cd *ConfirmationDialog) SetSelectedButton(button int)
SetSelectedButton sets the selected button (0: Yes, 1: No)
func (*ConfirmationDialog) SetTitle ¶
func (cd *ConfirmationDialog) SetTitle(title string)
SetTitle updates the dialog title
func (*ConfirmationDialog) SubFocusFirst ¶
func (cd *ConfirmationDialog) SubFocusFirst()
func (*ConfirmationDialog) SubFocusLast ¶
func (cd *ConfirmationDialog) SubFocusLast()
func (*ConfirmationDialog) SubFocusNext ¶
func (cd *ConfirmationDialog) SubFocusNext() bool
func (*ConfirmationDialog) SubFocusPrev ¶
func (cd *ConfirmationDialog) SubFocusPrev() bool
func (*ConfirmationDialog) Traverse ¶
func (cd *ConfirmationDialog) Traverse(fm *tui.FocusManager)
func (*ConfirmationDialog) Update ¶
func (cd *ConfirmationDialog) Update()
type DelegateCommand ¶
type DelegateCommand struct {
Label string
Func func(runtime base.Runtime, cp *CommandPalette)
}
DelegateCommand is implement Command by delegate.
func (DelegateCommand) Execute ¶
func (dc DelegateCommand) Execute(runtime base.Runtime, cp *CommandPalette)
func (DelegateCommand) GetLabel ¶
func (dc DelegateCommand) GetLabel() string
type FileChooser ¶
type FileChooser struct {
Width, Height int
// contains filtered or unexported fields
}
FileChooser is file choose dialog.
func NewFileChooser ¶
func NewFileChooser(initialPath string, onFileSelect func(base.Runtime, string), onCancel func(base.Runtime)) *FileChooser
NewFileChooser returns FileChooser.
func (*FileChooser) Draw ¶
func (fc *FileChooser) Draw(g *base.Graphics)
func (*FileChooser) Focus ¶
func (fc *FileChooser) Focus(on bool)
func (*FileChooser) GetCurrentPath ¶
func (fc *FileChooser) GetCurrentPath() string
GetCurrentPath returns the current directory path
func (*FileChooser) GetSelectedEntry ¶
func (fc *FileChooser) GetSelectedEntry() *FileEntry
GetSelectedEntry returns the currently selected file entry
func (*FileChooser) Handle ¶
func (fc *FileChooser) Handle(ev base.Event)
func (*FileChooser) IsFlexibleHeight ¶
func (fc *FileChooser) IsFlexibleHeight() bool
func (*FileChooser) IsFlexibleWidth ¶
func (fc *FileChooser) IsFlexibleWidth() bool
func (*FileChooser) IsFocusable ¶
func (fc *FileChooser) IsFocusable() bool
func (*FileChooser) Layout ¶
func (fc *FileChooser) Layout(width, height int)
func (*FileChooser) MinimumSize ¶
func (fc *FileChooser) MinimumSize(width, height int) (int, int)
func (*FileChooser) Move ¶
func (fc *FileChooser) Move(x, y int)
func (*FileChooser) Refresh ¶
func (fc *FileChooser) Refresh()
Refresh reloads the current directory
func (*FileChooser) SetPath ¶
func (fc *FileChooser) SetPath(path string)
SetPath changes the current directory path
func (*FileChooser) SubFocusFirst ¶
func (fc *FileChooser) SubFocusFirst()
func (*FileChooser) SubFocusLast ¶
func (fc *FileChooser) SubFocusLast()
func (*FileChooser) SubFocusNext ¶
func (fc *FileChooser) SubFocusNext() bool
func (*FileChooser) SubFocusPrev ¶
func (fc *FileChooser) SubFocusPrev() bool
func (*FileChooser) Traverse ¶
func (fc *FileChooser) Traverse(fm *tui.FocusManager)
func (*FileChooser) Update ¶
func (fc *FileChooser) Update()
type FolderChooser ¶
type FolderChooser struct {
Width, Height int
// contains filtered or unexported fields
}
FolderChooser is folder choose dialog.
func NewFolderChooser ¶
func NewFolderChooser(initialPath string, onFolderSelect func(base.Runtime, string), onCancel func(base.Runtime)) *FolderChooser
NewFolderChooser returns FolderChooser.
func (*FolderChooser) Draw ¶
func (fc *FolderChooser) Draw(g *base.Graphics)
func (*FolderChooser) Focus ¶
func (fc *FolderChooser) Focus(on bool)
func (*FolderChooser) GetCurrentPath ¶
func (fc *FolderChooser) GetCurrentPath() string
GetCurrentPath returns the current directory path
func (*FolderChooser) GetSelectedFolder ¶
func (fc *FolderChooser) GetSelectedFolder() *FolderEntry
GetSelectedFolder returns the currently selected folder entry
func (*FolderChooser) Handle ¶
func (fc *FolderChooser) Handle(ev base.Event)
func (*FolderChooser) IsFlexibleHeight ¶
func (fc *FolderChooser) IsFlexibleHeight() bool
func (*FolderChooser) IsFlexibleWidth ¶
func (fc *FolderChooser) IsFlexibleWidth() bool
func (*FolderChooser) IsFocusable ¶
func (fc *FolderChooser) IsFocusable() bool
func (*FolderChooser) Layout ¶
func (fc *FolderChooser) Layout(width, height int)
func (*FolderChooser) MinimumSize ¶
func (fc *FolderChooser) MinimumSize(width, height int) (int, int)
func (*FolderChooser) Move ¶
func (fc *FolderChooser) Move(x, y int)
func (*FolderChooser) Refresh ¶
func (fc *FolderChooser) Refresh()
Refresh reloads the current directory
func (*FolderChooser) SelectCurrentFolder ¶
func (fc *FolderChooser) SelectCurrentFolder()
SelectCurrentFolder selects the current directory (useful for "select current folder" functionality)
func (*FolderChooser) SetPath ¶
func (fc *FolderChooser) SetPath(path string)
SetPath changes the current directory path
func (*FolderChooser) SubFocusFirst ¶
func (fc *FolderChooser) SubFocusFirst()
func (*FolderChooser) SubFocusLast ¶
func (fc *FolderChooser) SubFocusLast()
func (*FolderChooser) SubFocusNext ¶
func (fc *FolderChooser) SubFocusNext() bool
func (*FolderChooser) SubFocusPrev ¶
func (fc *FolderChooser) SubFocusPrev() bool
func (*FolderChooser) Traverse ¶
func (fc *FolderChooser) Traverse(fm *tui.FocusManager)
func (*FolderChooser) Update ¶
func (fc *FolderChooser) Update()
type FolderEntry ¶
type InputDialog ¶
type InputDialog struct {
Width, Height int
// contains filtered or unexported fields
}
InputDialog is dialog with input form.
func NewInputDialog ¶
func NewInputDialog(title, prompt, initialValue string, onOK func(base.Runtime, string), onCancel func(base.Runtime)) *InputDialog
NewInputDialog returns InputDialog.
func (*InputDialog) ClearInput ¶
func (id *InputDialog) ClearInput()
ClearInput clears the input field
func (*InputDialog) Draw ¶
func (id *InputDialog) Draw(g *base.Graphics)
func (*InputDialog) Focus ¶
func (id *InputDialog) Focus(on bool)
func (*InputDialog) GetInputValue ¶
func (id *InputDialog) GetInputValue() string
GetInputValue returns the current input field value
func (*InputDialog) Handle ¶
func (id *InputDialog) Handle(ev base.Event)
func (*InputDialog) Init ¶
func (id *InputDialog) Init(title, prompt string)
Init is initialize InputDialog.
func (*InputDialog) IsFlexibleHeight ¶
func (id *InputDialog) IsFlexibleHeight() bool
func (*InputDialog) IsFlexibleWidth ¶
func (id *InputDialog) IsFlexibleWidth() bool
func (*InputDialog) IsFocusable ¶
func (id *InputDialog) IsFocusable() bool
func (*InputDialog) Layout ¶
func (id *InputDialog) Layout(width, height int)
func (*InputDialog) MinimumSize ¶
func (id *InputDialog) MinimumSize(width, height int) (int, int)
func (*InputDialog) Move ¶
func (id *InputDialog) Move(x, y int)
func (*InputDialog) SetInputValue ¶
func (id *InputDialog) SetInputValue(value string)
SetInputValue sets the input field value
func (*InputDialog) SetPrompt ¶
func (id *InputDialog) SetPrompt(prompt string)
SetPrompt updates the dialog prompt
func (*InputDialog) SetTitle ¶
func (id *InputDialog) SetTitle(title string)
SetTitle updates the dialog title
func (*InputDialog) SubFocusFirst ¶
func (id *InputDialog) SubFocusFirst()
func (*InputDialog) SubFocusLast ¶
func (id *InputDialog) SubFocusLast()
func (*InputDialog) SubFocusNext ¶
func (id *InputDialog) SubFocusNext() bool
func (*InputDialog) SubFocusPrev ¶
func (id *InputDialog) SubFocusPrev() bool
func (*InputDialog) Traverse ¶
func (id *InputDialog) Traverse(fm *tui.FocusManager)
func (*InputDialog) Update ¶
func (id *InputDialog) Update()
type MessageDialog ¶
type MessageDialog struct {
Width, Height int
// contains filtered or unexported fields
}
MessageDialog is dialog with message label.
func NewMessageDialog ¶
func NewMessageDialog(title, message string, onOK func(base.Runtime)) *MessageDialog
NewMessageDialog returns MessageDialog.
func (*MessageDialog) Draw ¶
func (md *MessageDialog) Draw(g *base.Graphics)
func (*MessageDialog) ExecuteOK ¶
func (md *MessageDialog) ExecuteOK(runtime base.Runtime)
ExecuteOK manually executes the OK callback
func (*MessageDialog) Focus ¶
func (md *MessageDialog) Focus(on bool)
func (*MessageDialog) Handle ¶
func (md *MessageDialog) Handle(ev base.Event)
func (*MessageDialog) Init ¶
func (md *MessageDialog) Init(title, message string)
Init is initialize MessageDialog.
func (*MessageDialog) IsFlexibleHeight ¶
func (md *MessageDialog) IsFlexibleHeight() bool
func (*MessageDialog) IsFlexibleWidth ¶
func (md *MessageDialog) IsFlexibleWidth() bool
func (*MessageDialog) IsFocusable ¶
func (md *MessageDialog) IsFocusable() bool
func (*MessageDialog) Layout ¶
func (md *MessageDialog) Layout(width, height int)
func (*MessageDialog) MinimumSize ¶
func (md *MessageDialog) MinimumSize(width, height int) (int, int)
func (*MessageDialog) Move ¶
func (md *MessageDialog) Move(x, y int)
func (*MessageDialog) SetButtonText ¶
func (md *MessageDialog) SetButtonText(text string)
SetButtonText updates the OK button text
func (*MessageDialog) SetMessage ¶
func (md *MessageDialog) SetMessage(message string)
SetMessage updates the dialog message
func (*MessageDialog) SetTitle ¶
func (md *MessageDialog) SetTitle(title string)
SetTitle updates the dialog title
func (*MessageDialog) SubFocusFirst ¶
func (md *MessageDialog) SubFocusFirst()
func (*MessageDialog) SubFocusLast ¶
func (md *MessageDialog) SubFocusLast()
func (*MessageDialog) SubFocusNext ¶
func (md *MessageDialog) SubFocusNext() bool
func (*MessageDialog) SubFocusPrev ¶
func (md *MessageDialog) SubFocusPrev() bool
func (*MessageDialog) Traverse ¶
func (md *MessageDialog) Traverse(fm *tui.FocusManager)
func (*MessageDialog) Update ¶
func (md *MessageDialog) Update()