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/TabSRMM/src/msgdialog.cpp | |
parent | 7c711561aa5a124b51df2c1cba138eb518e6aad6 (diff) |
nick search went to core
Diffstat (limited to 'plugins/TabSRMM/src/msgdialog.cpp')
-rw-r--r-- | plugins/TabSRMM/src/msgdialog.cpp | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index a93a455a2a..02b5eb8de5 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -1976,63 +1976,6 @@ LRESULT CMsgDialog::WndProc_Nicklist(UINT msg, WPARAM wParam, LPARAM lParam) PostMessage(m_hwnd, WM_CLOSE, 0, 1);
return TRUE;
}
-
- 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;
- m_iSearchItem = -1;
- }
- break;
-
- case WM_SETFOCUS:
- case WM_KILLFOCUS:
- m_wszSearch[0] = 0;
- m_iSearchItem = -1;
- 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;
- m_iSearchItem = -1;
- break;
- }
- if (wParam == '\b' && m_wszSearch[0]) // backspace
- m_wszSearch[mir_wstrlen(m_wszSearch) - 1] = '\0';
- else if (wParam < ' ')
- break;
- else {
- if (mir_wstrlen(m_wszSearch) >= _countof(m_wszSearch) - 2) {
- MessageBeep(MB_OK);
- break;
- }
- wchar_t szNew[2];
- szNew[0] = (wchar_t)wParam;
- szNew[1] = '\0';
- mir_wstrcat(m_wszSearch, szNew);
- }
- if (m_wszSearch[0]) {
- // iterate over the (sorted) list of nicknames and search for the
- // string we have
- int i, iItems = m_nickList.SendMsg(LB_GETCOUNT, 0, 0);
- for (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.SendMsg(LB_SETSEL, FALSE, -1);
- m_nickList.SendMsg(LB_SETSEL, TRUE, i);
- m_iSearchItem = i;
- InvalidateRect(m_nickList.GetHwnd(), nullptr, FALSE);
- return 0;
- }
- }
- }
- if (i == iItems) {
- MessageBeep(MB_OK);
- m_wszSearch[mir_wstrlen(m_wszSearch) - 1] = '\0';
- return 0;
- }
- }
break;
}
|