checkbox.go
func CreateCheckBox(parent Control, width int, title string, scale int) *CheckBox {
	c := new(CheckBox)
	c.BaseControl = NewBaseControl()
	c.parent = parent

	if width == AutoSize {
		width = xs.Len(title) + 4
	}

	c.SetSize(width, 1) // TODO: only one line checkboxes are supported at that moment
	c.SetConstraints(width, 1)
	c.state = 0
	c.SetTitle(title)
	c.SetTabStop(true)
	c.allow3state = false
	c.onChange = nil
	c.SetScale(scale)

	if parent != nil {
		parent.AddChild(c)
	}

	return c
}
func CreateCheckBox(parent Control, width int, title string, scale int) *CheckBox {
	c := new(CheckBox)
	c.BaseControl = NewBaseControl()
	c.parent = parent

	if width == AutoSize {
		width = xs.Len(title) + 4
	}

	c.SetSize(width, 1) // TODO: only one line checkboxes are supported at that moment
	c.SetConstraints(width, 1)
	c.state = 0
	c.SetTitle(title)
	c.SetTabStop(true)
	c.allow3state = false
	c.onChange = nil
	c.SetScale(scale)

	if parent != nil {
		parent.AddChild(c)
	}

	return c
}
func CreateCheckBox ( parent Control , width int , title string , scale int ) * CheckBox { c := new ( CheckBox ) c . BaseControl = NewBaseControl ( ) c . parent = parent if width == AutoSize { width = xs . Len ( title ) + 4 } c . SetSize ( width , 1 ) // TODO: only one line checkboxes are supported at that moment c . SetConstraints ( width , 1 ) c . state = 0 c . SetTitle ( title ) c . SetTabStop ( true ) c . allow3state = false c . onChange = nil c . SetScale ( scale ) if parent != nil { parent . AddChild ( c ) } return c }
/*
CreateCheckBox creates a new CheckBox control.
parent - is container that keeps the control. The same View can be a view and a parent at the same time.
width - is minimal width of the control.
title - button title.
scale - the way of scaling the control when the parent is resized. Use DoNotScale constant if the
control should keep its original size.
CheckBox state can be changed using mouse or pressing space on keyboard while the control is active
*/
/ * CreateCheckBox creates a new CheckBox control . parent - is container that keeps the control . The same View can be a view and a parent at the same time . width - is minimal width of the control . title - button title . scale - the way of scaling the control when the parent is resized . Use DoNotScale constant if the control should keep its original size . CheckBox state can be changed using mouse or pressing space on keyboard while the control is active