Example #1
0
        //────────────────────────────────────────

        public void MovePartsnumbersprite(Memory4bSpritePartsnumber mNum, float dx, float dy, float nScale, Memory1Application_Partsnumput memoryApplication_Partsnumput)
        {
            // 背景画像上のスプライト位置
            mNum.LocationOnBackgroundActual = new PointF(
                mNum.LocationOnBackgroundActual.X + dx / nScale,
                mNum.LocationOnBackgroundActual.Y + dy / nScale
                );
            //ystem.Console.WriteLine("移動前("+old.X+","+old.Y+") 移動後("+mNum.LocationOnBackgroundActual.X+","+mNum.LocationOnBackgroundActual.Y+")");

            mNum.Delegate_OnChangeSprite_Partsnumber(mNum, nScale);//, ucCanvas
            memoryApplication_Partsnumput.IsChangedContents = true;
        }
Example #2
0
        //────────────────────────────────────────

        public void PaintSprite(
            Graphics g, Memory4bSpritePartsnumber memSprNum, bool isOnWindow, float scale2)
        {
            if (this.IsDisplayExecute && memSprNum.IsDefinitionExpression)
            {
                // 数値表示モードでは、名前定義は表示しません。
                goto process_end;
            }

            if (memSprNum.IsDirty || memSprNum.Scale != scale2)
            {
                memSprNum.Delegate_OnChangeSprite_Partsnumber(memSprNum, scale2);//, numPutUc
            }

            Rectangle boundsCircle;

            if (isOnWindow)
            {
                boundsCircle = new Rectangle(
                    memSprNum.BoundsCircleScaledOnBackground.X + (int)this.BgLocationScaled.X,
                    memSprNum.BoundsCircleScaledOnBackground.Y + (int)this.BgLocationScaled.Y,
                    memSprNum.BoundsCircleScaledOnBackground.Width,
                    memSprNum.BoundsCircleScaledOnBackground.Height
                    );
            }
            else
            {
                boundsCircle = memSprNum.BoundsCircleScaledOnBackground;
            }

            Rectangle boundsText;

            if (isOnWindow)
            {
                boundsText = new Rectangle(
                    memSprNum.BoundsTextScaledOnBackground.X + (int)this.BgLocationScaled.X,
                    memSprNum.BoundsTextScaledOnBackground.Y + (int)this.BgLocationScaled.Y,
                    memSprNum.BoundsTextScaledOnBackground.Width,
                    memSprNum.BoundsTextScaledOnBackground.Height
                    );
            }
            else
            {
                boundsText = new Rectangle(
                    memSprNum.BoundsTextScaledOnBackground.X,
                    memSprNum.BoundsTextScaledOnBackground.Y,
                    memSprNum.BoundsTextScaledOnBackground.Width,
                    memSprNum.BoundsTextScaledOnBackground.Height
                    );
            }


            //// 番号スプライトのサイズ
            string sText = memSprNum.GetText(true, this);

            // 後ろに、少し大きめの丸を塗ります。
            Brush backBrush;

            if (memSprNum.IsMouseTarget)
            {
                backBrush = Brushes.YellowGreen;
            }
            else
            {
                backBrush = memSprNum.BrushBackground;
            }
            g.FillEllipse(backBrush, boundsCircle.X, boundsCircle.Y, boundsCircle.Width, boundsCircle.Height);
            g.DrawEllipse(memSprNum.PenForeground, boundsCircle.X, boundsCircle.Y, boundsCircle.Width, boundsCircle.Height);


            // 影
            g.DrawString(
                sText,
                memSprNum.Font,
                Brushes.Black,
                boundsText.Location
                );
            boundsText.Offset(-1, -1);
            // 文字
            g.DrawString(
                sText,
                memSprNum.Font,
                Brushes.White,
                boundsText.Location
                );

            goto process_end;
            //
            //
            //
            //
process_end:
            ;
        }
        //────────────────────────────────────────
        public void PaintSprite(
            Graphics g, Memory4bSpritePartsnumber memSprNum, bool isOnWindow, float scale2)
        {
            if (this.IsDisplayExecute && memSprNum.IsDefinitionExpression)
            {
                // 数値表示モードでは、名前定義は表示しません。
                goto process_end;
            }

            if (memSprNum.IsDirty || memSprNum.Scale != scale2)
            {
                memSprNum.Delegate_OnChangeSprite_Partsnumber(memSprNum, scale2);//, numPutUc
            }

            Rectangle boundsCircle;
            if (isOnWindow)
            {
                boundsCircle = new Rectangle(
                        memSprNum.BoundsCircleScaledOnBackground.X + (int)this.BgLocationScaled.X,
                        memSprNum.BoundsCircleScaledOnBackground.Y + (int)this.BgLocationScaled.Y,
                        memSprNum.BoundsCircleScaledOnBackground.Width,
                        memSprNum.BoundsCircleScaledOnBackground.Height
                        );
            }
            else
            {
                boundsCircle = memSprNum.BoundsCircleScaledOnBackground;
            }

            Rectangle boundsText;
            if (isOnWindow)
            {
                boundsText = new Rectangle(
                        memSprNum.BoundsTextScaledOnBackground.X + (int)this.BgLocationScaled.X,
                        memSprNum.BoundsTextScaledOnBackground.Y + (int)this.BgLocationScaled.Y,
                        memSprNum.BoundsTextScaledOnBackground.Width,
                        memSprNum.BoundsTextScaledOnBackground.Height
                    );
            }
            else
            {
                boundsText = new Rectangle(
                    memSprNum.BoundsTextScaledOnBackground.X,
                    memSprNum.BoundsTextScaledOnBackground.Y,
                    memSprNum.BoundsTextScaledOnBackground.Width,
                    memSprNum.BoundsTextScaledOnBackground.Height
                    );
            }

            //// 番号スプライトのサイズ
            string sText = memSprNum.GetText(true, this);

            // 後ろに、少し大きめの丸を塗ります。
            Brush backBrush;
            if (memSprNum.IsMouseTarget)
            {
                backBrush = Brushes.YellowGreen;
            }
            else
            {
                backBrush = memSprNum.BrushBackground;
            }
            g.FillEllipse(backBrush, boundsCircle.X, boundsCircle.Y, boundsCircle.Width, boundsCircle.Height);
            g.DrawEllipse(memSprNum.PenForeground, boundsCircle.X, boundsCircle.Y, boundsCircle.Width, boundsCircle.Height);

            // 影
            g.DrawString(
                sText,
                memSprNum.Font,
                Brushes.Black,
                boundsText.Location
                );
            boundsText.Offset(-1, -1);
            // 文字
            g.DrawString(
                sText,
                memSprNum.Font,
                Brushes.White,
                boundsText.Location
                );

            goto process_end;
            //
            //
            //
            //
            process_end:
            ;
        }
        //────────────────────────────────────────
        public void MovePartsnumbersprite(Memory4bSpritePartsnumber mNum, float dx, float dy, float nScale, Memory1Application_Partsnumput memoryApplication_Partsnumput)
        {
            // 背景画像上のスプライト位置
            mNum.LocationOnBackgroundActual = new PointF(
                mNum.LocationOnBackgroundActual.X + dx / nScale,
                mNum.LocationOnBackgroundActual.Y + dy / nScale
                );
            //ystem.Console.WriteLine("移動前("+old.X+","+old.Y+") 移動後("+mNum.LocationOnBackgroundActual.X+","+mNum.LocationOnBackgroundActual.Y+")");

            mNum.Delegate_OnChangeSprite_Partsnumber(mNum, nScale);//, ucCanvas
            memoryApplication_Partsnumput.IsChangedContents = true;
        }