59 lines
1.0 KiB
Go
59 lines
1.0 KiB
Go
package ui
|
|
|
|
import (
|
|
"time"
|
|
|
|
"opslag.de/schobers/geom"
|
|
"opslag.de/schobers/zntg/allg5"
|
|
)
|
|
|
|
type Wrapper struct {
|
|
Wrapped Control
|
|
Bounds geom.RectangleF32
|
|
}
|
|
|
|
func Wrap(c Control) Wrapper {
|
|
return Wrapper{Wrapped: c}
|
|
}
|
|
|
|
func (w *Wrapper) Created(ctx Context, p Container) error {
|
|
return w.Wrapped.Created(ctx, p)
|
|
}
|
|
|
|
func (w *Wrapper) Destroyed(ctx Context) {
|
|
w.Wrapped.Destroyed(ctx)
|
|
}
|
|
|
|
func (w *Wrapper) Update(ctx Context, d time.Duration) {
|
|
w.Wrapped.Update(ctx, d)
|
|
}
|
|
|
|
func (w *Wrapper) Handle(ctx Context, ev allg5.Event) {
|
|
w.Wrapped.Handle(ctx, ev)
|
|
}
|
|
|
|
func (w *Wrapper) DesiredSize(ctx Context) geom.PointF32 {
|
|
return w.Wrapped.DesiredSize(ctx)
|
|
}
|
|
|
|
func (w *Wrapper) Rect() geom.RectangleF32 {
|
|
return w.Bounds
|
|
}
|
|
|
|
func (w *Wrapper) SetRect(rect geom.RectangleF32) {
|
|
w.Bounds = rect
|
|
}
|
|
|
|
func (w *Wrapper) Render(ctx Context) {
|
|
w.Wrapped.Render(ctx)
|
|
}
|
|
|
|
func (w *Wrapper) Children() []Control {
|
|
return []Control{w.Wrapped}
|
|
}
|
|
|
|
func (w *Wrapper) Arrange(ctx Context, rect geom.RectangleF32) {
|
|
w.Bounds = rect
|
|
Arrange(ctx, w.Wrapped, rect)
|
|
}
|