Esempio n. 1
0
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);

            Painter p = cvs_.getPainter();

            //vRect.rc = e.ClipRectangle;
            if (this.Height <= e.ClipRectangle.Height)
            {
                Size s = new Size {
                    Height = e.ClipRectangle.Height - hScrollBar.Height,
                    Width  = e.ClipRectangle.Width - vScrollBar.Width
                };
                vRect.rc = new Rectangle(e.ClipRectangle.Location, s);
            }
            else
            {
                vRect.rc = e.ClipRectangle;
            }

            GetDrawPosInfo(ref vRect);

            if (e.ClipRectangle.Right <= lna())
            {
                // case A: 行番号表示域のみ更新
                DrawLNA(e.Graphics, vRect, p);
            }
            else if (lna() <= e.ClipRectangle.Left)
            {
                // case B: テキスト表示域のみ更新
                DrawTXT3(e.Graphics, vRect, p);
            }
            else
            {
                // case C: 両方更新
                DrawLNA(e.Graphics, vRect, p);
                p.SetClip(cvs_.zone());
                DrawTXT3(e.Graphics, vRect, p);
                p.ClearClip();

                //DrawTXT3(e.Graphics, vRect, p);
                //DrawLNA(e.Graphics, vRect, p);
            }
        }