public AElement(AElement parent, int on_page) { Parent = parent; Page = on_page; IsDisposed = false; IsEnabled = true; IsModal = false; IsMovable = false; IsVisible = true; }
public void AnnounceElementGivesUpKeyboardInput(AElement e) { }
internal void ReceiveMouseInput(Point MousePosition, List<InputEventMouse> events) { List<AElement> mouseOverControls = null; if (m_CurrentScreen != null) { if (m_CurrentScreen.GetElementsAtPoint(MousePosition, true, out mouseOverControls)) { MouseOverControl = mouseOverControls[0]; foreach (InputEventMouse e in events) ((AElementController)MouseOverControl.GetController()).ReceiveMouseInput(MousePosition, events); } else { MouseOverControl = null; } } // clear mouse down elements if there is a mouse up event. foreach (InputEventMouse e in events) if (e.EventType == MouseEvent.Up) InformMouseDownElementsThatMouseIsUp(e); }
internal bool AnnounceElementOnMouseUp(AElement e, MouseButton b) { bool control_has_no_other_mouse_downs = true; if (m_MouseDownElements == null || m_MouseDownElements.Count == 0) return control_has_no_other_mouse_downs; for (int i = 0; i < m_MouseDownElements.Count; i++) { Tuple<AElement, MouseButton> md = m_MouseDownElements[i]; if (md.Item1 == e) { if (md.Item2 == b) { m_MouseDownElements.RemoveAt(i); i--; } else { control_has_no_other_mouse_downs = false; } } } return control_has_no_other_mouse_downs; }
internal void AnnounceElementOnMouseDown(AElement e, MouseButton b) { if (m_MouseDownElements == null) m_MouseDownElements = new List<Tuple<AElement, MouseButton>>(); m_MouseDownElements.Add(new Tuple<AElement, MouseButton>(e, b)); if (b == MouseButton.Left) { if (e.HandlesKeyboardInput) KeyboardFocusControl = e; } }
public void AnnounceElementWantsKeyboardInput(AElement e) { }
public void RemoveChild(AElement c) { if (Children == null) return; if (Children.Contains(c)) { if (!c.IsDisposed) c.Dispose(); Children.Remove(c); if (Children.Count == 0) Children = null; } }
public AElement AddChild(AElement c, bool behind_all = false) { if (Children == null) Children = new List<AElement>(); if (behind_all) Children.Insert(0, c); else Children.Add(c); if (IsInitialized) c.Initialize(Manager); return c; }
public AElementController(AElement model, GUIManager manager) : base(model) { Manager = manager; }