Beispiel #1
0
        /// <summary>
        /// Performs layout of sub controls, such as element host, scroll bars etc..
        /// </summary>
        protected virtual void LayoutSubControls()
        {
            int vw = m_VScrollBar.Width;
            int hh = m_HScrollBar.Height;

            m_VScrollBar.SetBounds(Width - vw - Padding.Right, Padding.Top, vw, Height - hh - Padding.Vertical);
            m_HScrollBar.SetBounds(Padding.Left, Height - hh - Padding.Bottom, Width - vw - Padding.Horizontal, hh);

            var newWidth    = m_VScrollBar.Left - 1 - Padding.Left;
            var newHeight   = m_HScrollBar.Top - 1 - Padding.Top;
            var needRebuild = newHeight != m_CellView.Height;

            m_CellView.SetBounds(Padding.Left, Padding.Top, newWidth, newHeight);

            if (needRebuild)
            {
                rebuildAllCells();
            }
        }