diff options
author | George Hazan <george.hazan@gmail.com> | 2013-11-21 21:52:18 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-11-21 21:52:18 +0000 |
commit | 966de6f48098ae0a11067c7f1eca262712118531 (patch) | |
tree | 8ccce4fad6e4724e4b38183f179c0a090cb2dc74 | |
parent | 4fa99acfd0ad8c310cd7a475910b6d03b369cf43 (diff) |
timer for clearing plugin's name filter
git-svn-id: http://svn.miranda-ng.org/main/trunk@6956 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | src/modules/plugins/pluginopts.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/modules/plugins/pluginopts.cpp b/src/modules/plugins/pluginopts.cpp index 9aaedd74fd..d3b362ad84 100644 --- a/src/modules/plugins/pluginopts.cpp +++ b/src/modules/plugins/pluginopts.cpp @@ -32,6 +32,7 @@ HANDLE hevLoadModule, hevUnloadModule; bool bOldMode = false;
static CMString szFilter;
+static UINT_PTR timerID;
/////////////////////////////////////////////////////////////////////////////////////////
// Plugins options page dialog
@@ -225,10 +226,14 @@ static LRESULT CALLBACK PluginListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LP lvfi.flags = LVFI_PARAM;
lvfi.lParam = (LPARAM)p;
int idx = ListView_FindItem(hwnd, 0, &lvfi);
- if (idx != -1) {
- ListView_SetItemState(hwnd, idx, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
- ListView_EnsureVisible(hwnd, idx, FALSE);
- }
+ if (idx == -1)
+ continue;
+
+ ListView_SetItemState(hwnd, idx, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
+ ListView_EnsureVisible(hwnd, idx, FALSE);
+ if (timerID != 0)
+ KillTimer(hwnd, timerID);
+ timerID = SetTimer(hwnd, 1, 1500, 0);
return TRUE;
}
}
@@ -238,6 +243,14 @@ static LRESULT CALLBACK PluginListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LP }
return TRUE;
+ case WM_TIMER:
+ if (wParam == 1) {
+ KillTimer(hwnd, timerID);
+ timerID = 0;
+ szFilter.Empty();
+ }
+ break;
+
case WM_LBUTTONDOWN:
LVHITTESTINFO hi;
hi.pt.x = LOWORD(lParam); hi.pt.y = HIWORD(lParam);
@@ -291,6 +304,7 @@ INT_PTR CALLBACK DlgPluginOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
+ timerID = 0;
{
HWND hwndList = GetDlgItem(hwndDlg, IDC_PLUGLIST);
mir_subclassWindow(hwndList, PluginListWndProc);
|