コード例 #1
0
ファイル: CellBody.cs プロジェクト: yurrig/ToDoList_Dev
        /// <summary>
        /// Paint cell body.
        /// </summary>
        /// <param name="dc">Platform independency graphics context.</param>
        public override void OnPaint(CellDrawingContext dc)
        {
            dc.DrawCellBackground();

            if (this.ContentBounds.Width > 0 || this.ContentBounds.Height > 0)
            {
                this.OnContentPaint(dc);
            }
        }
コード例 #2
0
        /// <summary>
        /// Paint cell body.
        /// </summary>
        /// <param name="dc">Platform independency graphics context.</param>
        public override void OnPaint(CellDrawingContext dc)
        {
            var contentRect = new Rectangle(new Point(0, 0), this.GetContentSize());

            if (this.Cell != null)
            {
                RGFloat x = 0, y = 0;

                switch (Cell.InnerStyle.HAlign)
                {
                case ReoGridHorAlign.Left:
                    x = Bounds.X + 1;
                    break;

                case ReoGridHorAlign.Center:
                    x = Bounds.X + (Bounds.Width - contentRect.Width) / 2;
                    break;

                case ReoGridHorAlign.Right:
                    x = Bounds.Right - contentRect.Width - 1;
                    break;
                }

                switch (Cell.InnerStyle.VAlign)
                {
                case ReoGridVerAlign.Top:
                    y = Bounds.Y + 1;
                    break;

                case ReoGridVerAlign.Middle:
                    y = Bounds.Y + (Bounds.Height - contentRect.Height) / 2;
                    break;

                case ReoGridVerAlign.Bottom:
                    y = Bounds.Bottom - contentRect.Height - 1;
                    break;
                }

                contentRect = new Rectangle(x, y, contentRect.Width, contentRect.Height);
            }
            else
            {
                contentRect = new Rectangle(Bounds.X + (Bounds.Width - contentRect.Width) / 2,
                                            Bounds.Y + (Bounds.Height - contentRect.Height) / 2, contentRect.Width, contentRect.Height);
            }

            this.ContentBounds = contentRect;

            dc.DrawCellBackground();

            if (this.ContentBounds.Width > 0 || this.ContentBounds.Height > 0)
            {
                this.OnContentPaint(dc);
            }
        }
コード例 #3
0
ファイル: CellBody.cs プロジェクト: yurrig/ToDoList_Dev
 /// <summary>
 /// Paint the content of body.
 /// </summary>
 /// <param name="dc">Platform independency graphics context.</param>
 public virtual void OnPaint(CellDrawingContext dc)
 {
     dc.DrawCellBackground();
     dc.DrawCellText();
 }