Sander Schobers
dbc017507c
Fixed issue where events of partially and invisible controls where incorrectly handled.
29 lines
483 B
Go
29 lines
483 B
Go
package ui
|
|
|
|
import (
|
|
"opslag.de/schobers/geom"
|
|
)
|
|
|
|
type Control interface {
|
|
Arrange(Context, geom.RectangleF32, geom.PointF32, Control)
|
|
DesiredSize(Context) geom.PointF32
|
|
Handle(Context, Event)
|
|
Render(Context)
|
|
|
|
Bounds() geom.RectangleF32
|
|
IsInBounds(p geom.PointF32) bool
|
|
IsOver() bool
|
|
Offset() geom.PointF32
|
|
OnClick(ClickFn)
|
|
OnDragStart(DragStartFn)
|
|
OnDragMove(DragMoveFn)
|
|
OnDragEnd(DragEndFn)
|
|
Parent() Control
|
|
}
|
|
|
|
type RootControl interface {
|
|
Control
|
|
|
|
Init(Context)
|
|
}
|