|
|
@ -131,12 +131,52 @@ public partial class MainForm : Form |
|
|
|
// check for special keypresses |
|
|
|
// check for special keypresses |
|
|
|
if ( keyCode == Keys.Left || keyCode == Keys.Right ) { |
|
|
|
if ( keyCode == Keys.Left || keyCode == Keys.Right ) { |
|
|
|
// send the keypress to the search results |
|
|
|
// send the keypress to the search results |
|
|
|
|
|
|
|
// NOTE: We could also respond to Up/Down and scroll the ChartImage vertically, |
|
|
|
|
|
|
|
// but that would be confusing, given that Left/Right selects a search result. |
|
|
|
mSearchResults.Focus() ; |
|
|
|
mSearchResults.Focus() ; |
|
|
|
mDisableProcessCmdKey = true ; |
|
|
|
mDisableProcessCmdKey = true ; |
|
|
|
SendKeys.SendWait( "{" + keyCode.ToString() + "}" ) ; |
|
|
|
SendKeys.SendWait( "{" + keyCode.ToString() + "}" ) ; |
|
|
|
mDisableProcessCmdKey = false ; |
|
|
|
mDisableProcessCmdKey = false ; |
|
|
|
return true ; |
|
|
|
return true ; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if ( keyCode == Keys.PageUp || keyCode == Keys.PageDown ) { |
|
|
|
|
|
|
|
// scroll the ChartImage up/down |
|
|
|
|
|
|
|
if ( mChartImagePictureBox.Image == null ) |
|
|
|
|
|
|
|
return false ; |
|
|
|
|
|
|
|
double ratio = (double)mChartImagePanel.Height / (double)mChartImagePictureBox.Height ; |
|
|
|
|
|
|
|
VScrollProperties vscroll = mChartImagePanel.VerticalScroll ; |
|
|
|
|
|
|
|
int scrollRange = vscroll.Maximum - vscroll.Minimum ; |
|
|
|
|
|
|
|
int pageSize = (int)( ratio * scrollRange * 0.8 ) ; |
|
|
|
|
|
|
|
if ( keyCode == Keys.PageUp ) |
|
|
|
|
|
|
|
pageSize = - pageSize ; |
|
|
|
|
|
|
|
int scrollY = vscroll.Value + pageSize ; |
|
|
|
|
|
|
|
scrollChartImagePanel( null, scrollY ) ; |
|
|
|
|
|
|
|
return true ; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if ( keyCode == Keys.Home ) { |
|
|
|
|
|
|
|
int? scrollX=null, scrollY=null ; |
|
|
|
|
|
|
|
if ( (modifierKeys & Keys.Control) != 0 ) |
|
|
|
|
|
|
|
scrollX = scrollY = 0 ; |
|
|
|
|
|
|
|
if ( (modifierKeys & Keys.Shift) != 0 ) |
|
|
|
|
|
|
|
scrollX = 0 ; |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
scrollY = 0 ; |
|
|
|
|
|
|
|
setChartImagePanelScrollPos( scrollX, scrollY ) ; |
|
|
|
|
|
|
|
return true ; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if ( keyCode == Keys.End ) { |
|
|
|
|
|
|
|
int? scrollX=null, scrollY=null ; |
|
|
|
|
|
|
|
if ( (modifierKeys & Keys.Control) != 0 ) { |
|
|
|
|
|
|
|
scrollX = 0 ; |
|
|
|
|
|
|
|
scrollY = ChartImagePanel_MaxScrollY() ; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if ( (modifierKeys & Keys.Shift) != 0 ) |
|
|
|
|
|
|
|
scrollX = ChartImagePanel_MaxScrollX() ; |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
scrollY = ChartImagePanel_MaxScrollY() ; |
|
|
|
|
|
|
|
setChartImagePanelScrollPos( scrollX, scrollY ) ; |
|
|
|
|
|
|
|
return true ; |
|
|
|
|
|
|
|
} |
|
|
|
if ( keyCode == Keys.Escape ) { |
|
|
|
if ( keyCode == Keys.Escape ) { |
|
|
|
// clear the search query |
|
|
|
// clear the search query |
|
|
|
mSearchQuery.Text = "" ; |
|
|
|
mSearchQuery.Text = "" ; |
|
|
|