Exemplo n.º 1
0
        /// <summary>
        /// Render the FormulaBack
        /// </summary>
        /// <param name="g">Graphics to render</param>
        /// <param name="R">Rectangle</param>
        public void Render(Graphics g, Rectangle R)
        {
            g.FillRectangle(BackGround.GetBrush(), R);
            R.Width--;
            R.Height--;

            int w = (int)(LeftPen.Width - 1);

            if (w >= 0)
            {
                g.DrawLine(LeftPen.GetPen(), R.Left + w, R.Top, R.Left + w, R.Bottom);
            }

            w = (int)(TopPen.Width - 1);
            if (w >= 0)
            {
                g.DrawLine(TopPen.GetPen(), R.Left, R.Top + w, R.Right, R.Top + w);
            }

            w = (int)(RightPen.Width - 1);
            if (w >= 0)
            {
                g.DrawLine(RightPen.GetPen(), R.Right, R.Top, R.Right, R.Bottom);
            }

            w = (int)(BottomPen.Width - 1);
            if (w >= 0)
            {
                g.DrawLine(BottomPen.GetPen(), R.Left, R.Bottom, R.Right, R.Bottom);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// A Clone of FormulaBack
        /// </summary>
        /// <returns></returns>
        public object Clone()
        {
            FormulaBack fb = new FormulaBack();

            fb.BackGround = BackGround.Clone();
            fb.LeftPen    = LeftPen.Clone();
            fb.RightPen   = RightPen.Clone();
            fb.BottomPen  = BottomPen.Clone();
            fb.TopPen     = TopPen.Clone();
            return(fb);
        }