コード例 #1
0
        public GNPXApp000(NuPz_Win pGNP00win)
        {
            List <string> DirLst = Directory.EnumerateDirectories(".").ToList();

            LanguageLst = new List <string>();
            LanguageLst.Add("en");
            foreach (var P in DirLst)
            {
                var Q = P.Replace(".", "").Replace("\\", "");
                if (Q == "en")
                {
                    continue;
                }
                if (Q.Length == 2 || (Q[2] == '-' && Q.Length == 5))
                {
                    LanguageLst.Add(Q);
                }
            }

            LanguageLst = LanguageLst.FindAll(P => (P.Length == 2 || (P[2] == '-' && P.Length == 5)));
            LanguageLst.Sort();

            this.pGNP00win       = pGNP00win;
            cellSizeP            = cellSize + lineWidth;
            SDKCntrl             = new SDK_Ctrl(this, 0);
            GNPX_Eng             = new GNPZ_Engin(this, new UPuzzle());
            UPuzzleMan.pGNPX_Eng = GNPX_Eng;
            SDK_Ctrl.pGNPX_Eng   = GNPX_Eng;
            PTrans     = new PuzzleTrans(this);
            SolverLst2 = new List <UMthdChked>();
        }
コード例 #2
0
 public ExtendResultWin(NuPz_Win pGNP00win)
 {
     this.pGNP00win = pGNP00win;
     InitializeComponent();
     GNPXGNPX.Content          = "GNPX " + DateTime.Now.Year;
     this.MouseLeftButtonDown += (sender, e) => this.DragMove();
 }
コード例 #3
0
        public DevelopWin(NuPz_Win pGNP00win)
        {
            InitializeComponent();
            GNPXGNPX.Content          = "GNPX " + DateTime.Now.Year;
            this.MouseLeftButtonDown += (sender, e) => this.DragMove();

            SuperLinkMan.devWin = this;
            this.pGNP00win      = pGNP00win;

            SDKGrp   = new GNPZ_Graphics(pGNP00win.GNP00);
            bmpGZero = new RenderTargetBitmap((int)dev_GBoard.Width, (int)dev_GBoard.Height, 96, 96, PixelFormats.Default);
        }
コード例 #4
0
        public void SDK_PrintDocument(GNPXApp000 GNP00, int mLow, int mHigh, int mStart, int mEnd, bool SortF /*, colorList crList*/)
        {
            this.pGNP00win = GNP00.pGNP00win;
            GNPZ_Graphics SDKGrp = new GNPZ_Graphics(GNP00);
            int           lvl;

            List <UPuzzle> SDKPList = new List <UPuzzle>();

            foreach (var P in GNP00.SDKProbLst)
            {
                lvl = P.DifLevel;
                int n = P.ID;
                if (lvl < mLow || lvl > mHigh || n < mStart || n > mEnd)
                {
                    continue;
                }
                SDKPList.Add(P);
            }
            if (SortF)
            {
                SDKPList.Sort((pa, pb) => (pa.DifLevel - pb.DifLevel));
            }

            WrapPanel WrapPan = new WrapPanel();

            WrapPan.Width = 800;

            //【TBD】Printing of multiple pages can not be controlled。
            var    m_PrtDlg  = new PrintDialog();
            double GrdWidth  = (m_PrtDlg.PrintableAreaWidth - 48.0 * 2) / 2.0;
            double GrdHeight = (m_PrtDlg.PrintableAreaHeight - 48.0 * 2) / 2.0;

            foreach (UPuzzle P in SDKPList)
            {
                try{
                    Grid Grd = new Grid( );
                    Grd.Width  = GrdWidth;
                    Grd.Height = GrdHeight;

                    Label Lblname = new Label();
                    Lblname.Content  = "[" + P.ID + "]  " + P.Name;
                    Lblname.FontSize = 16;
                    Lblname.Margin   = new Thickness();
                    Grd.Children.Add(Lblname);

                    Label Lbldif = new Label();
                    Lbldif.Content             = "Dif:" + P.DifLevel;
                    Lbldif.FontSize            = 14;
                    Lbldif.HorizontalAlignment = HorizontalAlignment.Right;
                    Lbldif.VerticalAlignment   = VerticalAlignment.Top;
                    Lbldif.Margin = new Thickness(0, 10, 8, 0);
                    Grd.Children.Add(Lbldif);

                    var drwVis = new RenderTargetBitmap(338, 338, 96, 96, PixelFormats.Default); //338
                    SDKGrp.GBoardPaintPrint(drwVis, P);
                    Image Img = new Image();
                    Img.Source = drwVis;
                    Img.Margin = new Thickness(0, 35, 10, 0);
                    Img.HorizontalAlignment = HorizontalAlignment.Left;
                    Img.VerticalAlignment   = VerticalAlignment.Top;
                    Grd.Children.Add(Img);

                    WrapPan.Children.Add(Grd);
                }
                catch (Exception ex) {
                    WriteLine(ex.Message);
                    WriteLine(ex.StackTrace);
                }
            }

            VisualPrintDialog printDlg = new VisualPrintDialog(WrapPan);

            printDlg.ShowDialog();
        }
コード例 #5
0
 public GNPZ_Graphics(GNPXApp000 pGNP00)
 {
     this.pGNP00    = pGNP00;
     this.pGNP00win = pGNP00.pGNP00win;
     this.pColorDic = GNPXApp000.ColorDic;
 }