diff options
author | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-06-25 09:28:02 +0000 |
---|---|---|
committer | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-06-25 09:28:02 +0000 |
commit | de83ac2ff7e90537efc0153adedf2f700b4e7880 (patch) | |
tree | 041495f33ab3b0a2d257fe16d504365cb5c1c8b7 /plugins/NewEventNotify/menuitem.c | |
parent | 2b9baeff76938b09c6708e73edbac95487dc93c3 (diff) |
neweventnotify added - needs adaptation to the new API
git-svn-id: http://svn.miranda-ng.org/main/trunk@629 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/NewEventNotify/menuitem.c')
-rw-r--r-- | plugins/NewEventNotify/menuitem.c | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/plugins/NewEventNotify/menuitem.c b/plugins/NewEventNotify/menuitem.c new file mode 100644 index 0000000000..e0839e6dea --- /dev/null +++ b/plugins/NewEventNotify/menuitem.c @@ -0,0 +1,80 @@ +/*
+ Name: NewEventNotify - Plugin for Miranda IM
+ File: menuitem.c - Manages item(s) in the Miranda Menu
+ Version: 0.0.4
+ Description: Notifies you about some events
+ Author: icebreaker, <icebreaker@newmail.net>
+ Date: 22.07.02 19:56 / Update: 24.07.02 01:39
+ Copyright: (C) 2002 Starzinger Michael
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include "neweventnotify.h"
+#include <m_clist.h>
+
+
+CLISTMENUITEM menuitem;
+HANDLE hMenuitemNotify;
+BOOL bNotify;
+
+static int MenuitemNotifyCmd(WPARAM wParam,LPARAM lParam)
+{
+ bNotify = !bNotify;
+ MenuitemUpdate(bNotify);
+
+ //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;
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuitemNotify, (LPARAM)&menuitem);
+
+ return 0;
+}
+
+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.pszService = MS_NEN_MENUNOTIFY;
+ menuitem.flags = CMIF_KEEPUNTRANSLATED;
+ if (g_UnicodeCore)
+ menuitem.flags |= CMIF_UNICODE;
+ hMenuitemNotify = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&menuitem);
+
+ bNotify = bStatus;
+ MenuitemUpdate(bNotify);
+
+ return 0;
+}
|