Sander Schobers
75fce53716
Extended DesiredSize method with extra arguments that tells the control how much space is available for the parent control (note: this might not be the actual given size when Arrange is called on the control).
44 lines
1.0 KiB
Go
44 lines
1.0 KiB
Go
package ui
|
|
|
|
import "opslag.de/schobers/geom"
|
|
|
|
var _ Control = &Proxy{}
|
|
|
|
type Proxy struct {
|
|
Content Control
|
|
}
|
|
|
|
func (p *Proxy) Arrange(ctx Context, bounds geom.RectangleF32, offset geom.PointF32, parent Control) {
|
|
p.Content.Arrange(ctx, bounds, offset, parent)
|
|
}
|
|
|
|
func (p *Proxy) DesiredSize(ctx Context, size geom.PointF32) geom.PointF32 {
|
|
return p.Content.DesiredSize(ctx, size)
|
|
}
|
|
|
|
func (p *Proxy) Handle(ctx Context, e Event) bool {
|
|
return p.Content.Handle(ctx, e)
|
|
}
|
|
|
|
func (p *Proxy) Render(ctx Context) {
|
|
p.Content.Render(ctx)
|
|
}
|
|
|
|
func (p *Proxy) Bounds() geom.RectangleF32 {
|
|
return p.Content.Bounds()
|
|
}
|
|
|
|
func (p *Proxy) Disable() { p.Content.Disable() }
|
|
|
|
func (p *Proxy) Enable() { p.Content.Enable() }
|
|
|
|
func (p *Proxy) IsDisabled() bool { return p.Content.IsDisabled() }
|
|
|
|
func (p *Proxy) IsInBounds(pt geom.PointF32) bool { return p.Content.IsInBounds(pt) }
|
|
|
|
func (p *Proxy) IsOver() bool { return p.Content.IsOver() }
|
|
|
|
func (p *Proxy) Offset() geom.PointF32 { return p.Content.Offset() }
|
|
|
|
func (p *Proxy) Parent() Control { return p.Content.Parent() }
|