Basic elements now conform to new API

This commit is contained in:
2023-03-15 01:41:23 -04:00
parent f4799ba03d
commit 0015820fac
15 changed files with 137 additions and 272 deletions

View File

@@ -29,9 +29,9 @@ type Checkbox struct {
func NewCheckbox (text string, checked bool) (element *Checkbox) {
element = &Checkbox { checked: checked }
element.theme.Case = theme.C("basic", "checkbox")
element.Core, element.core = core.NewCore(element.draw)
element.Core, element.core = core.NewCore(element, element.draw)
element.FocusableCore,
element.focusableControl = core.NewFocusableCore(element.redo)
element.focusableControl = core.NewFocusableCore(element.core, element.redo)
element.SetText(text)
return
}
@@ -65,9 +65,6 @@ func (element *Checkbox) HandleMouseUp (x, y int, button input.Button) {
}
}
func (element *Checkbox) HandleMouseMove (x, y int) { }
func (element *Checkbox) HandleMouseScroll (x, y int, deltaX, deltaY float64) { }
func (element *Checkbox) HandleKeyDown (key input.Key, modifiers input.Modifiers) {
if key == input.KeyEnter {
element.pressed = true