Esempio n. 1
0
        public override void OnClick(SourceGrid.CellContext sender, EventArgs e)
        {
            base.OnClick(sender, e);

            // 顯示目前焦點所在的儲存格屬於第幾頁。
            SourceGrid.Grid grid = (SourceGrid.Grid)sender.Grid;
            int             row  = sender.Position.Row;

            if (row < 1)
            {
                return;
            }

            int  lineIdx      = m_Form.GetBrailleLineIndex(row);
            int  linesPerPage = AppGlobals.Config.Braille.LinesPerPage;
            bool needPageFoot = AppGlobals.Config.Printing.PrintPageFoot;
            int  currPage     = AppGlobals.CalcCurrentPage(lineIdx, linesPerPage, needPageFoot) + 1;
            int  totalPages   = AppGlobals.CalcTotalPages(m_Form.BrailleDoc.Lines.Count, linesPerPage, needPageFoot);

            m_Form.PageNumberText = currPage.ToString() + "/" + totalPages.ToString();


            //if (m_Form.DebugMode)
            //{
            //    SourceGrid.Grid grid = (SourceGrid.Grid)sender.Grid;
            //    int row = sender.Position.Row;
            //    int col = sender.Position.Column;

            //    BrailleWord brWord = (BrailleWord)grid[row, col].Tag;
            //    string brScreenText = brWord.CellList.ToString();
            //    string brPrinterText = BrailleGlobals.FontConvert.ToString(brWord);

            //    m_Form.StatusBar.Items[0].Text = brWord.Text +
            //        "(" + brScreenText + ") " + // 顯示時的點字 16 進位字串
            //        "[" + brPrinterText + "]";  // 列印時的點字 16 進位字串
            //}
        }