Add Panel, ProgressBar, RadioButton, and Slider UI controls and test windows

This commit is contained in:
Stone_Red
2026-06-16 12:29:04 +02:00
parent 8ecca53881
commit 99c98e74a2
6 changed files with 438 additions and 18 deletions
+10 -3
View File
@@ -64,6 +64,7 @@ public sealed class Window(string title, int processId, int id, IRenderSource re
private readonly Dictionary<int, UIElement> uiElements = [];
private readonly Dictionary<int, Control> controls = [];
private Control? focusedControl = null;
private Control? capturedControl = null;
private int nextUIElementId = 1;
@@ -354,13 +355,19 @@ public sealed class Window(string title, int processId, int id, IRenderSource re
Point local = new(mouseEvent.X - Position.X, mouseEvent.Y - Position.Y);
Control? target = HitTestControl(local);
if (mouseEvent.Type == MouseEventType.ButtonDown && mouseEvent.Button == MouseButton.Left)
{
focusedControl = target;
capturedControl = HitTestControl(local);
focusedControl = capturedControl;
}
if (mouseEvent.Type == MouseEventType.ButtonUp && mouseEvent.Button == MouseButton.Left)
{
capturedControl = null;
}
Control? target = capturedControl ?? HitTestControl(local);
if (target is null)
{
return;