/// <summary> /// Clicked on zoom button in status bar /// </summary> /// <param name="sender"></param> /// <param name="e"></param> internal void ZoomButtonItem_ItemClick(object sender, ItemClickEventArgs e) { int pct; Query q = QueriesControl.BaseQuery; if (q == null) { return; } string txt = ZoomPctBarItem.Caption; txt = txt.Replace("%", ""); if (Lex.IsInteger(txt)) { pct = int.Parse(txt); } else { pct = q.ViewScale; // use existing query value if above fails } DialogResult dr = ZoomDialog.Show(ref pct, new Point(), QueryManager); if (dr == DialogResult.Cancel) { return; } ZoomSliderPct = pct; // update zoom control display if (QueryManager == null || Qrc == null) { return; } Qrc.CurrentView.ScaleView(pct); return; }
/// <summary> /// Clicked zoom button /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ShowZoomDialog() { int pct; Query q = QueriesControl.BaseQuery; if (q == null) { return; } string txt = ZoomPctTextEdit.Text; txt = txt.Replace("%", ""); if (Lex.IsInteger(txt)) { pct = int.Parse(txt); } else { pct = q.ViewScale; // use existing query value if above fails } Point p = new Point(ZoomPctTextEdit.Left, ZoomPctTextEdit.Bottom); p = ZoomPctTextEdit.PointToScreen(p); DialogResult dr = ZoomDialog.Show(ref pct, p, null); if (dr == DialogResult.Cancel) { return; } ZoomPct = pct; // update zoom control display return; }