summaryrefslogtreecommitdiff
path: root/plugins/NewEventNotify/menuitem.cpp
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2012-06-27 19:58:31 +0000
committerKirill Volinsky <mataes2007@gmail.com>2012-06-27 19:58:31 +0000
commit2cf996df8be948a86a9e3d856b91f30bcc9ce50a (patch)
treec2198b8f3f72eb58ef814d1fa3937ec239fad9a8 /plugins/NewEventNotify/menuitem.cpp
parent3b0c1d088b26331fe171699abf3669c99cc5b0f1 (diff)
NewEventNotify:
plusified + unicode try to make it better :) git-svn-id: http://svn.miranda-ng.org/main/trunk@657 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/NewEventNotify/menuitem.cpp')
-rw-r--r--plugins/NewEventNotify/menuitem.cpp31
1 files changed, 12 insertions, 19 deletions
diff --git a/plugins/NewEventNotify/menuitem.cpp b/plugins/NewEventNotify/menuitem.cpp
index eac66a59aa..c569b76180 100644
--- a/plugins/NewEventNotify/menuitem.cpp
+++ b/plugins/NewEventNotify/menuitem.cpp
@@ -23,8 +23,6 @@
*/
#include "neweventnotify.h"
-#include <m_clist.h>
-
CLISTMENUITEM menuitem;
HANDLE hMenuitemNotify;
@@ -32,24 +30,23 @@ BOOL bNotify;
static INT_PTR MenuitemNotifyCmd(WPARAM wParam,LPARAM lParam)
{
- bNotify = !bNotify;
- MenuitemUpdate(bNotify);
+ bNotify = !bNotify;
+ MenuitemUpdate(bNotify);
- //write changes to options->bDisable and into database
- Opt_DisableNEN(!bNotify);
- return 0;
+ //write changes to options->bDisable and into database
+ Opt_DisableNEN(!bNotify);
+ return 0;
}
int MenuitemUpdate(BOOL bStatus)
{
- WCHAR tmp[MAX_PATH];
-
//menuitem.flags = CMIM_FLAGS | (bStatus ? CMIF_CHECKED : 0);
menuitem.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(bStatus ? IDI_ENABLED : IDI_DISABLED));
- menuitem.ptszName = NENTranslateT(bStatus ? MENUITEM_DISABLE : MENUITEM_ENABLE, tmp);
- menuitem.flags = CMIM_ICON | CMIM_NAME | CMIF_KEEPUNTRANSLATED;
- if (g_UnicodeCore)
- menuitem.flags |= CMIF_UNICODE;
+ if (bStatus)
+ menuitem.ptszName = TranslateT(MENUITEM_DISABLE);
+ else
+ menuitem.ptszName = TranslateT(MENUITEM_ENABLE);
+ menuitem.flags = CMIM_ICON | CMIM_NAME | CMIF_KEEPUNTRANSLATED | CMIF_TCHAR;
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuitemNotify, (LPARAM)&menuitem);
return 0;
@@ -57,19 +54,15 @@ int MenuitemUpdate(BOOL bStatus)
int MenuitemInit(BOOL bStatus)
{
- WCHAR tmp[MAX_PATH];
-
CreateServiceFunction(MS_NEN_MENUNOTIFY, MenuitemNotifyCmd);
ZeroMemory(&menuitem, sizeof(menuitem));
menuitem.cbSize = sizeof(CLISTMENUITEM);
menuitem.position = 1;
menuitem.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_ENABLED));
- menuitem.ptszPopupName = NENTranslateT("PopUps", tmp);
+ menuitem.ptszPopupName = TranslateT("PopUps");
menuitem.pszService = MS_NEN_MENUNOTIFY;
- menuitem.flags = CMIF_KEEPUNTRANSLATED;
- if (g_UnicodeCore)
- menuitem.flags |= CMIF_UNICODE;
+ menuitem.flags = CMIF_KEEPUNTRANSLATED | CMIF_TCHAR;
hMenuitemNotify = Menu_AddContactMenuItem(&menuitem);
bNotify = bStatus;