diff options
author | George Hazan <george.hazan@gmail.com> | 2023-06-19 17:54:32 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2023-06-19 17:54:32 +0300 |
commit | 1c3bbb283ca5f0d25658e190c4c41a4667f71ff2 (patch) | |
tree | 892c6964b7d7c4bd572fbdb9dc8736605471d6c6 /plugins/Scriver/src | |
parent | 7c711561aa5a124b51df2c1cba138eb518e6aad6 (diff) |
nick search went to core
Diffstat (limited to 'plugins/Scriver/src')
-rw-r--r-- | plugins/Scriver/src/msgdialog.cpp | 49 | ||||
-rw-r--r-- | plugins/Scriver/src/msgs.h | 1 |
2 files changed, 0 insertions, 50 deletions
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index 4188ef3b2c..c69bf8a266 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -868,55 +868,6 @@ LRESULT CMsgDialog::WndProc_Nicklist(UINT msg, WPARAM wParam, LPARAM lParam) }
}
break;
-
- case WM_KEYDOWN:
- if (wParam == VK_ESCAPE || wParam == VK_UP || wParam == VK_DOWN || wParam == VK_NEXT || wParam == VK_PRIOR || wParam == VK_TAB || wParam == VK_HOME || wParam == VK_END)
- m_wszSearch[0] = 0;
- break;
-
- case WM_CHAR:
- case WM_UNICHAR:
- /*
- * simple incremental search for the user (nick) - list control
- * typing esc or movement keys will clear the current search string
- */
- if (wParam == 27 && m_wszSearch[0]) { // escape - reset everything
- m_wszSearch[0] = 0;
- break;
- }
- else if (wParam == '\b' && m_wszSearch[0]) // backspace
- m_wszSearch[mir_wstrlen(m_wszSearch) - 1] = '\0';
- else if (wParam < ' ')
- break;
- else {
- wchar_t szNew[2];
- szNew[0] = (wchar_t)wParam;
- szNew[1] = '\0';
- if (mir_wstrlen(m_wszSearch) >= _countof(m_wszSearch) - 2) {
- MessageBeep(MB_OK);
- break;
- }
- mir_wstrcat(m_wszSearch, szNew);
- }
- if (m_wszSearch[0]) {
- // iterate over the (sorted) list of nicknames and search for the
- // string we have
- int iItems = m_nickList.GetCount();
- for (int i = 0; i < iItems; i++) {
- if (auto *ui = (USERINFO*)m_nickList.GetItemData(i)) {
- if (!wcsnicmp(ui->pszNick, m_wszSearch, mir_wstrlen(m_wszSearch))) {
- m_nickList.SetCurSel(i);
- InvalidateRect(m_nickList.GetHwnd(), nullptr, FALSE);
- return 0;
- }
- }
- }
-
- MessageBeep(MB_OK);
- m_wszSearch[mir_wstrlen(m_wszSearch) - 1] = '\0';
- return 0;
- }
- break;
}
return CSuper::WndProc_Nicklist(msg, wParam, lParam);
diff --git a/plugins/Scriver/src/msgs.h b/plugins/Scriver/src/msgs.h index e2b200c13f..936da01f5d 100644 --- a/plugins/Scriver/src/msgs.h +++ b/plugins/Scriver/src/msgs.h @@ -98,7 +98,6 @@ class CMsgDialog : public CSrmmBaseDialog // autocomplete
void TabAutoComplete(void);
- wchar_t m_wszSearch[255];
wchar_t *m_wszSearchQuery, *m_wszSearchResult;
SESSION_INFO *m_pLastSession;
|