summaryrefslogtreecommitdiff
path: root/protocols/MRA/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-12-01 13:25:11 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-12-01 13:25:11 +0000
commit854959cbc0a1bad2c086214be4d1a829b17a61f3 (patch)
treeee3de50f4b4e57f54ae20d139f97fa469ff90d34 /protocols/MRA/src
parent73ddc73d92675399e4619758d4b0881418de0a6d (diff)
icolib: icon creation quirks
git-svn-id: http://svn.miranda-ng.org/main/trunk@2588 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MRA/src')
-rw-r--r--protocols/MRA/src/MraIcons.cpp30
-rw-r--r--protocols/MRA/src/resource.h1
2 files changed, 13 insertions, 18 deletions
diff --git a/protocols/MRA/src/MraIcons.cpp b/protocols/MRA/src/MraIcons.cpp
index be4790745f..a7bf1d446b 100644
--- a/protocols/MRA/src/MraIcons.cpp
+++ b/protocols/MRA/src/MraIcons.cpp
@@ -38,7 +38,7 @@ GUI_DISPLAY_ITEM gdiContactMenuItems[] =
GUI_DISPLAY_ITEM gdiExtraStatusIconsItems[] =
{
- { ADV_ICON_DELETED_ID, ADV_ICON_DELETED_STR, (INT_PTR)IDI_ERROR, NULL },
+ { ADV_ICON_DELETED_ID, ADV_ICON_DELETED_STR, IDI_DELETED, NULL },
{ ADV_ICON_NOT_ON_SERVER_ID, ADV_ICON_NOT_ON_SERVER_STR, IDI_AUTHGRANT, NULL },
{ ADV_ICON_NOT_AUTHORIZED_ID, ADV_ICON_NOT_AUTHORIZED_STR, IDI_AUTHRUGUEST, NULL },
{ ADV_ICON_PHONE_ID, ADV_ICON_PHONE_STR, IDI_MRA_PHONE, NULL },
@@ -47,30 +47,28 @@ GUI_DISPLAY_ITEM gdiExtraStatusIconsItems[] =
//////////////////////////////////////////////////////////////////////////////////////
-static void AddIcoLibItems(LPWSTR lpwszSubSectionName, GUI_DISPLAY_ITEM *pgdiItems, size_t dwCount)
+static void AddIcoLibItems(LPWSTR lptszSubSectionName, GUI_DISPLAY_ITEM *pgdiItems, size_t dwCount)
{
- char szBuff[MAX_PATH];
- WCHAR wszSection[MAX_PATH], wszPath[MAX_FILEPATH];
+ TCHAR tszSection[MAX_PATH], tszPath[MAX_FILEPATH];
+ GetModuleFileName(masMraSettings.hInstance, tszPath, SIZEOF(tszPath));
+ mir_sntprintf(tszSection, SIZEOF(tszSection), L"Protocols/MRA/%s", lptszSubSectionName);
- SKINICONDESC sid = {0};
- sid.cbSize = sizeof(sid);
- sid.pwszSection = wszSection;
- sid.pwszDefaultFile = wszPath;
+ SKINICONDESC sid = { sizeof(sid) };
+ sid.ptszSection = tszSection;
+ sid.ptszDefaultFile = tszPath;
sid.cx = sid.cy = 16;
sid.flags = SIDF_ALL_UNICODE;
- if (lpwszSubSectionName == NULL) lpwszSubSectionName = L"";
- GetModuleFileName(masMraSettings.hInstance, wszPath, SIZEOF(wszPath));
- mir_sntprintf(wszSection, SIZEOF(wszSection), L"Protocols/MRA/%s", lpwszSubSectionName);
+ if (lptszSubSectionName == NULL)
+ lptszSubSectionName = _T("");
for (size_t i = 0;i<dwCount;i++) {
+ char szBuff[MAX_PATH];
mir_snprintf(szBuff, SIZEOF(szBuff), "MRA_%s", pgdiItems[i].lpszName);
+
sid.pszName = szBuff;
sid.pwszDescription = pgdiItems[i].lpwszDescr;
sid.iDefaultIndex = -pgdiItems[i].defIcon;
- sid.hDefaultIcon = (HICON)LoadImage(masMraSettings.hInstance, MAKEINTRESOURCE(pgdiItems[i].defIcon), IMAGE_ICON, 0, 0, LR_SHARED);
- if (sid.hDefaultIcon == NULL)
- sid.hDefaultIcon = (HICON)LoadImage(NULL, MAKEINTRESOURCE(pgdiItems[i].defIcon), IMAGE_ICON, 0, 0, LR_SHARED);
pgdiItems[i].hIconHandle = Skin_AddIcon(&sid);
}
}
@@ -125,10 +123,6 @@ void InitXStatusIcons()
int iCurIndex = i+IDI_XSTATUS1-1;
sid.pwszDescription = lpcszXStatusNameDef[i];
sid.iDefaultIndex = -iCurIndex;
- if (masMraSettings.hDLLXStatusIcons)
- sid.hDefaultIcon = (HICON)LoadImage(masMraSettings.hDLLXStatusIcons, MAKEINTRESOURCE(iCurIndex), IMAGE_ICON, 0, 0, LR_SHARED);
- else
- sid.hDefaultIcon = NULL;
hXStatusAdvancedStatusIcons[i] = Skin_AddIcon(&sid);
}
diff --git a/protocols/MRA/src/resource.h b/protocols/MRA/src/resource.h
index da661ea9be..103ca8e88b 100644
--- a/protocols/MRA/src/resource.h
+++ b/protocols/MRA/src/resource.h
@@ -19,6 +19,7 @@
#define IDI_MRA_POSTCARD 114
#define IDI_MRA_ZHUKI 115
#define IDI_MRA_PHOTO 117
+#define IDI_DELETED 118
#define IDI_MRA_CHAT 120
#define IDI_MRA_PHONE 122
#define IDD_OPT_FILES 126