dialog

package module
v0.0.0-...-9c8b201 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DIALOG_PROC         = "dialog"
	DEFAULT_HEIGHT      = 20
	DEFAULT_WIDTH       = 60
	DEFAULT_MENU_HEIGHT = 15
)

Variables

View Source
var (
	DefaultTitle  = "Title"
	ErrorDialogRc = "/etc/error.dialogrc"
)

Functions

This section is empty.

Types

type CheckListBox

type CheckListBox struct {
	Common
	Text        func() string
	Items       []CheckListItem
	Validate    func(string) (string, bool)
	NextSibling Dialog
}

func (*CheckListBox) Run

func (m *CheckListBox) Run(crumbs string) (Dialog, error)

type CheckListItem

type CheckListItem struct {
	Name  string
	Value *bool
}

type ChildDialog

type ChildDialog struct {
	Dialog
	Crumb      func() string
	ParentMenu *Menu
	MenuOption *MenuOption
}

type Common

type Common struct {
	DialogRc string
	Title    string
	Width    int
	Height   int
}

type Dialog

type Dialog interface {
	Run(string) (Dialog, error) // new child dialog, new sibling dialog, error.
}

type EditBox

type EditBox struct {
	Common
	Text        func() string
	GetValue    func() string
	SetValue    func(string)
	Validate    func(string) (string, bool)
	NextSibling Dialog
}

func (*EditBox) Run

func (m *EditBox) Run(crumbs string) (Dialog, error)

type InputBox

type InputBox struct {
	Common
	Text        func() string
	GetValue    func() string
	SetValue    func(string)
	Validate    func(string) (string, bool)
	NextSibling Dialog
}

func (*InputBox) Run

func (m *InputBox) Run(crumbs string) (Dialog, error)
type Menu struct {
	Common
	Text       func() string
	MenuHeight int
	DefaultKey string
	Options    func() ([]MenuOption, error)
}
func (m *Menu) Run(crumbs string) (Dialog, error)
type MenuOption struct {
	Key            string
	Text           string
	Next           Dialog
	NextDefaultKey string
	CrumbText      func() string
}

type MixedForm

type MixedForm struct {
	Text       string
	FormHeight int
	Items      []MixedFormItem
}

type MixedFormItem

type MixedFormItem struct {
	Label string
}

type MsgBox

type MsgBox struct {
	Common
	Text        string
	NextSibling Dialog
}

func (*MsgBox) Run

func (m *MsgBox) Run(crumbs string) (Dialog, error)

type Pause

type Pause struct {
	Common
	Text        string
	Seconds     int
	NextSibling Dialog
}

func (*Pause) Run

func (m *Pause) Run(crumbs string) (Dialog, error)

type ProgramBox

type ProgramBox struct {
	Common
	Text    string
	Program func(io.WriteCloser) error
	Next    Dialog
}

func (*ProgramBox) Run

func (m *ProgramBox) Run(crumbs string) (Dialog, error)

Jump to

Keyboard shortcuts

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