2019-03-05 20:52:18 +00:00
|
|
|
package ui
|
|
|
|
|
|
|
|
import (
|
|
|
|
"opslag.de/schobers/geom"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Control interface {
|
2019-04-11 21:38:32 +00:00
|
|
|
Arrange(Context, geom.RectangleF32, geom.PointF32, Control)
|
2019-03-05 20:52:18 +00:00
|
|
|
DesiredSize(Context) geom.PointF32
|
|
|
|
Handle(Context, Event)
|
|
|
|
Render(Context)
|
|
|
|
|
|
|
|
Bounds() geom.RectangleF32
|
2019-04-11 21:38:32 +00:00
|
|
|
IsInBounds(p geom.PointF32) bool
|
|
|
|
IsOver() bool
|
2019-03-05 21:42:57 +00:00
|
|
|
Offset() geom.PointF32
|
2019-03-05 20:52:18 +00:00
|
|
|
OnClick(ClickFn)
|
|
|
|
OnDragStart(DragStartFn)
|
|
|
|
OnDragMove(DragMoveFn)
|
|
|
|
OnDragEnd(DragEndFn)
|
2019-04-11 21:38:32 +00:00
|
|
|
Parent() Control
|
2019-03-05 20:52:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type RootControl interface {
|
|
|
|
Control
|
|
|
|
|
|
|
|
Init(Context)
|
|
|
|
}
|