From 57abc51aad272a656282a52a460a47abe24e07d6 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 20 Jun 2012 23:51:53 +0000 Subject: - MS_SKIN2_ADDICON replaced with Skin_AddIcon; - SKINICONDESC_SIZE* constants removed and replaced with sizeof(sid); - added SIDF_PATH_UNICODE for all plugins; - dynamic translation fixed in the icolib options dialog git-svn-id: http://svn.miranda-ng.org/main/trunk@507 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/FavContacts/src/main.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'plugins/FavContacts') diff --git a/plugins/FavContacts/src/main.cpp b/plugins/FavContacts/src/main.cpp index c6dfaa7bb1..d2c4db9f6f 100644 --- a/plugins/FavContacts/src/main.cpp +++ b/plugins/FavContacts/src/main.cpp @@ -67,7 +67,7 @@ INT_PTR svcShowMenuCentered(WPARAM wParam, LPARAM lParam); int ProcessSrmmEvent(WPARAM wParam, LPARAM lParam); int ProcessSrmmIconClick(WPARAM wParam, LPARAM lParam); -int g_icoFavourite=0, g_icoRegular=0; +HANDLE g_icoFavourite=0, g_icoRegular=0; float g_widthMultiplier = 0; int g_maxItemWidth = 0; @@ -186,9 +186,9 @@ int ProcessModulesLoaded(WPARAM wParam, LPARAM lParam) StatusIconData sid = {0}; sid.cbSize = sizeof(sid); sid.szModule = "FavContacts"; - sid.szTooltip = Translate("Favourite Contacts"); - sid.hIcon = (HICON)CallService(MS_SKIN2_GETICONBYHANDLE, 0, g_icoFavourite); - sid.hIconDisabled = (HICON)CallService(MS_SKIN2_GETICONBYHANDLE, 0, g_icoRegular); + sid.szTooltip = "Favourite Contacts"; + sid.hIcon = (HICON)CallService(MS_SKIN2_GETICONBYHANDLE, 0, (LPARAM)g_icoFavourite); + sid.hIconDisabled = (HICON)CallService(MS_SKIN2_GETICONBYHANDLE, 0, (LPARAM)g_icoRegular); CallService(MS_MSG_ADDICON, 0, (LPARAM)&sid); HookEvent(ME_MSG_ICONPRESSED, ProcessSrmmIconClick); @@ -355,12 +355,12 @@ extern "C" __declspec(dllexport) int Load(PLUGINLINK * link) sid.pszName = "favcontacts_favourite"; sid.ptszDescription = _T("Favourite Contact"); sid.iDefaultIndex = -IDI_FAVOURITE; - g_icoFavourite = CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid); + g_icoFavourite = Skin_AddIcon(&sid); sid.pszName = "favcontacts_regular"; sid.ptszDescription = _T("Regular Contact"); sid.iDefaultIndex = -IDI_REGULAR; - g_icoRegular = CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid); + g_icoRegular = Skin_AddIcon(&sid); LoadHttpApi(); @@ -753,7 +753,7 @@ static BOOL sttDrawItem_Contact(LPDRAWITEMSTRUCT lpdis, Options *options = NULL) if (options->wMaxRecent && DBGetContactSettingByte(hContact, "FavContacts", "IsFavourite", 0)) { DrawIconEx(hdcTemp, lpdis->rcItem.right - 18, (lpdis->rcItem.top + lpdis->rcItem.bottom - 16) / 2, - (HICON)CallService(MS_SKIN2_GETICONBYHANDLE, 0, g_icoFavourite), 16, 16, 0, NULL, DI_NORMAL); + (HICON)CallService(MS_SKIN2_GETICONBYHANDLE, 0, (LPARAM)g_icoFavourite), 16, 16, 0, NULL, DI_NORMAL); lpdis->rcItem.right -= 20; } @@ -1015,8 +1015,7 @@ int sttShowMenu(bool centered) szColumn.cx = szColumn.cy = 0; unsigned maxWidth = GetSystemMetrics(SM_CXSCREEN) * DBGetContactSettingByte(NULL, "FavContacts", "MenuWidth", 66) / 100; - if (szMenu.cx > maxWidth) - { + if (szMenu.cx > maxWidth) { g_widthMultiplier = (float)maxWidth / szMenu.cx; szMenu.cx *= g_widthMultiplier; } -- cgit v1.2.3