/// ------------------------------------------------------------------------------------ /// <summary> /// Show or hide the footnote view. /// </summary> /// <param name="footnote">Footnote to scroll to or <c>null</c> to just display or hide /// the footnote view. If a footnote is given the footnote view will always be shown.</param> /// <param name="fPutInsertionPtAtEnd">if set to <c>true</c> and showing the view, /// the insertion point will be put at the end of the footnote text instead of at the /// beginning, as would be appropriate in the case of a newly inserted footnote that has /// Reference Text. This parameter is ignored if footnote is null.</param> /// ------------------------------------------------------------------------------------ internal virtual void ShowOrHideFootnoteView(StFootnote footnote, bool fPutInsertionPtAtEnd) { CheckDisposed(); //toggle bool fShow = !m_grid.Rows[kFootnoteRow].Visible || footnote != null; // Prevent painting while we possibly expand lazy boxes ((IRootSite)this).AllowPainting = false; try { // show or hide the footnote view m_grid.Rows[kFootnoteRow].Visible = fShow; } finally { ((IRootSite)this).AllowPainting = true; } if (fShow && FootnoteView != null) { if (footnote != null) { FootnoteView.ScrollToFootnote(footnote, fPutInsertionPtAtEnd); } FootnoteView.Focus(); } }
/// ------------------------------------------------------------------------------------ /// <summary> /// Show or hide the footnote view. /// </summary> /// <param name="footnote">Footnote to scroll to or <c>null</c> to just display or hide /// the footnote view. If a footnote is given the footnote view will always be shown.</param> /// <param name="fPutInsertionPtAtEnd">if set to <c>true</c> and showing the view, /// the insertion point will be put at the end of the footnote text instead of at the /// beginning, as would be appropriate in the case of a newly inserted footnote that has /// Reference Text. This parameter is ignored if footnote is null.</param> /// ------------------------------------------------------------------------------------ internal virtual void ShowOrHideFootnoteView(IStFootnote footnote, bool fPutInsertionPtAtEnd) { CheckDisposed(); // toggle the footnote view on or off bool fShow = !m_grid.Rows[kFootnoteRow].Visible || footnote != null; // Prevent painting while we possibly expand lazy boxes ((IRootSite)this).AllowPainting = false; try { // show or hide the footnote view m_grid.Rows[kFootnoteRow].Visible = fShow; #if __MonoCS__ // FWNX-360: work around mono datagridview differences // // TODO-Linux: write a datagridview test case a submit a bug report to mono // on mono after setting m_grid.Rows[kFootnoteRow].Visible to false // GetControl(kFootnoteRow, kDraftViewColumn) still returns true. // Also on mono Setting the last Row visiblity to false doesn't causes // the grid to expand to cover the space. // explicity changing it height works around this. FootnoteView.Visible = fShow; // set the Actual Control Visibilty. m_grid.Rows[kFootnoteRow].Height = m_grid.Rows[kFootnoteRow].Height - 1; m_grid.Rows[kFootnoteRow].Height = m_grid.Rows[kFootnoteRow].Height + 1; #endif } finally { ((IRootSite)this).AllowPainting = true; } if (fShow && FootnoteView != null) { if (footnote != null) { FootnoteView.ScrollToFootnote(footnote, fPutInsertionPtAtEnd); } FootnoteView.Focus(); } }