private void _GNumericPadManager(int r, int c, int noP)                 //Draw GNumericPad
        {
            noPMemo            = noP;
            GnumericPad.Source = SDKGrp.CreateCellImageLight(pGP.BDL[r * 9 + c], noP);
            int PosX = (int)PB_GBoard.Margin.Left + 2 + 37 * c + (int)c / 3;
            int PosY = (int)PB_GBoard.Margin.Top + 2 + 37 * r + (int)r / 3;

            GnumericPad.Margin     = new Thickness(PosX, PosY, 0, 0);
            GnumericPad.Visibility = Visibility.Visible;
        }
Exemple #2
0
        private RenderTargetBitmap _CreateBitmapImage()
        {
            bool sWhiteBack = (bool)chbWhiteBack.IsChecked;

            if (!sWhiteBack)
            {
                return(bmpGZero);
            }
            var bmpGZeroW = new RenderTargetBitmap((int)PB_GBoard.Width, (int)PB_GBoard.Height, 96, 96, PixelFormats.Default);

            SDKGrp.GBoardPaint(bmpGZeroW, pGP.BDL, "tabACreate", whiteBack: true);
            return(bmpGZeroW);
        }
        private RenderTargetBitmap bmpPD = new RenderTargetBitmap(176, 176, 96, 96, PixelFormats.Default);//176=18*9+2*4+1*6
        private void _Display_CreateProblem()
        {
            txbNoOfTrials.Text    = GNP00.SDKCntrl.LoopCC.ToString();
            txbNoOfTrialsCum.Text = SDK_Ctrl.TLoopCC.ToString();
            txbBasicPattern.Text  = GNP00.SDKCntrl.PatternCC.ToString();
            int n = gamGen05.Text.ToInt();

            lblNoOfProblems1.Content = (n - _ProgressPer).ToString();

            UPuzzle pGP = GNP00.pGP;

            if (pGP != null)
            {
                int nn = GNP00.SDKProbLst.Count;
                if (nn > 0)
                {
                    txtProbNo.Text          = nn.ToString();
                    txtProbName.Text        = GNP00.SDKProbLst.Last().Name;
                    nUDDifficultyLevel.Text = pGP.DifLevel.ToString();
                }
            }

            string st = AnalyzerLapElaped;

            Lbl_onAnalyzerTS.Content  = st;
            Lbl_onAnalyzerTSM.Content = st;
            txbEpapsedTimeTS3.Text    = st;

            if (__DispMode != null && __DispMode != "")
            {
                _SetScreenProblem();
                displayTimer.Stop();
                AnalyzerLap.Stop();
                btnCreateProblemMlt.Content = pRes.btnCreateProblemMlt;
            }
            __DispMode = "";

            if ((bool)chbCreateProblemEx2.IsChecked)
            {
                SDKGrp.GBPatternDigit(bmpPD, Sol99sta);
            }
            else
            {
                bmpPD.Clear();
            }
            PB_BasePatDig.Source = bmpPD;
        }
Exemple #4
0
//@        private int  solLevelCC=0;
//@        private int  solLevelMax=0;
        private void _Display_GB_GBoard(UPuzzle GPML = null, bool DevelopB = false)
        {
            if (GNP00.AnalyzerMode == "MultiSolve" && __DispMode != "Complated")
            {
                return;
            }
            try{
                UPuzzle currentP = GPML ?? pGP;
                if (currentP == null)
                {
                    return;
                }

                lblUnderAnalysis.Visibility = (GNP00.GSmode == "tabASolve")? Visibility.Visible: Visibility.Hidden;
                Lbl_onAnalyzerM.Visibility  = Visibility.Visible;

                SDKGrp.GBoardPaint(bmpGZero, currentP.BDL, GNP00.GSmode, sNoAssist);
                PB_GBoard.Source = bmpGZero;    //◆currentP.BDL set

                __Set_CellsPZMCount();
                txtProbNo.Text          = (currentP.ID + 1).ToString();
                txtProbName.Text        = currentP.Name;
                nUDDifficultyLevel.Text = currentP.DifLevel.ToString();
                //The following code "pMethod" is rewritten to another thread.
                //This may cause an access violation.
                //here Try with try{...} catch(Exception){...}.
                int DiffL = (GNP00.pGP.pMethod == null)? 0: GNP00.pGP.pMethod.DifLevel; //
                lblCurrentnDifficultyLevel.Content = $"Difficulty: {DiffL}";            //CurrentLevel

                if (DevelopB)
                {
                    _Display_Develop();
                }
                if (GNP00.GSmode == "tabASolve")
                {
                    _Display_ExtResultWin();
                }
            }
            catch (Exception e) {
                WriteLine(e.Message + "\r" + e.StackTrace);
#if DEBUG
                using (var fpW = new StreamWriter("Exception_002e.txt", true, Encoding.UTF8)){
                    fpW.WriteLine($"---{DateTime.Now} {e.Message} \r{e.StackTrace}");
                }
#endif
            }
        }
 private void _SetBitmap_PB_pattern( )
 {
     SDKGrp.GBPatternPaint(PB_pattern, GNP00.SDKCntrl.PatGen.GPat);
 }