From e865872b4ef16b6e40cfe868843f1070fa3a239b Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 21 Jun 2015 12:01:49 +0000 Subject: - resizer moved to mir_core, because it uses hard-coded windows structures; - MS_UTILS_RESIZEDIALOG replaced with a short call of Utils_ResizeDialog; - code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@14295 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/JabberG/src/jabber_iqid_muc.cpp | 33 +++++++++++-------------------- protocols/JabberG/src/jabber_opt.cpp | 10 +--------- 2 files changed, 12 insertions(+), 31 deletions(-) (limited to 'protocols/JabberG') diff --git a/protocols/JabberG/src/jabber_iqid_muc.cpp b/protocols/JabberG/src/jabber_iqid_muc.cpp index cd982c3515..17307fbbc6 100644 --- a/protocols/JabberG/src/jabber_iqid_muc.cpp +++ b/protocols/JabberG/src/jabber_iqid_muc.cpp @@ -167,7 +167,8 @@ static int sttJidListResizer(HWND, LPARAM, UTILRESIZECONTROL *urc) static INT_PTR CALLBACK JabberMucJidListDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { - JABBER_MUC_JIDLIST_INFO* dat = (JABBER_MUC_JIDLIST_INFO*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); + JABBER_MUC_JIDLIST_INFO *dat = (JABBER_MUC_JIDLIST_INFO*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); + HWND hwndList = GetDlgItem(hwndDlg, IDC_LIST); switch(msg) { case WM_INITDIALOG: @@ -177,7 +178,6 @@ static INT_PTR CALLBACK JabberMucJidListDlgProc(HWND hwndDlg, UINT msg, WPARAM w TranslateDialogDefault(hwndDlg); - HWND hwndList = GetDlgItem(hwndDlg, IDC_LIST); ListView_SetExtendedListViewStyle(hwndList, LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES); GetClientRect(hwndList, &rc); //rc.right -= GetSystemMetrics(SM_CXVSCROLL); @@ -212,26 +212,16 @@ static INT_PTR CALLBACK JabberMucJidListDlgProc(HWND hwndDlg, UINT msg, WPARAM w Utils_RestoreWindowPosition(hwndDlg, NULL, dat->ppro->m_szModuleName, "jidListWnd_"); } return TRUE; + case WM_SIZE: - { - UTILRESIZEDIALOG urd = {0}; - urd.cbSize = sizeof(urd); - urd.hInstance = hInst; - urd.hwndDlg = hwndDlg; - urd.lpTemplate = MAKEINTRESOURCEA(IDD_JIDLIST); - urd.pfnResizer = sttJidListResizer; - CallService(MS_UTILS_RESIZEDIALOG, 0, (LPARAM)&urd); - - RECT listrc; - LVCOLUMN lvc; - HWND hwndList = GetDlgItem(hwndDlg, IDC_LIST); - GetClientRect(hwndList, &listrc); - lvc.mask = LVCF_WIDTH; - //listrc.right -= GetSystemMetrics(SM_CXVSCROLL); - lvc.cx = listrc.right - 20; - SendMessage(hwndList, LVM_SETCOLUMN, 0, (LPARAM)&lvc); - break; - } + Utils_ResizeDialog(hwndDlg, hInst, MAKEINTRESOURCEA(IDD_JIDLIST), sttJidListResizer); + + RECT listrc; + LVCOLUMN lvc; + GetClientRect(hwndList, &listrc); + lvc.mask = LVCF_WIDTH; + lvc.cx = listrc.right - 20; + SendMessage(hwndList, LVM_SETCOLUMN, 0, (LPARAM)&lvc); break; case WM_JABBER_REFRESH: @@ -388,7 +378,6 @@ static INT_PTR CALLBACK JabberMucJidListDlgProc(HWND hwndDlg, UINT msg, WPARAM w LVITEM lvi; // Free lParam of the displayed list items - HWND hwndList = GetDlgItem(hwndDlg, IDC_LIST); int count = ListView_GetItemCount(hwndList); lvi.mask = LVIF_PARAM; lvi.iSubItem = 0; diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp index 88a03769e6..7755e0bfca 100644 --- a/protocols/JabberG/src/jabber_opt.cpp +++ b/protocols/JabberG/src/jabber_opt.cpp @@ -1447,15 +1447,7 @@ static INT_PTR CALLBACK JabberRosterOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wP } case WM_SIZE: - { - UTILRESIZEDIALOG urd = {0}; - urd.cbSize = sizeof(urd); - urd.hInstance = hInst; - urd.hwndDlg = hwndDlg; - urd.lpTemplate = MAKEINTRESOURCEA(IDD_OPT_JABBER3); - urd.pfnResizer = sttRosterEditorResizer; - CallService(MS_UTILS_RESIZEDIALOG, 0, (LPARAM)&urd); - } + Utils_ResizeDialog(hwndDlg, hInst, MAKEINTRESOURCEA(IDD_OPT_JABBER3), sttRosterEditorResizer); break; case WM_COMMAND: -- cgit v1.2.3