Example #1
0
        protected override Size OnArrange(Size finalSize)
        {
            int x      = 0;
            int height = 0;

            for (int i = 0; i < m_ColumnCount; i++)
            {
                ControlBase control = m_Columns[i].Control;
                if (control != null)
                {
                    if (i == m_ColumnCount - 1)
                    {
                        control.Arrange(new Rectangle(x, 0, Math.Max(0, finalSize.Width - x), control.MeasuredSize.Height));
                    }
                    else
                    {
                        control.Arrange(new Rectangle(x, 0, m_Columns[i].Width, control.MeasuredSize.Height));
                    }
                    height = Math.Max(height, control.MeasuredSize.Height);
                }
                x += m_Columns[i].Width;
            }

            return(new Size(finalSize.Width, height));
        }
Example #2
0
        /// <summary>
        /// Enables tooltip display for the specified control.
        /// </summary>
        /// <param name="control">Target control.</param>
        public static void Enable(ControlBase control)
        {
            if (null == control.ToolTip)
            {
                return;
            }

            ControlBase toolTip = control.ToolTip;

            g_ToolTip = control;
            toolTip.Measure(Size.Infinity);
            toolTip.Arrange(new Rectangle(Point.Zero, toolTip.MeasuredSize));
        }
Example #3
0
        protected override Size OnArrange(Size finalSize)
        {
            if (m_SubmenuArrow != null)
            {
                m_SubmenuArrow.Arrange(new Rectangle(finalSize.Width - Padding.Right - m_SubmenuArrow.MeasuredSize.Width, (finalSize.Height - m_SubmenuArrow.MeasuredSize.Height) / 2, m_SubmenuArrow.MeasuredSize.Width, m_SubmenuArrow.MeasuredSize.Height));
            }

            if (m_Accelerator != null)
            {
                m_Accelerator.Arrange(new Rectangle(finalSize.Width - Padding.Right - m_Accelerator.MeasuredSize.Width, (finalSize.Height - m_Accelerator.MeasuredSize.Height) / 2, m_Accelerator.MeasuredSize.Width, m_Accelerator.MeasuredSize.Height));
            }

            return(base.OnArrange(finalSize));
        }