From 2cb0b47b0090466267d82d10b235532b31dbf5d5 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 15 Jun 2016 18:09:24 +0000 Subject: minor core reordering git-svn-id: http://svn.miranda-ng.org/main/trunk@16979 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/mir_app/src/clc.cpp | 75 ++++++++++++++++++++++--------------------------- 1 file changed, 33 insertions(+), 42 deletions(-) (limited to 'src') diff --git a/src/mir_app/src/clc.cpp b/src/mir_app/src/clc.cpp index f249043280..7e02a50895 100644 --- a/src/mir_app/src/clc.cpp +++ b/src/mir_app/src/clc.cpp @@ -667,29 +667,23 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam cli.pfnHideInfoTip(hwnd, dat); KillTimer(hwnd, TIMERID_INFOTIP); KillTimer(hwnd, TIMERID_RENAME); - { - UINT scrollLines; - if (!SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, &scrollLines, FALSE)) - scrollLines = 3; - cli.pfnScrollTo(hwnd, dat, dat->yScroll - (short)HIWORD(wParam) * dat->rowHeight * (signed)scrollLines / WHEEL_DELTA, 0); - } + + UINT scrollLines; + if (!SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, &scrollLines, FALSE)) + scrollLines = 3; + cli.pfnScrollTo(hwnd, dat, dat->yScroll - (short)HIWORD(wParam) * dat->rowHeight * (signed)scrollLines / WHEEL_DELTA, 0); return 0; case WM_KEYDOWN: - { - int selMoved = 0; - int changeGroupExpand = 0; - int pageSize; - cli.pfnHideInfoTip(hwnd, dat); - KillTimer(hwnd, TIMERID_INFOTIP); - KillTimer(hwnd, TIMERID_RENAME); - if (CallService(MS_CLIST_MENUPROCESSHOTKEY, wParam, MPCF_CONTACTMENU)) - break; - { - RECT clRect; - GetClientRect(hwnd, &clRect); - pageSize = clRect.bottom / dat->rowHeight; - } + cli.pfnHideInfoTip(hwnd, dat); + KillTimer(hwnd, TIMERID_INFOTIP); + KillTimer(hwnd, TIMERID_RENAME); + if (!CallService(MS_CLIST_MENUPROCESSHOTKEY, wParam, MPCF_CONTACTMENU)) { + RECT clRect; + GetClientRect(hwnd, &clRect); + int pageSize = clRect.bottom / dat->rowHeight; + int selMoved = 0, changeGroupExpand = 0; + switch (wParam) { case VK_DOWN: dat->selection++; selMoved = 1; break; case VK_UP: dat->selection--; selMoved = 1; break; @@ -708,36 +702,33 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam case VK_F2: cli.pfnBeginRenameSelection(hwnd, dat); return 0; case VK_DELETE: cli.pfnDeleteFromContactList(hwnd, dat); return 0; default: - { - NMKEY nmkey; - nmkey.hdr.hwndFrom = hwnd; - nmkey.hdr.idFrom = GetDlgCtrlID(hwnd); - nmkey.hdr.code = NM_KEYDOWN; - nmkey.nVKey = wParam; - nmkey.uFlags = HIWORD(lParam); - if (SendMessage(GetParent(hwnd), WM_NOTIFY, 0, (LPARAM)& nmkey)) - return 0; - } + NMKEY nmkey; + nmkey.hdr.hwndFrom = hwnd; + nmkey.hdr.idFrom = GetDlgCtrlID(hwnd); + nmkey.hdr.code = NM_KEYDOWN; + nmkey.nVKey = wParam; + nmkey.uFlags = HIWORD(lParam); + if (SendMessage(GetParent(hwnd), WM_NOTIFY, 0, (LPARAM)& nmkey)) + return 0; } if (changeGroupExpand) { if (!dat->bFilterSearch) dat->szQuickSearch[0] = 0; hit = cli.pfnGetRowByIndex(dat, dat->selection, &contact, &group); - if (hit != -1) { - if (changeGroupExpand == 1 && contact->type == CLCIT_CONTACT) { - if (group == &dat->list) - return 0; - dat->selection = cli.pfnGetRowsPriorTo(&dat->list, group, -1); - selMoved = 1; - } - else { - if (contact->type == CLCIT_GROUP) - cli.pfnSetGroupExpand(hwnd, dat, contact->group, changeGroupExpand == 2); + if (hit == -1) + return 0; + + if (changeGroupExpand == 1 && contact->type == CLCIT_CONTACT) { + if (group == &dat->list) return 0; - } + dat->selection = cli.pfnGetRowsPriorTo(&dat->list, group, -1); + selMoved = 1; } - else + else { + if (contact->type == CLCIT_GROUP) + cli.pfnSetGroupExpand(hwnd, dat, contact->group, changeGroupExpand == 2); return 0; + } } if (selMoved) { if (!dat->bFilterSearch) -- cgit v1.2.3