示例#1
0
        /// <summary>
        /// ************************************************************************************************************************
        /// 駒台の描画は、ここに書きます。
        /// ************************************************************************************************************************
        /// </summary>
        /// <param name="g"></param>
        public void Paint(Graphics g)
        {
            if (!this.Visible)
            {
                goto gt_EndMethod;
            }

            //----------
            // 背景色
            //----------
            g.FillRectangle(
                new SolidBrush(Color.Beige),
                new Rectangle(this.Bounds.X, this.Bounds.Y, Util_Masu10.KOMADAI_LAST_SUJI * this.MasuWidth, Util_Masu10.KOMADAI_LAST_DAN * this.MasuHeight)
                );

            //----------
            // 水平線
            //----------
            for (int i = 0; i <= Util_Masu10.KOMADAI_LAST_DAN; i++)
            {
                g.DrawLine(Pens.Black,
                           0 * this.MasuWidth + this.Bounds.X,
                           i * this.MasuHeight + this.Bounds.Y,
                           Util_Masu10.KOMADAI_LAST_SUJI * this.MasuWidth + this.Bounds.X,
                           i * this.MasuHeight + this.Bounds.Y
                           );
            }

            //----------
            // 垂直線
            //----------
            for (int i = 0; i <= Util_Masu10.KOMADAI_LAST_SUJI; i++)
            {
                g.DrawLine(Pens.Black,
                           i * this.MasuWidth + this.Bounds.X,
                           0 * this.MasuHeight + this.Bounds.Y,
                           i * this.MasuHeight + this.Bounds.X,
                           Util_Masu10.KOMADAI_LAST_DAN * this.MasuHeight + this.Bounds.Y
                           );
            }

            //----------
            // 升目
            //----------
            foreach (UserWidget widget in this.ShogibanGui.Widgets.Values)
            {
                if ("Masu" == widget.Type && widget.Okiba == this.Okiba)
                {
                    Shape_BtnMasuImpl cell = (Shape_BtnMasuImpl)widget.Object;
                    cell.Kiki   = false;
                    cell.KikiSu = 0;
                    cell.Paint(g);
                }
            }

gt_EndMethod:
            ;
        }
示例#2
0
 public UserWidget_MasuImpl(Shape_BtnMasuImpl shape_BtnMasu)
 {
     this.this_object = shape_BtnMasu;
 }
示例#3
0
        /// <summary>
        /// ************************************************************************************************************************
        /// 将棋盤の描画はここに書きます。
        /// ************************************************************************************************************************
        /// </summary>
        /// <param name="g"></param>
        public void Paint(Graphics g)
        {
            if (!this.Visible)
            {
                goto gt_EndMethod;
            }

            //----------
            // 筋の数字
            //----------
            for (int i = 0; i < 9; i++)
            {
                g.DrawString(Conv_Int.ToArabiaSuji(i + 1), new Font("MS ゴシック", 25.0f), Brushes.Black, new Point((8 - i) * this.MasuWidth + this.Bounds.X - 8, -1 * this.MasuHeight + this.Bounds.Y));
            }

            //----------
            // 段の数字
            //----------
            for (int i = 0; i < 9; i++)
            {
                g.DrawString(Conv_Int.ToKanSuji(i + 1), new Font("MS ゴシック", 23.0f), Brushes.Black, new Point(9 * this.MasuWidth + this.Bounds.X, i * this.MasuHeight + this.Bounds.Y));
                g.DrawString(Conv_Int.ToAlphabet(i + 1), new Font("MS ゴシック", 11.0f), Brushes.Black, new Point(9 * this.MasuWidth + this.Bounds.X, i * this.MasuHeight + this.Bounds.Y));
            }


            //----------
            // 水平線
            //----------
            for (int i = 0; i < 10; i++)
            {
                g.DrawLine(Pens.Black,
                           0 * this.MasuWidth + this.Bounds.X,
                           i * this.MasuHeight + this.Bounds.Y,
                           9 * this.MasuHeight + this.Bounds.X,
                           i * this.MasuHeight + this.Bounds.Y
                           );
            }

            //----------
            // 垂直線
            //----------
            for (int i = 0; i < 10; i++)
            {
                g.DrawLine(Pens.Black,
                           i * this.MasuWidth + this.Bounds.X,
                           0 * this.MasuHeight + this.Bounds.Y,
                           i * this.MasuHeight + this.Bounds.X,
                           9 * this.MasuHeight + this.Bounds.Y
                           );
            }


            //----------
            // 升目
            //----------
            foreach (UserWidget widget in this.ShogibanGui.Widgets.Values)
            {
                if ("Masu" == widget.Type && Okiba.ShogiBan == widget.Okiba)
                {
                    Shape_BtnMasuImpl cell   = (Shape_BtnMasuImpl)widget.Object;
                    SySet <SyElement> masus2 = new SySet_Default <SyElement>("何かの升");
                    masus2.AddElement(Masu_Honshogi.Masus_All[widget.MasuHandle]);

                    cell.Kiki   = this.KikiBan.ContainsAll(masus2);
                    cell.KikiSu = this.HMasu_KikiKomaList[widget.MasuHandle].Count;
                    cell.Paint(g);
                }
            }

gt_EndMethod:
            ;
        }