|
|
|
@ -93,6 +93,7 @@ public partial class MainForm : Form |
|
|
|
|
this.Load += new EventHandler( this.MainForm_Load ) ; |
|
|
|
|
this.FormClosing += new FormClosingEventHandler( this.MainForm_FormClosing ) ; |
|
|
|
|
this.Resize += new EventHandler( this.MainForm_Resize ) ; |
|
|
|
|
this.mSearchQuery.KeyPress += this.SearchQuery_KeyPress ; |
|
|
|
|
this.mSearchQuery.TextChanged += new EventHandler( this.SearchQuery_TextChanged ) ; |
|
|
|
|
this.mSearchResults.SelectionChanged += new EventHandler( this.SearchResults_SelectionChanged ) ; |
|
|
|
|
|
|
|
|
@ -185,7 +186,7 @@ public partial class MainForm : Form |
|
|
|
|
} |
|
|
|
|
if ( keyCode == Keys.Escape ) { |
|
|
|
|
// clear the search query |
|
|
|
|
loadSearchResults( mChartImages.Values, "SHOW-ALL", true ) ; |
|
|
|
|
loadSearchResults( null, "", true ) ; |
|
|
|
|
return true ; |
|
|
|
|
} |
|
|
|
|
if ( keyCode == Keys.Return ) |
|
|
|
@ -212,15 +213,10 @@ public partial class MainForm : Form |
|
|
|
|
if ( (ch >= 65 && ch <= 90) || ch == 32 ) |
|
|
|
|
sendKey = ((char)ch).ToString().ToLower() ; |
|
|
|
|
else if ( ch >= 48 && ch <= 57 ) |
|
|
|
|
sendKey = keyCode.ToString().Substring( 1 ) ; |
|
|
|
|
sendKey = keyCode.ToString().Substring( 1 ) ; // nb: this will also detect Shift 0-9 :-/ |
|
|
|
|
else if ( keyCode == Keys.Back ) |
|
|
|
|
sendKey = "{BKSP}" ; |
|
|
|
|
if ( sendKey != "" ) { |
|
|
|
|
// check if it's time to start a new search query |
|
|
|
|
int ttl = Program.appConfig.getIntVal( new string[]{"SearchQueryTTL"}, 5 ) ; |
|
|
|
|
if ( (DateTime.Now - mLastKeyPressTimeStamp).TotalSeconds > ttl ) |
|
|
|
|
mSearchQuery.Text = "" ; |
|
|
|
|
mLastKeyPressTimeStamp = DateTime.Now ; |
|
|
|
|
// send the keypress to the search query textbox |
|
|
|
|
mSearchQuery.Focus() ; |
|
|
|
|
mDisableProcessCmdKey = true ; |
|
|
|
@ -458,6 +454,16 @@ public partial class MainForm : Form |
|
|
|
|
doMainFormResize( null ) ; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void SearchQuery_KeyPress( object sender, KeyPressEventArgs e ) |
|
|
|
|
{ |
|
|
|
|
// check if it's time to start a new search query |
|
|
|
|
int ttl = Program.appConfig.getIntVal( new string[]{"SearchQueryTTL"}, 5 ) ; |
|
|
|
|
if ( (DateTime.Now - mLastKeyPressTimeStamp).TotalSeconds > ttl ) { |
|
|
|
|
setSearchQuery( "", false ) ; |
|
|
|
|
} |
|
|
|
|
mLastKeyPressTimeStamp = DateTime.Now ; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void SearchQuery_TextChanged( object sender, EventArgs e ) |
|
|
|
|
{ |
|
|
|
|
// update the search results |
|
|
|
|