예제 #1
0
파일: YataPanels.cs 프로젝트: kevL/yata
        /// <summary>
        /// Overrides the <c>Paint</c> handler on this <c>YataPanelCols</c>.
        /// </summary>
        /// <param name="e"></param>
        /// <remarks>Assigns <c>e.Graphics</c> to
        /// <c><see cref="YataGrid.graphics">YataGrid.graphics</see></c> for
        /// <c><see cref="YataGrid.LabelColheads()">YataGrid.LabelColheads()</see></c>.</remarks>
        protected override void OnPaint(PaintEventArgs e)
        {
            if (!YataGrid._init)
            {
                YataGrid.graphics = e.Graphics;
                YataGrid.graphics.PixelOffsetMode = PixelOffsetMode.HighQuality;

                if (Gradients.ColheadPanel != null)                 // Settings._gradient
                {
                    var rect = new Rectangle(0, 0, Width, Height);
                    YataGrid.graphics.FillRectangle(Gradients.ColheadPanel, rect);
                }

                YataGrid.graphics.DrawLine(Pencils.DarkLine,
                                           0, Height,
                                           Width, Height);
                YataGrid.graphics.DrawLine(Pencils.DarkLine,
                                           Width, 0,
                                           Width, Height);

                _grid.LabelColheads();
            }
        }