forked from google/gxui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontrol.go
59 lines (53 loc) · 1.66 KB
/
control.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package gxui
import (
"github.com/google/gxui/math"
)
type Control interface {
Size() math.Size
SetSize(math.Size)
Draw() Canvas
Parent() Container
SetParent(Container)
Attached() bool
Attach()
Detach()
DesiredSize(min, max math.Size) math.Size
Margin() math.Spacing
SetMargin(math.Spacing)
IsVisible() bool
SetVisible(bool)
ContainsPoint(math.Point) bool
IsMouseOver() bool
IsMouseDown(button MouseButton) bool
Click(MouseEvent) (consume bool)
DoubleClick(MouseEvent) (consume bool)
KeyPress(KeyboardEvent) (consume bool)
KeyStroke(KeyStrokeEvent) (consume bool)
MouseScroll(MouseEvent) (consume bool)
MouseMove(MouseEvent)
MouseEnter(MouseEvent)
MouseExit(MouseEvent)
MouseDown(MouseEvent)
MouseUp(MouseEvent)
KeyDown(KeyboardEvent)
KeyUp(KeyboardEvent)
KeyRepeat(KeyboardEvent)
OnAttach(func()) EventSubscription
OnDetach(func()) EventSubscription
OnKeyPress(func(KeyboardEvent)) EventSubscription
OnKeyStroke(func(KeyStrokeEvent)) EventSubscription
OnClick(func(MouseEvent)) EventSubscription
OnDoubleClick(func(MouseEvent)) EventSubscription
OnMouseMove(func(MouseEvent)) EventSubscription
OnMouseEnter(func(MouseEvent)) EventSubscription
OnMouseExit(func(MouseEvent)) EventSubscription
OnMouseDown(func(MouseEvent)) EventSubscription
OnMouseUp(func(MouseEvent)) EventSubscription
OnMouseScroll(func(MouseEvent)) EventSubscription
OnKeyDown(func(KeyboardEvent)) EventSubscription
OnKeyUp(func(KeyboardEvent)) EventSubscription
OnKeyRepeat(func(KeyboardEvent)) EventSubscription
}