Exemplo n.º 1
0
        /// <summary>
        /// Určí souřadnice prostoru pro buttony
        /// </summary>
        /// <param name="parentWidth"></param>
        /// <param name="parentHeight"></param>
        /// <param name="contentWidth"></param>
        /// <param name="borderWidth"></param>
        /// <param name="buttonsAlignment"></param>
        /// <param name="x"></param>
        /// <param name="y"></param>
        protected void _AlignContent(float parentWidth, float parentHeight, float contentWidth, float borderWidth, ContentAlignment buttonsAlignment, out float x, out float y)
        {
            int        borderHeight  = 6;
            SizeF      contentSize   = new SizeF(contentWidth, ButtonItemHeight);
            RectangleF totalBounds   = new RectangleF(borderWidth, borderHeight, parentWidth - 2 * borderWidth, parentHeight - 2 * borderHeight);
            RectangleF contentBounds = contentSize.AlignTo(totalBounds, buttonsAlignment);

            x = contentBounds.X;
            y = contentBounds.Y;
        }