Exemple #1
0
        //--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // b t n S a v e R e p o r t _ C l i c k                              //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Called when the 'Save Report' button is clicked.                   //
        //                                                                    //
        //--------------------------------------------------------------------//

        private void btnSaveReport_Click(object sender, RoutedEventArgs e)
        {
            Boolean flagOffsetHex,
                    flagOptRptWrap = false;

            ReportCore.eRptFileFmt  rptFileFmt  = ReportCore.eRptFileFmt.NA;
            ReportCore.eRptChkMarks rptChkMarks = ReportCore.eRptChkMarks.NA;

            if (_options.IndxGenOffsetFormat ==
                PrnParseConstants.eOptOffsetFormats.Decimal)
            {
                flagOffsetHex = false;
            }
            else
            {
                flagOffsetHex = true;
            }

            TargetCore.metricsReturnFileRpt(ToolCommonData.eToolIds.PrnAnalyse,
                                            ref rptFileFmt,
                                            ref rptChkMarks,
                                            ref flagOptRptWrap);

            if (tabCtrl.SelectedItem == tabStatistics)
            {
                ToolPrnAnalyseReport.generate(eInfoType.Statistics,
                                              rptFileFmt,
                                              _tableStatistics,
                                              _prnFilename,
                                              _fileSize,
                                              flagOffsetHex,
                                              _options);
            }
            else if (tabCtrl.SelectedItem == tabContent)
            {
                ToolPrnAnalyseReport.generate(eInfoType.Content,
                                              rptFileFmt,
                                              _tableContent,
                                              _prnFilename,
                                              _fileSize,
                                              flagOffsetHex,
                                              _options);
            }
            else
            {
                ToolPrnAnalyseReport.generate(eInfoType.Analysis,
                                              rptFileFmt,
                                              _tableAnalysis,
                                              _prnFilename,
                                              _fileSize,
                                              flagOffsetHex,
                                              _options);
            }
        }
        //--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // b t n S a v e R e p o r t _ C l i c k                              //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Called when the 'Save report' button is clicked.                   //
        //                                                                    //
        //--------------------------------------------------------------------//

        private void btnSaveReport_Click(object sender, RoutedEventArgs e)
        {
            Boolean flagOffsetHex,
                    flagOptRptWrap = false;

            ReportCore.eRptFileFmt  rptFileFmt  = ReportCore.eRptFileFmt.NA;
            ReportCore.eRptChkMarks rptChkMarks = ReportCore.eRptChkMarks.NA;

            if (_options.IndxGenOffsetFormat ==
                PrnParseConstants.eOptOffsetFormats.Decimal)
            {
                flagOffsetHex = false;
            }
            else
            {
                flagOffsetHex = true;
            }

            TargetCore.metricsReturnFileRpt(ToolCommonData.eToolIds.MakeOverlay,
                                            ref rptFileFmt,
                                            ref rptChkMarks,
                                            ref flagOptRptWrap);

            if (_crntPDL == ToolCommonData.ePrintLang.PCL)
            {
                ToolMakeOverlayReport.generate(rptFileFmt,
                                               _tableProgress,
                                               _prnFilename,
                                               _ovlFilenamePCL,
                                               flagOffsetHex,
                                               _options);
            }
            else
            {
                ToolMakeOverlayReport.generate(rptFileFmt,
                                               _tableProgress,
                                               _prnFilename,
                                               _ovlFilenamePCLXL,
                                               flagOffsetHex,
                                               _options);
            }

            btnSaveReport.Visibility = Visibility.Visible;
        }
Exemple #3
0
        //--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // i n i t i a l i s e                                                //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Initialise 'target' data.                                          //
        //                                                                    //
        //--------------------------------------------------------------------//

        private void initialise()
        {
            btnOK.Visibility = Visibility.Hidden;

            //----------------------------------------------------------------//
            //                                                                //
            // Tool and PDL identifiers.                                      //
            //                                                                //
            //----------------------------------------------------------------//

            if (_crntSubId == ToolCommonData.eToolSubIds.None)
            {
                txtCrntTool.Text =
                    Enum.GetName(typeof(ToolCommonData.eToolIds),
                                 _crntToolId);
            }
            else
            {
                txtCrntTool.Text =
                    Enum.GetName(typeof(ToolCommonData.eToolIds),
                                 _crntToolId) +
                    "|" +
                    Enum.GetName(typeof(ToolCommonData.eToolSubIds),
                                 _crntSubId);
            }

            txtCrntPDL.Text = _crntPDL.ToString();

            //----------------------------------------------------------------//
            //                                                                //
            // Report file data.                                              //
            //                                                                //
            //----------------------------------------------------------------//

            if ((_crntToolId == ToolCommonData.eToolIds.MakeOverlay)
                ||
                (_crntToolId == ToolCommonData.eToolIds.PrintLang)
                ||
                (_crntToolId == ToolCommonData.eToolIds.PrnAnalyse)
                ||
                (_crntToolId == ToolCommonData.eToolIds.SoftFontGenerate)
                ||
                (_crntToolId == ToolCommonData.eToolIds.StatusReadback)
                ||
                (_crntToolId == ToolCommonData.eToolIds.SymbolSetGenerate))
            {
                grpRptFile.Visibility = Visibility.Visible;
                lbFileNA.Visibility   = Visibility.Hidden;
                btnOK.Visibility      = Visibility.Visible;

                TargetCore.metricsReturnFileRpt(_crntToolId,
                                                ref _rptFileFmt,
                                                ref _rptChkMarks,
                                                ref _flagOptRptWrap);

                if (_rptFileFmt == ReportCore.eRptFileFmt.html)
                {
                    rbRptFmtHtml.IsChecked = true;
                }
                else if (_rptFileFmt == ReportCore.eRptFileFmt.xml)
                {
                    rbRptFmtXml.IsChecked = true;
                }
                else
                {
                    rbRptFmtText.IsChecked = true;
                }

                grpRptChkMarks.Visibility = Visibility.Hidden;
                grpRptOpt.Visibility      = Visibility.Hidden;

                if (_crntToolId == ToolCommonData.eToolIds.PrintLang)
                {
                    grpRptChkMarks.Visibility = Visibility.Visible;
                    grpRptOpt.Visibility      = Visibility.Visible;

                    if (_rptChkMarks >= ReportCore.eRptChkMarks.NA)
                    {
                        _rptChkMarks = ReportCore.eRptChkMarks.text;
                    }

                    if (_rptChkMarks == ReportCore.eRptChkMarks.boxsym)
                    {
                        rbRptChkMarksBoxSym.IsChecked = true;
                    }
                    else if (_rptChkMarks == ReportCore.eRptChkMarks.txtsym)
                    {
                        rbRptChkMarksTxtSym.IsChecked = true;
                    }
                    else
                    {
                        rbRptChkMarksText.IsChecked = true;
                    }

                    if (_flagOptRptWrap)
                    {
                        chkRptOptWrap.IsChecked = true;
                    }
                    else
                    {
                        chkRptOptWrap.IsChecked = false;
                    }
                }
                else if (_crntToolId == ToolCommonData.eToolIds.SoftFontGenerate)
                {
                    grpRptChkMarks.Visibility = Visibility.Visible;

                    if (_rptChkMarks >= ReportCore.eRptChkMarks.NA)
                    {
                        _rptChkMarks = ReportCore.eRptChkMarks.text;
                    }

                    if (_rptChkMarks == ReportCore.eRptChkMarks.boxsym)
                    {
                        rbRptChkMarksBoxSym.IsChecked = true;
                    }
                    else if (_rptChkMarks == ReportCore.eRptChkMarks.txtsym)
                    {
                        rbRptChkMarksTxtSym.IsChecked = true;
                    }
                    else
                    {
                        rbRptChkMarksText.IsChecked = true;
                    }
                }
            }
            else
            {
                grpRptFile.Visibility = Visibility.Hidden;
                lbFileNA.Visibility   = Visibility.Visible;
            }

            //----------------------------------------------------------------//
            //                                                                //
            // Set the (hidden) slider object to the passed-in scale value.   //
            // The slider is used as the source binding for a scale           //
            // transform in the (child) Options dialogue window, so that all  //
            // windows use the same scaling mechanism as the main window.     //
            //                                                                //
            // NOTE: it would be better to bind the transform directly to the //
            //       scale value (set and stored in the Main window), but (so //
            //       far) I've failed to find a way to bind directly to a     //
            //       class object Property value.                             //
            //                                                                //
            //----------------------------------------------------------------//

            Double windowScale = MainFormData.WindowScale;

            zoomSlider.Value = windowScale;

            //----------------------------------------------------------------//
            //                                                                //
            // Setting sizes to the resizeable DockPanel element doesn't work!//
            //                                                                //
            //----------------------------------------------------------------//

            this.Height = 350 * windowScale;
            this.Width  = 730 * windowScale;
        }