mirror of
https://github.com/Stone-Red-Code/RemSox.git
synced 2026-09-07 15:56:31 +02:00
Add Panel, ProgressBar, RadioButton, and Slider UI controls and test windows
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user