checkbox

package
v0.0.0-...-955f326 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2020 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckBox

type CheckBox struct {
	ux.Panel

	ClickCallback func()
	Pressed       bool
	// contains filtered or unexported fields
}

CheckBox represents a clickable checkbox with an optional label.

func New

func New() *CheckBox

New creates a new checkbox.

func (*CheckBox) BackgroundInk

func (c *CheckBox) BackgroundInk() draw.Ink

BackgroundInk returns the ink that will be used for the background when enabled but not pressed or focused.

func (*CheckBox) Click

func (c *CheckBox) Click()

Click makes the checkbox behave as if a user clicked on it.

func (*CheckBox) ClickAnimationTime

func (c *CheckBox) ClickAnimationTime() time.Duration

ClickAnimationTime returns the amount of time to spend animating the click action.

func (*CheckBox) CornerRadius

func (c *CheckBox) CornerRadius() float64

CornerRadius returns the amount of rounding to use on the corners.

func (*CheckBox) DefaultDraw

func (c *CheckBox) DefaultDraw(gc draw.Context, dirty geom.Rect, inLiveResize bool)

DefaultDraw provides the default drawing.

func (*CheckBox) DefaultKeyDown

func (c *CheckBox) DefaultKeyDown(keyCode int, ch rune, mod keys.Modifiers, repeat bool) bool

DefaultKeyDown provides the default key down handling.

func (*CheckBox) DefaultMouseDown

func (c *CheckBox) DefaultMouseDown(where geom.Point, button, clickCount int, mod keys.Modifiers) bool

DefaultMouseDown provides the default mouse down handling.

func (*CheckBox) DefaultMouseDrag

func (c *CheckBox) DefaultMouseDrag(where geom.Point, button int, mod keys.Modifiers)

DefaultMouseDrag provides the default mouse drag handling.

func (*CheckBox) DefaultMouseUp

func (c *CheckBox) DefaultMouseUp(where geom.Point, button int, mod keys.Modifiers)

DefaultMouseUp provides the default mouse up handling.

func (*CheckBox) DefaultSizes

func (c *CheckBox) DefaultSizes(hint geom.Size) (min, pref, max geom.Size)

DefaultSizes provides the default sizing.

func (*CheckBox) EdgeInk

func (c *CheckBox) EdgeInk() draw.Ink

EdgeInk returns the ink that will be used for the edges.

func (*CheckBox) FocusedBackgroundInk

func (c *CheckBox) FocusedBackgroundInk() draw.Ink

FocusedBackgroundInk returns the ink that will be used for the background when enabled and focused.

func (*CheckBox) Font

func (c *CheckBox) Font() *draw.Font

Font returns the font that will be used when drawing text content.

func (*CheckBox) Gap

func (c *CheckBox) Gap() float64

Gap returns the gap to put between the checkbox, image and text.

func (*CheckBox) HAlign

func (c *CheckBox) HAlign() align.Alignment

HAlign returns the horizontal alignment.

func (*CheckBox) Image

func (c *CheckBox) Image() *draw.Image

Image returns the image. May be nil.

func (*CheckBox) PressedBackgroundInk

func (c *CheckBox) PressedBackgroundInk() draw.Ink

PressedBackgroundInk returns the ink that will be used for the background when enabled and pressed.

func (*CheckBox) PressedTextInk

func (c *CheckBox) PressedTextInk() draw.Ink

PressedTextInk returns the ink that will be used for the text when enabled and pressed.

func (*CheckBox) SetBackgroundInk

func (c *CheckBox) SetBackgroundInk(value draw.Ink) *CheckBox

SetBackgroundInk sets the ink that will be used for the background when enabled but not pressed or focused. Pass in nil to use the default.

func (*CheckBox) SetBorder

func (c *CheckBox) SetBorder(value border.Border) *CheckBox

SetBorder sets the border. May be nil.

func (*CheckBox) SetClickAnimationTime

func (c *CheckBox) SetClickAnimationTime(value time.Duration) *CheckBox

SetClickAnimationTime sets the amount of time to spend animating the click action.

func (*CheckBox) SetCornerRadius

func (c *CheckBox) SetCornerRadius(value float64) *CheckBox

SetCornerRadius sets the amount of rounding to use on the corners.

func (*CheckBox) SetEdgeInk

func (c *CheckBox) SetEdgeInk(value draw.Ink) *CheckBox

SetEdgeInk sets the ink that will be used for the edges. Pass in nil to use the default.

func (*CheckBox) SetEnabled

func (c *CheckBox) SetEnabled(enabled bool) *CheckBox

SetEnabled sets enabled state.

func (*CheckBox) SetFocusable

func (c *CheckBox) SetFocusable(focusable bool) *CheckBox

SetFocusable whether it can have the keyboard focus.

func (*CheckBox) SetFocusedBackgroundInk

func (c *CheckBox) SetFocusedBackgroundInk(value draw.Ink) *CheckBox

SetFocusedBackgroundInk sets the ink that will be used for the background when enabled and focused. Pass in nil to use the default.

func (*CheckBox) SetFont

func (c *CheckBox) SetFont(value *draw.Font) *CheckBox

SetFont sets the font that will be used when drawing text content. Pass in nil to use the default.

func (*CheckBox) SetGap

func (c *CheckBox) SetGap(value float64) *CheckBox

SetGap sets the gap to put between the checkbox, image and text.

func (*CheckBox) SetHAlign

func (c *CheckBox) SetHAlign(value align.Alignment) *CheckBox

SetHAlign sets the horizontal alignment.

func (*CheckBox) SetImage

func (c *CheckBox) SetImage(value *draw.Image) *CheckBox

SetImage sets the image. May be nil.

func (*CheckBox) SetPressedBackgroundInk

func (c *CheckBox) SetPressedBackgroundInk(value draw.Ink) *CheckBox

SetPressedBackgroundInk sets the ink that will be used for the background when enabled and pressed. Pass in nil to use the default.

func (*CheckBox) SetPressedTextInk

func (c *CheckBox) SetPressedTextInk(value draw.Ink) *CheckBox

SetPressedTextInk sets the ink that will be used for the text when enabled and pressed. Pass in nil to use the default.

func (*CheckBox) SetSide

func (c *CheckBox) SetSide(value side.Side) *CheckBox

SetSide sets the side of the text the image should be on.

func (*CheckBox) SetState

func (c *CheckBox) SetState(value state.State) *CheckBox

SetState sets the checked state.

func (*CheckBox) SetText

func (c *CheckBox) SetText(value string) *CheckBox

SetText sets the text content.

func (*CheckBox) SetTextInk

func (c *CheckBox) SetTextInk(value draw.Ink) *CheckBox

SetTextInk sets the ink that will be used for the text when disabled or not pressed. Pass in nil to use the default.

func (*CheckBox) SetVAlign

func (c *CheckBox) SetVAlign(value align.Alignment) *CheckBox

SetVAlign sets the vertical alignment.

func (*CheckBox) Side

func (c *CheckBox) Side() side.Side

Side returns the side of the text the image should be on.

func (*CheckBox) State

func (c *CheckBox) State() state.State

State returns the checked state.

func (*CheckBox) Text

func (c *CheckBox) Text() string

Text returns the text content.

func (*CheckBox) TextInk

func (c *CheckBox) TextInk() draw.Ink

TextInk returns the ink that will be used for the text when disabled or not pressed.

func (*CheckBox) VAlign

func (c *CheckBox) VAlign() align.Alignment

VAlign returns the vertical alignment.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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