public void RemoveChild(UIElement child) { if (children.Remove(child)) { clickActions.Remove(child); UpdateLayout(); } }
public void AddChild(UIElement child, Action action = null) { if (!children.Contains(child)) { children.Add(child); clickActions.Add(child, action); UpdateLayout(); } }
private bool DispatchPressed(int x, int y) { foreach (Panel obj in DrawableUIElemts) { if (obj.OnMousePressed(x, y)) { CurrerentElement = panel; return true; } } return false; }
private bool DispatchReleased(int x, int y) { if (CurrerentElement != null) { foreach (Panel obj in DrawableUIElemts) { if (obj.OnMouseReleased(x, y)) { CurrerentElement = null; return true; } } } return false; }