func (f *Form) GetButtons() []*Button {
	return f.buttons
}
GetButtons get buttons
package component
import (
	"github.com/jroimartin/gocui"
)
type Form struct {
	*gocui.Gui
	activeItem  int
	activeRadio int
	name        string
	inputs      []*InputField
	checkBoxs   []*CheckBox
	buttons     []*Button
	selects     []*Select
	radios      []*Radio
	components  []Component
	closeFuncs  []func() error
	*Position
}
type FormData struct {
	inputs    map[string]string
	checkBoxs map[string]bool
	selects   map[string]string
	radio     map[string]string
}
func NewForm(gui *gocui.Gui, name string, x, y, w, h int) *Form {
	f := &Form{
		Gui:        gui,
		activeItem: 0,
		name:       name,
		Position: &Position{
			X: x,
			Y: y,
			W: x + w,
			H: y + h,
		},
	}
	return f
}
func (f *Form) AddInputField(label string, labelWidth, fieldWidth int) *InputField {
	var y int
	p := f.getLastViewPosition()
	if p != nil {
		y = p.H
	} else {
		y = f.Y + 1
	}
	input := NewInputField(
		f.Gui,
		label,
		f.X+1,
		y,
		labelWidth,
		fieldWidth,
	)
	f.inputs = append(f.inputs, input)
	f.components = append(f.components, input)
	return input
}
func (f *Form) AddButton(label string, handler Handler) *Button {
	var x int
	var y int
	p := f.getLastViewPosition()
	if p != nil {
		if f.isButtonLastView() {
			x = p.W
			y = p.Y - 1
		} else {
			x = f.X
			y = p.H
		}
	} else {
		x = f.X
		y = f.Y
	}
	button := NewButton(
		f.Gui,
		label,
		x+1,
		y+1,
		len(label),
	)
	button.AddHandler(gocui.KeyEnter, handler)
	f.buttons = append(f.buttons, button)
	f.components = append(f.components, button)
	return button
}
func (f *Form) AddCheckBox(label string, width int) *CheckBox {
	var y int
	p := f.getLastViewPosition()
	if p != nil {
		y = p.H
	} else {
		y = f.Y
	}
	checkbox := NewCheckBox(
		f.Gui,
		label,
		f.X+1,
		y,
		width,
	)
	f.checkBoxs = append(f.checkBoxs, checkbox)
	f.components = append(f.components, checkbox)
	return checkbox
}
func (f *Form) AddSelect(label string, labelWidth, listWidth int) *Select {
	var y int
	p := f.getLastViewPosition()
	if p != nil {
		y = p.H
	} else {
		y = f.Y
	}
	Select := NewSelect(
		f.Gui,
		label,
		f.X+1,
		y,
		labelWidth,
		listWidth,
	)
	f.selects = append(f.selects, Select)
	f.components = append(f.components, Select)
	return Select
}
func (f *Form) AddRadio(label string, width int) *Radio {
	var x, y int
	p := f.getLastViewPosition()
	if p != nil {
		y = p.H
	} else {
		y = f.Y
	}
	radio := NewRadio(f.Gui, label, x+1, y, width)
	f.radios = append(f.radios, radio)
	f.components = append(f.components, radio)
	return radio
}
func (f *Form) AddCloseFunc(function func() error) {
	f.closeFuncs = append(f.closeFuncs, function)
}
func (f *Form) GetFieldTexts() map[string]string {
	data := make(map[string]string)
	if len(f.inputs) == 0 {
		return data
	}
	for _, item := range f.inputs {
		data[item.GetLabel()] = item.GetFieldText()
	}
	return data
}
func (f *Form) GetFieldText(target string) string {
	return f.GetFieldTexts()[target]
}
func (f *Form) GetCheckBoxStates() map[string]bool {
	state := make(map[string]bool)
	if len(f.checkBoxs) == 0 {
		return state
	}
	for _, box := range f.checkBoxs {
		state[box.GetLabel()] = box.IsChecked()
	}
	return state
}
func (f *Form) GetCheckBoxState(target string) bool {
	return f.GetCheckBoxStates()[target]
}
func (f *Form) GetSelectedOpts() map[string]string {
	opts := make(map[string]string)
	if len(f.selects) == 0 {
		return opts
	}
	for _, Select := range f.selects {
		opts[Select.GetLabel()] = Select.GetSelected()
	}
	return opts
}
func (f *Form) GetSelectedOpt(target string) string {
	return f.GetSelectedOpts()[target]
}
func (f *Form) GetSelectedRadios() map[string]string {
	radios := map[string]string{}
	for _, r := range f.radios {
		radios[r.GetLabel()] = r.GetSelected()
	}
	return radios
}
func (f *Form) GetSelectedRadio(target string) string {
	return f.GetSelectedOpts()[target]
}
func (f *Form) GetRadioText() string {
	if len(f.radios) == 0 {
		return ""
	}
	return f.radios[f.activeRadio].GetLabel()
}
func (f *Form) GetFormData() *FormData {
	fd := &FormData{
		inputs:    f.GetFieldTexts(),
		checkBoxs: f.GetCheckBoxStates(),
		selects:   f.GetSelectedOpts(),
		radio:     f.GetSelectedRadios(),
	}
	return fd
}
func (f *Form) GetInputs() []*InputField {
	return f.inputs
}
func (f *Form) GetCheckBoxs() []*CheckBox {
	return f.checkBoxs
}