summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-12-21 12:35:17 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-12-21 12:35:17 +0000
commit55148988e8302c760e84319811b903906d716acd (patch)
tree5d753233d6d2402d8e64b28ea3aa900c55faa190
parentc38ee02b8458484ce9ab752229a8282417816aa1 (diff)
fixes ticket #485: Not possible to leave the advanced search dialog with keyboard
git-svn-id: http://svn.miranda-ng.org/main/trunk@7317 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--protocols/Gadu-Gadu/src/gg_proto.cpp8
-rw-r--r--protocols/IcqOscarJ/src/icq_advsearch.cpp22
-rw-r--r--protocols/MRA/src/MraAdvancedSearch.cpp3
-rw-r--r--src/modules/findadd/findadd.cpp22
4 files changed, 22 insertions, 33 deletions
diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp
index 0ccbb67a87..69b3afc0f9 100644
--- a/protocols/Gadu-Gadu/src/gg_proto.cpp
+++ b/protocols/Gadu-Gadu/src/gg_proto.cpp
@@ -557,14 +557,6 @@ static INT_PTR CALLBACK gg_advancedsearchdlgproc(HWND hwndDlg,UINT message,WPARA
SendDlgItemMessage(hwndDlg, IDC_GENDER, CB_ADDSTRING, 0, (LPARAM)TranslateT("Female")); // 1
SendDlgItemMessage(hwndDlg, IDC_GENDER, CB_ADDSTRING, 0, (LPARAM)TranslateT("Male")); // 2
return TRUE;
-
- case WM_COMMAND:
- switch(LOWORD(wParam)) {
- case IDOK:
- SendMessage(GetParent(hwndDlg), WM_COMMAND,MAKEWPARAM(IDOK,BN_CLICKED), (LPARAM)GetDlgItem(GetParent(hwndDlg),IDOK));
- break;
- }
- break;
}
return FALSE;
}
diff --git a/protocols/IcqOscarJ/src/icq_advsearch.cpp b/protocols/IcqOscarJ/src/icq_advsearch.cpp
index 05d0d8f442..d3bd412980 100644
--- a/protocols/IcqOscarJ/src/icq_advsearch.cpp
+++ b/protocols/IcqOscarJ/src/icq_advsearch.cpp
@@ -70,28 +70,6 @@ INT_PTR CALLBACK AdvancedSearchDlgProc(HWND hwndDlg, UINT message, WPARAM wParam
InitComboBox(GetDlgItem(hwndDlg, IDC_PASTCAT), pastField);
return TRUE;
-
- case WM_COMMAND:
- {
- switch(LOWORD(wParam))
- {
-
- case IDOK:
- SendMessage(GetParent(hwndDlg), WM_COMMAND, MAKEWPARAM(IDOK, BN_CLICKED), (LPARAM)GetDlgItem(GetParent(hwndDlg), IDOK));
- break;
-
- case IDCANCEL:
- // CheckDlgButton(GetParent(hwndDlg),IDC_ADVANCED,BST_UNCHECKED);
- // SendMessage(GetParent(hwndDlg),WM_COMMAND,MAKEWPARAM(IDC_ADVANCED,BN_CLICKED),(LPARAM)GetDlgItem(GetParent(hwndDlg),IDC_ADVANCED));
- break;
-
- default:
- break;
-
- }
- break;
- }
-
default:
break;
}
diff --git a/protocols/MRA/src/MraAdvancedSearch.cpp b/protocols/MRA/src/MraAdvancedSearch.cpp
index 6c62bca48f..31e9fcac09 100644
--- a/protocols/MRA/src/MraAdvancedSearch.cpp
+++ b/protocols/MRA/src/MraAdvancedSearch.cpp
@@ -184,9 +184,6 @@ INT_PTR CALLBACK AdvancedSearchDlgProc(HWND hWndDlg, UINT message, WPARAM wParam
case WM_COMMAND:
switch (LOWORD(wParam)) {
- case IDOK:
- SendMessage(GetParent(hWndDlg), WM_COMMAND, MAKEWPARAM(IDOK, BN_CLICKED), (LPARAM)GetDlgItem(GetParent(hWndDlg), IDOK));
- break;
case IDC_AGERANGE_FROM:
case IDC_AGERANGE_TO:
if (HIWORD(wParam) == CBN_SELCHANGE)
diff --git a/src/modules/findadd/findadd.cpp b/src/modules/findadd/findadd.cpp
index 9bc9b73ec8..4472116d2b 100644
--- a/src/modules/findadd/findadd.cpp
+++ b/src/modules/findadd/findadd.cpp
@@ -192,6 +192,26 @@ static void StopThrobber(HWND hwndDlg, FindAddDlgData *dat)
InvalidateRect( GetDlgItem(hwndDlg, IDC_STATUSBAR), NULL, FALSE);
}
+static LRESULT CALLBACK AdvancedSearchDlgSubclassProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ if (msg == WM_COMMAND) {
+ HWND parentHwnd = GetParent(hwndDlg);
+ switch(LOWORD(wParam)) {
+ case IDOK:
+ SendMessage(parentHwnd, WM_COMMAND, MAKEWPARAM(IDOK, BN_CLICKED), (LPARAM)GetDlgItem(parentHwnd, IDOK));
+ SetFocus(GetDlgItem(parentHwnd, IDC_ADVANCED));
+ break;
+
+ case IDCANCEL:
+ CheckDlgButton(parentHwnd, IDC_ADVANCED, BST_UNCHECKED);
+ SendMessage(parentHwnd, WM_COMMAND, MAKEWPARAM(IDC_ADVANCED, BN_CLICKED), (LPARAM)GetDlgItem(parentHwnd, IDC_ADVANCED));
+ SetFocus(GetDlgItem(parentHwnd, IDC_ADVANCED));
+ break;
+ }
+ }
+ return mir_callNextSubclass(hwndDlg, AdvancedSearchDlgSubclassProc, msg, wParam, lParam);
+}
+
static void ShowAdvancedSearchDlg(HWND hwndDlg, FindAddDlgData *dat)
{
char *szProto = (char*)SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETCURSEL, 0, 0), 0);
@@ -201,6 +221,8 @@ static void ShowAdvancedSearchDlg(HWND hwndDlg, FindAddDlgData *dat)
if (dat->hwndAdvSearch == NULL) {
RECT rc;
dat->hwndAdvSearch = (HWND)CallProtoServiceInt(NULL,szProto, PS_CREATEADVSEARCHUI, 0, (LPARAM)hwndDlg);
+ if(dat->hwndAdvSearch != NULL)
+ mir_subclassWindow(dat->hwndAdvSearch, AdvancedSearchDlgSubclassProc);
GetWindowRect( GetDlgItem(hwndDlg, IDC_RESULTS), &rc);
SetWindowPos(dat->hwndAdvSearch, 0, rc.left, rc.top, 0, 0, SWP_NOZORDER|SWP_NOSIZE);
}