public override void OnLayout(IGUIContext ctx, RectangleF bounds) { if (IsLayoutSuspended) { return; } SetBounds(bounds); if (TB.Font != null) { float height = TB.Font.TextBoxHeight; Button.SetBounds(new RectangleF(bounds.Right - height - 1, bounds.Top.Ceil(), height + 1, (int)height)); TB.OnLayout(ctx, new RectangleF(bounds.Left, bounds.Top, bounds.Width - height, height)); } }
public override void OnLayout(IGUIContext ctx, RectangleF bounds) { if (IsLayoutSuspended) { return; } SetBounds(bounds); bounds = Bounds; float buttonWidth = UpButton.PreferredSize(ctx).Width; float halfHeight = bounds.Height / 2f; float buttonLeft = bounds.Right - buttonWidth; UpButton.SetBounds(new RectangleF(buttonLeft, bounds.Top, buttonWidth, halfHeight)); DownButton.SetBounds(new RectangleF(buttonLeft, bounds.Top + halfHeight - 1, buttonWidth, bounds.Height - halfHeight)); TB.OnLayout(ctx, new RectangleF(bounds.Left, bounds.Top, bounds.Width - buttonWidth, bounds.Height)); }