From 560ff1295e22341416270201dd6dfb64cd1022f6 Mon Sep 17 00:00:00 2001 From: Tobias Weimer Date: Sat, 25 Jul 2015 17:10:27 +0000 Subject: ContactsPlus: - Fixed missing icons git-svn-id: http://svn.miranda-ng.org/main/trunk@14694 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/ContactsPlus/src/receive.cpp | 12 ++++-------- plugins/ContactsPlus/src/send.cpp | 10 ++++------ plugins/ContactsPlus/src/utils.cpp | 6 +++--- plugins/ContactsPlus/src/utils.h | 2 +- 4 files changed, 12 insertions(+), 18 deletions(-) diff --git a/plugins/ContactsPlus/src/receive.cpp b/plugins/ContactsPlus/src/receive.cpp index 1c8596e94d..c7045053ad 100644 --- a/plugins/ContactsPlus/src/receive.cpp +++ b/plugins/ContactsPlus/src/receive.cpp @@ -239,10 +239,10 @@ INT_PTR CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara } } // new dlg init - wndData->hIcons[0] = InitMButton(hwndDlg, IDC_ADD, MAKEINTRESOURCEA(IDI_ADDCONTACT), LPGEN("Add Contact Permanently to List")); - wndData->hIcons[1] = InitMButton(hwndDlg, IDC_DETAILS, MAKEINTRESOURCEA(IDI_USERDETAILS), LPGEN("View User's Details")); - wndData->hIcons[2] = InitMButton(hwndDlg, IDC_HISTORY, MAKEINTRESOURCEA(IDI_HISTORY), LPGEN("View User's History")); - wndData->hIcons[3] = InitMButton(hwndDlg, IDC_USERMENU, MAKEINTRESOURCEA(IDI_DOWNARROW), LPGEN("User Menu")); + wndData->hIcons[0] = InitMButton(hwndDlg, IDC_ADD, SKINICON_OTHER_ADDCONTACT, LPGENT("Add Contact Permanently to List")); + wndData->hIcons[1] = InitMButton(hwndDlg, IDC_DETAILS, SKINICON_OTHER_USERDETAILS, LPGENT("View User's Details")); + wndData->hIcons[2] = InitMButton(hwndDlg, IDC_HISTORY, SKINICON_OTHER_HISTORY, LPGENT("View User's History")); + wndData->hIcons[3] = InitMButton(hwndDlg, IDC_USERMENU, SKINICON_OTHER_DOWNARROW, LPGENT("User Menu")); SendMessage(hwndDlg,DM_UPDATETITLE,0,0); // new dialog init done @@ -458,10 +458,6 @@ INT_PTR CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara ImageList_Destroy(wndData->mhListIcon); UnhookEvent(wndData->hHook); DestroyMenu(wndData->mhPopup); - { - for (int i = 0; i < _countof(wndData->hIcons); i++) - DestroyIcon(wndData->hIcons[i]); - } delete wndData; // automatically calls destructor break; diff --git a/plugins/ContactsPlus/src/send.cpp b/plugins/ContactsPlus/src/send.cpp index ee96c01ea1..52d5c06614 100644 --- a/plugins/ContactsPlus/src/send.cpp +++ b/plugins/ContactsPlus/src/send.cpp @@ -234,10 +234,10 @@ INT_PTR CALLBACK SendDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara wndData = new TSendContactsData(lParam); SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)wndData); // new dlg init - wndData->hIcons[0] = InitMButton(hwndDlg, IDC_ADD, MAKEINTRESOURCEA(IDI_ADDCONTACT), LPGEN("Add Contact Permanently to List")); - wndData->hIcons[1] = InitMButton(hwndDlg, IDC_DETAILS, MAKEINTRESOURCEA(IDI_USERDETAILS), LPGEN("View User's Details")); - wndData->hIcons[2] = InitMButton(hwndDlg, IDC_HISTORY, MAKEINTRESOURCEA(IDI_HISTORY), LPGEN("View User's History")); - wndData->hIcons[3] = InitMButton(hwndDlg, IDC_USERMENU, MAKEINTRESOURCEA(IDI_DOWNARROW), LPGEN("User Menu")); + wndData->hIcons[0] = InitMButton(hwndDlg, IDC_ADD, SKINICON_OTHER_ADDCONTACT, LPGENT("Add Contact Permanently to List")); + wndData->hIcons[1] = InitMButton(hwndDlg, IDC_DETAILS, SKINICON_OTHER_USERDETAILS, LPGENT("View User's Details")); + wndData->hIcons[2] = InitMButton(hwndDlg, IDC_HISTORY, SKINICON_OTHER_HISTORY, LPGENT("View User's History")); + wndData->hIcons[3] = InitMButton(hwndDlg, IDC_USERMENU, SKINICON_OTHER_DOWNARROW, LPGENT("User Menu")); SendMessage(hwndDlg, DM_UPDATETITLE, 0, 0); // new dialog init done @@ -461,8 +461,6 @@ INT_PTR CALLBACK SendDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara break; case WM_DESTROY: - for (int i = 0; i < _countof(wndData->hIcons); i++) - DestroyIcon(wndData->hIcons[i]); WindowList_Remove(g_hSendWindowList, hwndDlg); delete wndData; break; diff --git a/plugins/ContactsPlus/src/utils.cpp b/plugins/ContactsPlus/src/utils.cpp index 3d07a8f99c..f55fb97a7c 100644 --- a/plugins/ContactsPlus/src/utils.cpp +++ b/plugins/ContactsPlus/src/utils.cpp @@ -145,14 +145,14 @@ void UpdateDialogAddButton(HWND hwndDlg, MCONTACT hContact) } -HICON InitMButton(HWND hDlg, int idButton, LPCSTR szIcon, char *szTip) +HICON InitMButton(HWND hDlg, int idButton, int idIcon, TCHAR *szTip) { HWND hButton = GetDlgItem(hDlg, idButton); - HICON hIcon = (HICON)LoadImageA(GetModuleHandle(NULL), szIcon, IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0); + HICON hIcon = Skin_LoadIcon(idIcon); SendMessage(hButton, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon); SendMessage(hButton, BUTTONSETASFLATBTN, TRUE, 0); - SendMessage(hButton, BUTTONADDTOOLTIP, (WPARAM)szTip, 0); + SendMessage(hButton, BUTTONADDTOOLTIP, (WPARAM)szTip, BATF_TCHAR); return hIcon; } diff --git a/plugins/ContactsPlus/src/utils.h b/plugins/ContactsPlus/src/utils.h index f0337c3dab..cf284b44e7 100644 --- a/plugins/ContactsPlus/src/utils.h +++ b/plugins/ContactsPlus/src/utils.h @@ -38,7 +38,7 @@ void DrawProtocolIcon(HWND hwndDlg, LPARAM lParam, MCONTACT hContact); void UpdateDialogTitle(HWND hwndDlg, MCONTACT hContact, TCHAR *pszTitleStart); void UpdateDialogAddButton(HWND hwndDlg, MCONTACT hContact); -HICON InitMButton(HWND hDlg, int idButton, LPCSTR szIcon, char* szTip); +HICON InitMButton(HWND hDlg, int idButton, int idIcon, TCHAR *szTip); void DialogAddContactExecute(HWND hwndDlg, MCONTACT hNewContact); -- cgit v1.2.3