Пример #1
0
        public void CollapseNode(bool left)
        {
            var nodeA = left ? m_nodeL : m_nodeR;
            var nodeB = left ? m_nodeR : m_nodeL;

            if (nodeB.IsContentNode())
            {
                m_content      = nodeB.m_content;
                m_contentFocus = nodeB.m_contentFocus;

                nodeB.Clear();
                nodeA.Clear();

                m_nodeL = null;
                m_nodeR = null;
            }
            else
            {
                m_info.m_orient = nodeB.m_info.m_orient;

                m_nodeL          = nodeB.m_nodeL;
                m_nodeR          = nodeB.m_nodeR;
                m_nodeL.m_parent = this;
                m_nodeR.m_parent = this;

                m_separator          = nodeB.m_separator;
                m_separator.m_parent = this;

                nodeB.Clear();
                nodeA.Clear();
            }
        }
Пример #2
0
        public void Clear()
        {
            m_nodeL = null;
            m_nodeR = null;

            m_content      = null;
            m_contentFocus = null;
            m_info         = null;
            m_parent       = null;
            m_mgr          = null;
            m_separator    = null;
        }
Пример #3
0
 public void SwithcMode(bool contentMode)
 {
     if (contentMode)
     {
         m_nodeL = null;
         m_nodeR = null;
     }
     else
     {
         m_content      = null;
         m_contentFocus = null;
         if (m_separator == null)
         {
             m_separator = new GUIDockSeparator(this);
         }
     }
 }
Пример #4
0
        public void SeparatorMove(Vector2 offset, GUIDockSeparator sep)
        {
            System.Diagnostics.Debug.Assert(!IsContentNode());

            bool  horizontal = m_info.m_orient == GUIDockOrient.Horizontal;
            float off        = horizontal ? offset.X : offset.Y;

            var sizeL = m_nodeL.m_info.m_size;
            var sizeR = m_nodeR.m_info.m_size;

            float szmin = 100f;

            if (horizontal)
            {
                if (sizeL.Z + off < szmin || sizeR.Z - off < szmin)
                {
                    off = 0;
                }

                sizeL.Z += off;
                sizeR.Z -= off;
            }
            else
            {
                if (sizeL.W + off < szmin || sizeR.W - off < szmin)
                {
                    off = 0;
                }

                sizeL.W += off;
                sizeR.W -= off;
            }

            m_nodeL.m_info.m_sizeNext = sizeL;
            m_nodeR.m_info.m_sizeNext = sizeR;
        }