Пример #1
0
        public AElement(AElement parent, int on_page)
        {
            Parent = parent;
            Page = on_page;

            IsDisposed = false;
            IsEnabled = true;
            IsModal = false;
            IsMovable = false;
            IsVisible = true;
        }
Пример #2
0
 public void AnnounceElementGivesUpKeyboardInput(AElement e)
 {
 }
Пример #3
0
        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);
        }
Пример #4
0
        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;
        }
Пример #5
0
        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;
            }
        }
Пример #6
0
 public void AnnounceElementWantsKeyboardInput(AElement e)
 {
 }
Пример #7
0
 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;
     }
 }
Пример #8
0
        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;
        }
Пример #9
0
 public AElementController(AElement model, GUIManager manager)
     : base(model)
 {
     Manager = manager;
 }