Exemple #1
0
        protected override Size Arrange(Size finalSize)
        {
            if (m_CheckBox.MeasuredSize.Height > m_Label.MeasuredSize.Height)
            {
                m_CheckBox.DoArrange(new Rectangle(0, 0, m_CheckBox.MeasuredSize.Width, m_CheckBox.MeasuredSize.Height));
                m_Label.DoArrange(new Rectangle(m_CheckBox.MeasuredSize.Width + 4, (m_CheckBox.MeasuredSize.Height - m_Label.MeasuredSize.Height) / 2, m_Label.MeasuredSize.Width, m_Label.MeasuredSize.Height));
            }
            else
            {
                m_CheckBox.DoArrange(new Rectangle(0, (m_Label.MeasuredSize.Height - m_CheckBox.MeasuredSize.Height) / 2, m_CheckBox.MeasuredSize.Width, m_CheckBox.MeasuredSize.Height));
                m_Label.DoArrange(new Rectangle(m_CheckBox.MeasuredSize.Width + 4, 0, m_Label.MeasuredSize.Width, m_Label.MeasuredSize.Height));
            }

            return(MeasuredSize);
        }
Exemple #2
0
        protected override Size Arrange(Size finalSize)
        {
            Properties parent = Parent as Properties;

            if (parent != null)
            {
                m_Label.DoArrange(new Rectangle(Padding.Left, Padding.Top, parent.LabelWidth - Padding.Left - Padding.Right, m_Label.MeasuredSize.Height));
                m_Property.DoArrange(new Rectangle(parent.LabelWidth + Padding.Left, Padding.Top, finalSize.Width - parent.LabelWidth - Padding.Left - Padding.Right, m_Property.MeasuredSize.Height));

                return(new Size(finalSize.Width, Math.Max(m_Label.MeasuredSize.Height, m_Property.MeasuredSize.Height) + Padding.Top + Padding.Bottom));
            }

            return(Size.Zero);
        }
Exemple #3
0
        protected override Size Arrange(Size finalSize)
        {
            if (m_SubmenuArrow != null)
            {
                m_SubmenuArrow.DoArrange(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.DoArrange(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.Arrange(finalSize));
        }