예제 #1
0
        public virtual void OnDraw()
        {
            for (int i = 0; i < m_Children.Count; i++)
            {
                GUIWidget <T> child = m_Children[i];
                if (child.Visible)
                {
                    GetRenderer().PushTransform();
                    //Affine transform = GetRenderer().GetTransform();
                    //transform *= child.GetTransform();

                    IAffineTransformMatrix <T> transform = GetRenderer().GetTransform();
                    transform = MatrixFactory <T> .CreateAffine(transform.Multiply(child.GetTransform()));

                    //transform *= child.GetTransform();

                    GetRenderer().SetTransform(transform);
                    child.OnDraw();
#if false
                    if (Focused)
                    {
                        RoundedRect rect = new RoundedRect(-5, -5, 5, 5, 0);
                        GetRenderer().Render(rect, new RGBA_Bytes(1.0, 0, 0, .5));
                    }
#endif

                    GetRenderer().PopTransform();
                }
            }
        }
예제 #2
0
        public virtual void OnKeyUp(KeyEventArgs keyEvent)
        {
            GUIWidget <T> childWithFocus = GetChildContainingFocus();

            if (childWithFocus != null && childWithFocus.Visible)
            {
                childWithFocus.OnKeyUp(keyEvent);
            }
        }
예제 #3
0
        public void RectToScreen(ref RectDouble <T> clientRect)
        {
            GUIWidget <T> prevGUIWidget = this;

            while (prevGUIWidget != null)
            {
                prevGUIWidget.GetTransform().Transform(ref clientRect);
                prevGUIWidget = prevGUIWidget.Parrent;
            }
        }
예제 #4
0
        public void PointToScreen(ref IVector <T> clientPoint)
        {
            GUIWidget <T> prevGUIWidget = this;

            while (prevGUIWidget != null)
            {
                prevGUIWidget.GetTransform().Transform(ref clientPoint);
                prevGUIWidget = prevGUIWidget.Parrent;
            }
        }
예제 #5
0
        public void PointToClient(ref T screenPointX, ref T screenPointY)
        {
            GUIWidget <T> curGUIWidget = this;

            while (curGUIWidget != null)
            {
                curGUIWidget.GetTransform().Inverse.Transform(ref screenPointX, ref screenPointY);
                curGUIWidget = curGUIWidget.Parrent;
            }
        }
예제 #6
0
        protected void FocusNext()
        {
            GUIWidget <T> childWithFocus = GetChildContainingFocus();

            for (int i = 0; i < m_Children.Count; i++)
            {
                GUIWidget <T> child = m_Children[i];
                if (child.Visible)
                {
                }
            }
        }
예제 #7
0
        public virtual void OnKeyDown(KeyEventArgs keyEvent)
        {
            GUIWidget <T> childWithFocus = GetChildContainingFocus();

            if (childWithFocus != null && childWithFocus.Visible)
            {
                childWithFocus.OnKeyDown(keyEvent);
            }

            if (!keyEvent.Handled && keyEvent.KeyCode == Keys.Tab)
            {
                if (keyEvent.Shift)
                {
                    FocusPrevious();
                }
                else
                {
                    FocusNext();
                }
            }
        }
예제 #8
0
        public bool SetChildCurrent(T x, T y)
        {
            for (int i = 0; i < m_Children.Count; i++)
            {
                GUIWidget <T> child = m_Children[i];
                if (child.Visible)
                {
                    if (child.InRect(x, y))
                    {
                        if (!child.Focused)
                        {
                            child.Focus();
                            return(true);
                        }

                        return(false);
                    }
                }
            }

            return(false);
        }
예제 #9
0
 public void RemoveChild(GUIWidget <T> child)
 {
     child.m_Parrent = null;
     m_Children.Remove(child);
     child.OnParentChanged();
 }
예제 #10
0
 public void AddChild(GUIWidget <T> child)
 {
     child.m_Parrent = this;
     m_Children.Add(child);
     child.OnParentChanged();
 }