Exemple #1
0
        //----------------------------------------------------------------------------------------
        private void DrawMemo(Graphics g, int frame)
        {
            int x0 = 0;
            int y0 = frame * tsd.CellHeight - tsg.OffsetY;
            int w  = tsd.MemoWidth;
            int h  = tsd.CellHeight;
            int x1 = x0 + w;
            int y1 = y0 + h;

            //画面外なら何もしない
            if ((x0 > this.Width) || (x1 < 0) || (y0 > this.Height) || (y1 < 0))
            {
                return;
            }
            SolidBrush b   = new SolidBrush(cols.MemoBase);
            Pen        p   = new Pen(cols.MemoLine, 1);
            Rectangle  rct = new Rectangle(x0, y0, w, h);
            int        frm = frame + tsd.FrameOffset;

            try
            {
                bool n = (tsd.FrameEnabeld(frame) < 0);
                if (n)
                {
                    b.Color = cols.None;
                }
                //セルを背景色で塗る
                g.FillRectangle(b, x0, y0, tsd.MemoWidth, tsd.CellHeight);

                string s = tsd.Memo(frame);
                if (s != "")
                {
                    b = new SolidBrush(cols.Text);
                    if (n)
                    {
                        b.Color = cols.NoneText;
                    }
                    Rectangle rct1 = new Rectangle(x0 + 6, y0, w - 4, h);
                    g.DrawString(s, this.Font, b, rct1, format);
                }
                //横線
                g.DrawLine(p, x0, y0, x1, y0);
                if (((frm + 1) % (int)tsd.FrameRate) == 0)
                {
                    p.Width = 2;
                    g.DrawLine(p, x0, y1 - 1, x1, y1 - 1);
                }
                else if (((frm + 1) % tsd.HorLine) == 0)
                {
                    p.Width = 1;
                    g.DrawLine(p, x0, y1 - 1, x1, y1 - 1);
                }
            }
            finally
            {
                b.Dispose();
                p.Dispose();
            }
        }
Exemple #2
0
        //---------------------------------------------------------------------
        private void DrawFrame(Graphics g, int frame)
        {
            if (tsg == null)
            {
                return;
            }
            int x0 = 0;
            int y0 = frame * tsd.CellHeight - tsg.OffsetY;
            int w  = this.Width;
            int h  = tsd.CellHeight;
            int x1 = x0 + w;
            int y1 = y0 + h;

            //画面外なら何もしない
            if ((y0 > this.Height) || (y1 < 0))
            {
                return;
            }

            SolidBrush b   = new SolidBrush(cols.FrameBase);
            Pen        p   = new Pen(cols.FrameLine, 1);
            Rectangle  rct = new Rectangle(x0, y0, w, h);
            int        frm = frame + tsd.FrameOffset;

            try
            {
                bool n = (tsd.FrameEnabeld(frame) < 0);
                //セルを背景色で塗る
                if (tsg.sel.IsIn(frame) == true)
                {
                    b.Color = cols.FrameSelection;
                }
                else if (n)
                {
                    b.Color = cols.None;
                }

                g.FillRectangle(b, x0, y0, w, h);


                if (frm >= 0)
                {
                    if (n)
                    {
                        b.Color = cols.NoneText;
                    }
                    else
                    {
                        b.Color = cols.Text;
                    }

                    rct.X     += 2;
                    rct.Width -= 4;

                    g.DrawString(tsg.tsd.FrameStr(frm), this.Font, b, rct, this.format);
                }


                //横線
                g.DrawLine(p, x0, y0, x1, y0);
                if (n == false)
                {
                    if (((frm + 1) % (int)tsd.FrameRate) == 0)
                    {
                        p.Width = 2;
                        g.DrawLine(p, x0, y1 - 1, x1, y1 - 1);
                    }
                    else if (((frm + 1) % tsd.HorLine) == 0)
                    {
                        p.Width = 1;
                        g.DrawLine(p, x0, y1 - 1, x1, y1 - 1);
                    }
                }
            }

            finally
            {
                b.Dispose();
                p.Dispose();
            }
        }